目标检测之IoU(intersecton over union)标准

来源:互联网 发布:淘宝电脑版首页登录 编辑:程序博客网 时间:2024/05/01 13:37

https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/

https://www.pyimagesearch.com/wp-content/uploads/2016/09/iou_stop_sign.jpg

绿色代表ground truth box,红色代表predictive box. 

ground truth box 需要手动标注,predictive box是你选用的模型计算出来的结果。

将两者放在一起用IOU来衡量我们的模型检测目标的有效性。

从下图你可以很直观的看到IoU的计算。


Figure 2: Computing the Intersection of Union is as simple as dividing the area of overlap between the bounding boxes by the area of union (thank you to the excellent Pittsburg HW4 assignment for the inspiration for this figure).


Figure 3: An example of computing Intersection over Unions for various bounding boxes.

从python编程的角度实现

defbb_intersection_over_union(boxA,boxB):
# determine the (x, y)-coordinates of the intersection rectangle
xA= max(boxA[0],boxB[0])
yA= max(boxA[1],boxB[1])
xB= min(boxA[2],boxB[2])
yB= min(boxA[3],boxB[3])
 
# compute the area of intersection rectangle
interArea= (xB- xA+ 1)* (yB- yA+ 1)
 
# compute the area of both the prediction and ground-truthrectangles
boxAArea= (boxA[2]- boxA[0]+ 1)* (boxA[3]- boxA[1]+ 1)
boxBArea= (boxB[2]- boxB[0]+ 1)* (boxB[3]- boxB[1]+ 1)
 
# compute the intersection over union by taking the intersection
# area and dividing it by the sum of prediction + ground-truth
# areas - the interesection area
iou= interArea/ float(boxAArea+ boxBArea- interArea)
 
# return the intersection over union value
returniou

Figure 5: Our goal is to evaluate the performs of our object detector by using Intersection of Union. Specifically, we want to measure the accuracy of the predicted bounding box (red) against the ground-truth (green).

Figure 6: Computing the Intersection of Union using Python.

Figure 7: A slightly better Intersection over Union score.



Figure 8: Deriving the Intersection of Union evaluation metric for object detection.

Figure 9: Measuring object detection performance using Intersection over Union.






https://i.imgur.com/I7bkKCu.png

以上这正图片来自IJCV论文“weakly supervised localization and learning with generic knowledge”

图中黄色代表groundtruthbox,红色代表false positive 示例,绿色框代表 true positive,最右端的是未检测到的object,是FN的示例。

图中的Corloc=TP/(TP+FP)=2/3=66%.它与IOU存在的差别在于一个是正确的示例个数之比以及一个是面积之比。



阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 微信话费未到账怎么办 微信话费交错了怎么办 北京移动查话费余额怎么办 淘宝卖家客服无法联系怎么办? 微信支付月限额怎么办 微信超额20万怎么办 微信支付超额了怎么办 微信零钱超额了怎么办 微信的充值冲错了怎么办 有流量还扣话费怎么办 自动取款机充值到电子账户怎么办 淘宝qb充错了怎么办 q币冲错了人家不给怎么办 qq充值话费错号怎么办 qq充错号码了怎么办 qq交话费不到账怎么办 充错手机号码而且是空号怎么办 微信钱包充错话费怎么办 QQ充值话费充到空号了怎么办 给别人充错话费怎么办 用qq交错话费对方是空号怎么办 号码变成空号了怎么办 qq冲流量冲错了怎么办 流量冲错了套餐怎么办 微信流量充错号码怎么办 微信支付不进账怎么办 充话费充不进去怎么办 用支付宝充话费没到账怎么办 支付宝充话费未到账怎么办 话费充了不到账怎么办 转转买家不确认收货怎么办 充话费错了怎么办啊 淘宝充值流量没到账怎么办 微信手机充错了怎么办 支付宝充话费没到账怎么办 裤子摔了一个洞怎么办 顾客反应衣服质量不好怎么办 淘宝买的衣服味道很大怎么办 三国杀账号忘了怎么办 宽带连接被删了 怎么办 手机被偷了qq怎么办