zoukankan      html  css  js  c++  java
  • 模型评测之IoU,mAP,ROC,AUC

    IOU

    在目标检测算法中,交并比Intersection-over-Union,IoU是一个流行的评测方式,是指产生的候选框candidate bound与原标记框ground truth bound的交叠率,即它们的交集与并集的比值。最理想情况是完全重叠,即比值为1。一般来说,这个score > 0.5 就可以被认为一个不错的结果了。

    脚本实现:

    def compute_iou(rec1, rec2):    
         """ 
         computing IoU:
         param rec1: (y0, x0, y1, x1), which reflects (top, left, bottom, right)    
         param rec2: (y0, x0, y1, x1)    
         return: scala value of IoU   
         """    
         # computing area of each rectangles    
         S_rec1 = (rec1[2] - rec1[0]) * (rec1[3] - rec1[1])    
         S_rec2 = (rec2[2] - rec2[0]) * (rec2[3] - rec2[1])     
         # computing the sum_area    
         sum_area = S_rec1 + S_rec2     
         # find the each edge of intersect rectangle    
         left_line = max(rec1[1], rec2[1])    
         right_line = min(rec1[3], rec2[3])    
         top_line = max(rec1[0], rec2[0])    
         bottom_line = min(rec1[2], rec2[2])     
         # judge if there is an intersect    
         if left_line >= right_line or top_line >= bottom_line:        
             return 0    
         else:        
             intersect = (right_line - left_line) * (bottom_line - top_line)        
             return (intersect / (sum_area - intersect))*1.0
    

    mAP

    ROC

    AUC

  • 相关阅读:
    计划任务工具-windows
    [JavaWeb基础] 017.Struts2 和 ajax交互简介
    html5学习之路_007
    [PHP学习教程
    [PHP学习教程
    [注]还原记忆力的真面目
    理解Java对象序列化
    HashTable和HashMap的区别详解
    HDFS NameNode内存全景
    HDFS 原理、架构与特性介绍
  • 原文地址:https://www.cnblogs.com/hayley111/p/13203676.html
Copyright © 2011-2022 走看看