Toybrick

能不能给一个box_priors.txt文件的ssd_mobilenet生成代码

Sean

中级会员

积分
249
发表于 2019-10-12 16:10:17    查看: 5230|回复: 2 | [复制链接]    打印 | 显示全部楼层
因为ssd用的512尺寸的,demo里面提供的是300*300的box_priors.txt文档。

另外demo里面的代码
void decodeCenterSizeBoxes(float* predictions, float (*boxPriors)[NUM_RESULTS]) {

    for (int i = 0; i < NUM_RESULTS; ++i) {
        float ycenter = predictions[i*4+0] / Y_SCALE * boxPriors[2] + boxPriors[0];
        float xcenter = predictions[i*4+1] / X_SCALE * boxPriors[3] + boxPriors[1];
        float h = (float) exp(predictions[i*4 + 2] / H_SCALE) * boxPriors[2];
        float w = (float) exp(predictions[i*4 + 3] / W_SCALE) * boxPriors[3];


看的不是很明白,里面的SCALE不知道是什么意思,还有最后两行取exp也不太理解,希望能解答一下,谢谢


回复

使用道具 举报

Sean

中级会员

积分
249
 楼主| 发表于 2019-10-12 16:21:27 | 显示全部楼层
void decodeCenterSizeBoxes(float* predictions, float (*boxPriors)[NUM_RESULTS]) {
    for (int i = 0; i < NUM_RESULTS; ++i) {
        float ycenter = predictions[i*4+0] / Y_SCALE * boxPriors[2] + boxPriors[0];
        float xcenter = predictions[i*4+1] / X_SCALE * boxPriors[3] + boxPriors[1];
        float h = (float) exp(predictions[i*4 + 2] / H_SCALE) * boxPriors[2];
        float w = (float) exp(predictions[i*4 + 3] / W_SCALE) * boxPriors[3];
回复

使用道具 举报

troy

版主

积分
2346
发表于 2019-10-12 16:27:30 | 显示全部楼层
Sean 发表于 2019-10-12 16:21
void decodeCenterSizeBoxes(float* predictions, float (*boxPriors)[NUM_RESULTS]) {
    for (int i = 0 ...

参考一下这个网上的这个帖子,这些东西都是SSD的东西,跟模型相关的,就是模型约定的先验框的编码方式。这个帖子看前面几段就好了。https://blog.csdn.net/qq_3413242 ... cetag=s_pcqq_aiomsg
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表