如何在具有区分训练的基于零件的模型的对象检测中获得零件分数 [英] How to obtain part scores in Object Detection with Discriminatively Trained Part Based Models

查看:194
本文介绍了如何在具有区分训练的基于零件的模型的对象检测中获得零件分数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该代码位于 http://www.cs .berkeley.edu /〜rbg / latent / voc-release5.tgz 广泛用于对象检测。有一个返回 ds bs imgdetect 函数。看起来 ds 包含检测框, bs 包含用于检测的过滤器在图像中是否响应,包含部分信息分数。我无法找到如何使用 bs 获取部分分数。基本上,给定一个检测框,我想知道哪些过滤器在检测中响应,以及用于检测对象的每个过滤器(子部分)的分数是多少。

解决方案

我想出了如何做到这一点,在gdetect_parse.m结束时,添加以下行,边界框(x1,x2,y1,y2) bs 中的第二行,分数将位于树{i}



node_id = 8中的第二行; //确保它是一个叶节点,即树{i}的第二行应为1



tree_id = 1; //检测树之一



scale =(model.sbin / pyra.scales(trees {tree_id}(8,node_id)));



x1 =(trees {tree_id}(6,node_id)-1 - pyra.padx *(2 ^ trees {tree_id}(9,node_id)))* scale + 1



y1 =(trees {tree_id}(7,node_id) - 1 - pyra.pady *(2 ^ trees {tree_id}(9,node_id)))* scale + / p>

filter_id = model.symbols(trees {1}(3,node_id))。filter;



fx = model.filters(filter_id).size(2);



fy = model.filters(filter_id).size(1);



x2 = x1 + fx * scale-1



y2 = y1 + fy * scale- 1


The code which is available at http://www.cs.berkeley.edu/~rbg/latent/voc-release5.tgz is widely used in object detection. There is a imgdetect function which returns ds, bs and trees. It seems ds contains detection boxes and bs contains which of the filters used for detection responded in the image, while trees contains some information about the part scores. I was not able to find out how to get the part scores using trees and bs. Basically, given a detection box, I would like to find out which filters responded in detection and what was the score for each filter (sub part) which was used for detecting an object.

解决方案

I figured out how to do this, at the end of gdetect_parse.m, add the following lines, the bounding boxes (x1, x2, y1, y2) would correspond to the boxes in bs and the scores would be in the second last row in trees{i}

node_id = 8; //ensure that it is a leaf node, i.e second row of trees{i} should be 1

tree_id = 1; //one of the detection trees

scale = (model.sbin/pyra.scales(trees{tree_id}(8, node_id)));

x1 = (trees{tree_id}(6, node_id) - 1 - pyra.padx*(2^trees{tree_id}(9, node_id)))*scale + 1

y1 = (trees{tree_id}(7, node_id) - 1 - pyra.pady*(2^trees{tree_id}(9, node_id)))*scale + 1

filter_id = model.symbols(trees{1}(3, node_id)).filter;

fx = model.filters(filter_id).size(2);

fy = model.filters(filter_id).size(1);

x2 = x1 + fx*scale - 1

y2 = y1 + fy*scale - 1

这篇关于如何在具有区分训练的基于零件的模型的对象检测中获得零件分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆