{"id":836,"date":"2021-12-27T16:01:19","date_gmt":"2021-12-27T08:01:19","guid":{"rendered":"http:\/\/139.9.1.231\/?p=836"},"modified":"2023-02-13T15:56:11","modified_gmt":"2023-02-13T07:56:11","slug":"map","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2021\/12\/27\/map\/","title":{"rendered":"mAP&#8212;&#8211;\u76ee\u6807\u68c0\u6d4b"},"content":{"rendered":"\n<p>\u5728\u8bc4\u4ef7\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5\u7684\u201c\u597d\u574f\u201d\u7a0b\u5ea6\u7684\u65f6\u5019\uff0c\u5f80\u5f80\u91c7\u7528\u7684\u662fpascal voc 2012\u7684\u8bc4\u4ef7\u6807\u51c6mAP\u3002<\/p>\n\n\n\n<p>\u5b98\u65b9\u5b9a\u4e49\uff1a<\/p>\n\n\n\n<ol><li>Compute a version of the measured precision\/recall curve with precision monotonically decreasing, by setting the precision for recall r to the maximum precision obtained for any recall r\u2032 \u2265 r.<\/li><li>Compute the AP as the area under this curve by numerical integration. No approximation is involved since the curve is piecewise constant.<\/li><\/ol>\n\n\n\n<p>Note that prior to 2010 the AP is computed by sampling the monotonically<\/p>\n\n\n\n<p>decreasing curve at a fixed set of uniformly-spaced recall values 0, 0.1, 0.2, . . . , 1. By contrast, VOC2010\u20132012 effectively samples the curve at all unique recall values.<\/p>\n\n\n\n<p><strong>mAP\uff08\u5747\u503c\u5e73\u5747\u7cbe\u5ea6\uff09<\/strong>\u662f\u76ee\u6807\u68c0\u6d4b\u4e2d\u7684\u6700\u5e38\u7528\u7684\u8bc4\u4ef7\u6307\u6807\uff0c\u8be6\u7ec6\u7406\u89e3\u5176\u8ba1\u7b97\u65b9\u5f0f\u6709\u52a9\u4e8e\u6211\u4eec\u8bc4\u4f30\u7b97\u6cd5\u7684\u6709\u6548\u6027\uff0c\u5e76\u9488\u5bf9\u8bc4\u6d4b\u6307\u6807\u5bf9\u7b97\u6cd5\u8fdb\u884c\u8c03\u6574\u3002mean Average Precision, \u5373\u5404\u7c7b\u522bAP\u7684\u5e73\u5747\u503c<\/p>\n\n\n\n<p><strong>TP TN FP FN\uff1a<\/strong><\/p>\n\n\n\n<p>T\u6216\u8005N\u4ee3\u8868\u7684\u662f\u8be5\u6837\u672c\u662f\u5426\u88ab\u5206\u7c7b\u5206\u5bf9\uff0cP\u6216\u8005N\u4ee3\u8868\u7684\u662f\u8be5\u6837\u672c\u88ab\u5206\u4e3a\u4ec0\u4e48<\/p>\n\n\n\n<p>TP\uff08True Positives\uff09\u610f\u601d\u6211\u4eec\u5012\u7740\u6765\u7ffb\u8bd1\u5c31\u662f\u201c\u88ab\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u5e76\u4e14\u5206\u5bf9\u4e86\u201d\uff0cTN\uff08True Negatives\uff09\u610f\u601d\u662f\u201c\u88ab\u5206\u4e3a\u8d1f\u6837\u672c\uff0c\u800c\u4e14\u5206\u5bf9\u4e86\u201d\uff0cFP\uff08False Positives\uff09\u610f\u601d\u662f\u201c\u88ab\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u4f46\u662f\u5206\u9519\u4e86\u201d\uff0cFN\uff08False Negatives\uff09\u610f\u601d\u662f\u201c\u88ab\u5206\u4e3a\u8d1f\u6837\u672c\uff0c\u4f46\u662f\u5206\u9519\u4e86\u201d\u3002<\/p>\n\n\n\n<p>\u6309\u4e0b\u56fe\u6765\u89e3\u91ca\uff0c\u5de6\u534a\u77e9\u5f62\u662f\u6b63\u6837\u672c\uff0c\u53f3\u534a\u77e9\u5f62\u662f\u8d1f\u6837\u672c\u3002\u4e00\u4e2a2\u5206\u7c7b\u5668\uff0c\u5728\u56fe\u4e0a\u753b\u4e86\u4e2a\u5706\uff0c\u5206\u7c7b\u5668\u8ba4\u4e3a\u5706\u5185\u662f\u6b63\u6837\u672c\uff0c\u5706\u5916\u662f\u8d1f\u6837\u672c\u3002\u90a3\u4e48\u5de6\u534a\u5706\u5206\u7c7b\u5668\u8ba4\u4e3a\u662f\u6b63\u6837\u672c\uff0c\u540c\u65f6\u5b83\u786e\u5b9e\u662f\u6b63\u6837\u672c\uff0c\u90a3\u4e48\u5c31\u662f\u201c\u88ab\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u5e76\u4e14\u5206\u5bf9\u4e86\u201d\u5373TP\uff0c\u5de6\u534a\u77e9\u5f62\u6263\u9664\u5de6\u534a\u5706\u7684\u90e8\u5206\u5c31\u662f\u5206\u7c7b\u5668\u8ba4\u4e3a\u5b83\u662f\u8d1f\u6837\u672c\uff0c\u4f46\u662f\u5b83\u672c\u8eab\u5374\u662f\u6b63\u6837\u672c\uff0c\u5c31\u662f\u201c\u88ab\u5206\u4e3a\u8d1f\u6837\u672c\uff0c\u4f46\u662f\u5206\u9519\u4e86\u201d\u5373FN\u3002\u53f3\u534a\u5706\u5206\u7c7b\u5668\u8ba4\u4e3a\u5b83\u662f\u6b63\u6837\u672c\uff0c\u4f46\u662f\u672c\u8eab\u5374\u662f\u8d1f\u6837\u672c\uff0c\u90a3\u4e48\u5c31\u662f\u201c\u88ab\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u4f46\u662f\u5206\u9519\u4e86\u201d\u5373FP\u3002\u53f3\u534a\u77e9\u5f62\u6263\u9664\u53f3\u534a\u5706\u7684\u90e8\u5206\u5c31\u662f\u5206\u7c7b\u5668\u8ba4\u4e3a\u5b83\u662f\u8d1f\u6837\u672c\uff0c\u540c\u65f6\u5b83\u672c\u8eab\u786e\u5b9e\u662f\u8d1f\u6837\u672c\uff0c\u90a3\u4e48\u5c31\u662f\u201c\u88ab\u5206\u4e3a\u8d1f\u6837\u672c\uff0c\u800c\u4e14\u5206\u5bf9\u4e86\u201d\u5373TN\u3002<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img src=\"https:\/\/www.italk2learn.com\/wp-content\/uploads\/2015\/05\/precisionandrecall.png\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p><strong>Precision\uff08\u7cbe\u5ea6\uff09\u548cRecall\uff08\u53ec\u56de\u7387\uff09\u7684\u6982\u5ff5\uff1a<\/strong><\/p>\n\n\n\n<p> Precision\uff08\u7cbe\u5ea6 \uff09\u7ffb\u8bd1\u6210\u4e2d\u6587\u5c31\u662f\u201c\u5206\u7c7b\u5668\u8ba4\u4e3a\u662f\u6b63\u7c7b\u5e76\u4e14\u786e\u5b9e\u662f\u6b63\u7c7b\u7684\u90e8\u5206\u5360\u6240\u6709\u5206\u7c7b\u5668\u8ba4\u4e3a\u662f\u6b63\u7c7b\u7684\u6bd4\u4f8b\u201d\uff0c\u8861\u91cf\u7684\u662f\u4e00\u4e2a\u5206\u7c7b\u5668\u5206\u51fa\u6765\u7684\u6b63\u7c7b\u7684\u786e\u662f\u6b63\u7c7b\u7684\u6982\u7387\u3002\u4e24\u79cd\u6781\u7aef\u60c5\u51b5\u5c31\u662f\uff0c\u5982\u679c\u7cbe\u5ea6\u662f100%\uff0c\u5c31\u4ee3\u8868\u6240\u6709\u5206\u7c7b\u5668\u5206\u51fa\u6765\u7684\u6b63\u7c7b\u786e\u5b9e\u90fd\u662f\u6b63\u7c7b\u3002\u5982\u679c\u7cbe\u5ea6\u662f0%\uff0c\u5c31\u4ee3\u8868\u5206\u7c7b\u5668\u5206\u51fa\u6765\u7684\u6b63\u7c7b\u6ca1\u4e00\u4e2a\u662f\u6b63\u7c7b\u3002\u5149\u662f\u7cbe\u5ea6\u8fd8\u4e0d\u80fd\u8861\u91cf\u5206\u7c7b\u5668\u7684\u597d\u574f\u7a0b\u5ea6\uff0c\u6bd4\u598250\u4e2a\u6b63\u6837\u672c\u548c50\u4e2a\u8d1f\u6837\u672c\uff0c\u6211\u7684\u5206\u7c7b\u5668\u628a49\u4e2a\u6b63\u6837\u672c\u548c50\u4e2a\u8d1f\u6837\u672c\u90fd\u5206\u4e3a\u8d1f\u6837\u672c\uff0c\u5269\u4e0b\u4e00\u4e2a\u6b63\u6837\u672c\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u8fd9\u6837\u6211\u7684\u7cbe\u5ea6\u4e5f\u662f100%\uff0c\u4f46\u662f\u50bb\u5b50\u4e5f\u77e5\u9053\u8fd9\u4e2a\u5206\u7c7b\u5668\u5f88\u5783\u573e\u3002<\/p>\n\n\n\n<p> Recall\uff08\u53ec\u56de\u7387\uff09 \uff0c\u7ffb\u8bd1\u6210\u4e2d\u6587\u5c31\u662f\u201c\u5206\u7c7b\u5668\u8ba4\u4e3a\u662f\u6b63\u7c7b\u5e76\u4e14\u786e\u5b9e\u662f\u6b63\u7c7b\u7684\u90e8\u5206\u5360\u6240\u6709\u786e\u5b9e\u662f\u6b63\u7c7b\u7684\u6bd4\u4f8b\u201d\uff0c\u8861\u91cf\u7684\u662f\u4e00\u4e2a\u5206\u7c7b\u80fd\u628a\u6240\u6709\u7684\u6b63\u7c7b\u90fd\u627e\u51fa\u6765\u7684\u80fd\u529b\u3002\u4e24\u79cd\u6781\u7aef\u60c5\u51b5\uff0c\u5982\u679c\u53ec\u56de\u7387\u662f100%\uff0c\u5c31\u4ee3\u8868\u6240\u6709\u7684\u6b63\u7c7b\u90fd\u88ab\u5206\u7c7b\u5668\u5206\u4e3a\u6b63\u7c7b\u3002\u5982\u679c\u53ec\u56de\u7387\u662f0%\uff0c\u5c31\u4ee3\u8868\u6ca1\u4e00\u4e2a\u6b63\u7c7b\u88ab\u5206\u4e3a\u6b63\u7c7b\u3002<\/p>\n\n\n\n<p><strong>IOU\uff08\u4ea4\u5e76\u6bd4\uff09<\/strong><\/p>\n\n\n\n<p>\u5b83\u662f\u6a21\u578b\u6240<strong>\u9884\u6d4b<\/strong>\u7684\u68c0\u6d4b\u6846(bbox)\u548c<strong>\u771f\u5b9e<\/strong>\u7684\u68c0\u6d4b\u6846(ground truth)\u7684<strong>\u4ea4\u96c6\u548c\u5e76\u96c6\u4e4b\u95f4\u7684\u6bd4\u4f8b<\/strong>\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/08\/image-377.png\" alt=\"\" class=\"wp-image-6408\" width=\"368\" height=\"239\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/08\/image-377.png 498w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/08\/image-377-300x195.png 300w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><figcaption>IOU<\/figcaption><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code>def Iou(rec1,rec2):\n  x1,x2,y1,y2 = rec1 #\u5206\u522b\u662f\u7b2c\u4e00\u4e2a\u77e9\u5f62\u5de6\u53f3\u4e0a\u4e0b\u7684\u5750\u6807\n  x3,x4,y3,y4 = rec2 #\u5206\u522b\u662f\u7b2c\u4e8c\u4e2a\u77e9\u5f62\u5de6\u53f3\u4e0a\u4e0b\u7684\u5750\u6807\n  area_1 = (x2-x1)*(y1-y2)\n  area_2 = (x4-x3)*(y3-y4)\n  sum_area = area_1 + area_2\n  w1 = x2 - x1#\u7b2c\u4e00\u4e2a\u77e9\u5f62\u7684\u5bbd\n  w2 = x4 - x3#\u7b2c\u4e8c\u4e2a\u77e9\u5f62\u7684\u5bbd\n  h1 = y1 - y2\n  h2 = y3 - y4\n  W = min(x1,x2,x3,x4)+w1+w2-max(x1,x2,x3,x4)#\u4ea4\u53c9\u90e8\u5206\u7684\u5bbd\n  H = min(y1,y2,y3,y4)+h1+h2-max(y1,y2,y3,y4)#\u4ea4\u53c9\u90e8\u5206\u7684\u9ad8\n  Area = W*H#\u4ea4\u53c9\u7684\u9762\u79ef\n  Iou = Area\/(sum_area-Area)\n  return Iou<\/code><\/pre>\n\n\n\n<h1>\u4e3e\u4f8b\u8ba1\u7b97mAP<\/h1>\n\n\n\n<p>\u67093\u5f20\u56fe\u5982\u4e0b\uff0c\u8981\u6c42\u7b97\u6cd5\u627e\u51faface\u3002\u84dd\u8272\u6846\u4ee3\u8868\u6807\u7b7elabel\uff0c\u7eff\u8272\u6846\u4ee3\u8868\u7b97\u6cd5\u7ed9\u51fa\u7684\u7ed3\u679cpre\uff0c\u65c1\u8fb9\u7684\u7ea2\u8272\u5c0f\u5b57\u4ee3\u8868\u7f6e\u4fe1\u5ea6\u3002\u8bbe\u5b9a\u7b2c\u4e00\u5f20\u56fe\u7684\u68c0\u51fa\u6846\u53ebpre1\uff0c\u7b2c\u4e00\u5f20\u7684\u6807\u7b7e\u6846\u53eblabel1\u3002\u7b2c\u4e8c\u5f20\u3001\u7b2c\u4e09\u5f20\u540c\u7406\u3002<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/codeantenna.com\/image\/https:\/\/img-blog.csdn.net\/20180815143738221?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hzcXlj\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"192\" height=\"287\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/codeantenna.com\/image\/https:\/\/img-blog.csdn.net\/20180815143852539?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hzcXlj\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"303\" height=\"231\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/codeantenna.com\/image\/https:\/\/img-blog.csdn.net\/20180815143927959?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hzcXlj\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\" width=\"326\" height=\"221\"\/><\/figure><\/div>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u8ba1\u7b97\u6bcf\u5f20\u56fe\u7684pre\u548clabel\u7684IOU\uff0c<strong>\u6839\u636eIOU\u662f\u5426\u5927\u4e8e0.5\u6765\u5224\u65ad\u8be5pre\u662f\u5c5e\u4e8eTP\uff08\u5206\u6210\u6b63\u6837\u672c\uff0c\u5206\u5bf9\u4e86\uff09\u8fd8\u662f\u5c5e\u4e8eFP\uff08\u88ab\u5206\u4e3a\u6b63\u6837\u672c\uff0c\u4f46\u662f\u5206\u9519\u4e86\uff09\u3002\u663e\u800c\u6613\u89c1\uff0cpre1\u662fTP\uff0cpre2\u662fFP\uff0cpre3\u662fTP\u3002<\/strong><\/p>\n\n\n\n<p>\u6839\u636e\u6bcf\u4e2apre\u7684\u7f6e\u4fe1\u5ea6\u8fdb\u884c\u4ece\u9ad8\u5230\u4f4e\u6392\u5e8f\uff0c\u8fd9\u91ccpre1\u3001pre2\u3001pre3\u7f6e\u4fe1\u5ea6\u521a\u597d\u5c31\u662f\u4ece\u9ad8\u5230\u4f4e\u3002<\/p>\n\n\n\n<p><strong>\u5728\u4e0d\u540c\u7f6e\u4fe1\u5ea6\u9608\u503c\u4e0b\u83b7\u5f97Precision\u548cRecall\uff1a<\/strong><\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u8bbe\u7f6e\u9608\u503c\u4e3a0.9\uff0c\u65e0\u89c6\u6240\u6709\u5c0f\u4e8e0.9\u7684pre\u3002\u90a3\u4e48\u68c0\u6d4b\u5668\u68c0\u51fa\u7684\u6240\u6709\u6846pre\u5373TP+FP=1\uff0c\u5e76\u4e14pre1\u662fTP\uff0c\u90a3\u4e48Precision=1\/1\u3002\u56e0\u4e3a\u6240\u6709\u7684label=3\uff0c\u6240\u4ee5Recall=1\/3\u3002\u8fd9\u6837\u5c31\u5f97\u5230\u4e00\u7ec4P\u3001R\u503c\u3002<\/p>\n\n\n\n<p>\u7136\u540e\uff0c\u8bbe\u7f6e\u9608\u503c\u4e3a0.8\uff0c\u65e0\u89c6\u6240\u6709\u5c0f\u4e8e0.8\u7684pre\u3002\u90a3\u4e48\u68c0\u6d4b\u5668\u68c0\u51fa\u7684\u6240\u6709\u6846pre\u5373TP+FP=2\uff0c\u56e0\u4e3apre1\u662fTP\uff0cpre2\u662fFP\uff0c\u90a3\u4e48Precision=1\/2=0.5\u3002\u56e0\u4e3a\u6240\u6709\u7684label=3\uff0c\u6240\u4ee5Recall=1\/3=0.33\u3002\u8fd9\u6837\u5c31\u53c8\u5f97\u5230\u4e00\u7ec4P\u3001R\u503c\u3002<\/p>\n\n\n\n<p>\u518d\u7136\u540e\uff0c<strong>\u8bbe\u7f6e\u9608\u503c\u4e3a0.7<\/strong>\uff0c\u65e0\u89c6\u6240\u6709\u5c0f\u4e8e0.7\u7684pre\u3002\u90a3\u4e48\u68c0\u6d4b\u5668\u68c0\u51fa\u7684\u6240\u6709\u6846pre\u5373TP+FP=3\uff0c\u56e0\u4e3apre1\u662fTP\uff0cpre2\u662fFP\uff0cpre3\u662fTP\uff0c\u90a3\u4e48Precision=2\/3=0.67\u3002\u56e0\u4e3a\u6240\u6709\u7684label=3\uff0c\u6240\u4ee5Recall=2\/3=0.67\u3002\u8fd9\u6837\u5c31\u53c8\u5f97\u5230\u4e00\u7ec4P\u3001R\u503c\u3002<\/p>\n\n\n\n<p>\u6839\u636e\u4e0a\u97623\u7ec4PR\u503c\u7ed8\u5236PR\u66f2\u7ebf\u5982\u4e0b\u3002\u7136\u540e\u6bcf\u4e2a\u201c\u5cf0\u503c\u70b9\u201d\u5f80\u5de6\u753b\u4e00\u6761\u7ebf\u6bb5\u76f4\u5230\u4e0e\u4e0a\u4e00\u4e2a\u5cf0\u503c\u70b9\u7684\u5782\u76f4\u7ebf\u76f8\u4ea4\u3002\u8fd9\u6837\u753b\u51fa\u6765\u7684\u7ea2\u8272\u7ebf\u6bb5\u4e0e\u5750\u6807\u8f74\u56f4\u8d77\u6765\u7684\u9762\u79ef\u5c31\u662fAP\u503c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img src=\"https:\/\/codeantenna.com\/image\/https:\/\/img-blog.csdn.net\/20180816143442457?watermark\/2\/text\/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2hzcXlj\/font\/5a6L5L2T\/fontsize\/400\/fill\/I0JBQkFCMA==\/dissolve\/70\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2>\u8ba1\u7b97mAP<\/h2>\n\n\n\n<p><br>AP\u8861\u91cf\u7684\u662f\u5bf9\u4e00\u4e2a\u7c7b\u68c0\u6d4b\u597d\u574f\uff0cmAP\u5c31\u662f\u5bf9\u591a\u4e2a\u7c7b\u7684\u68c0\u6d4b\u597d\u574f\u3002\u5c31\u662f\u7b80\u5355\u7c97\u66b4\u7684\u628a\u6240\u6709\u7c7b\u7684AP\u503c\u53d6\u5e73\u5747\u5c31\u597d\u4e86\u3002\u6bd4\u5982\u6709\u4e24\u7c7b\uff0c\u7c7bA\u7684AP\u503c\u662f0.5\uff0c\u7c7bB\u7684AP\u503c\u662f0.2\uff0c\u90a3\u4e48mAP=\uff080.5+0.2\uff09\/2=0.35<\/p>\n\n\n\n<p>\u8ba1\u7b97mAP\u7684github\u5730\u5740\uff1a<\/p>\n\n\n\n<p class=\"has-bright-blue-background-color has-background\"><a href=\"https:\/\/github.com\/Cartucho\/mAP\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/Cartucho\/mAP<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># AP\u7684\u8ba1\u7b97\ndef _average_precision(self, rec, prec):\n    \"\"\"\n    Params:\n    ----------\n    rec : numpy.array\n            cumulated recall\n    prec : numpy.array\n            cumulated precision\n    Returns:\n    ----------\n    ap as float\n    \"\"\"\n    if rec is None or prec is None:\n        return np.nan\n    ap = 0.\n    for t in np.arange(0., 1.1, 0.1):  #\u5341\u4e00\u4e2a\u70b9\u7684\u53ec\u56de\u7387\uff0c\u5bf9\u5e94\u7cbe\u5ea6\u6700\u5927\u503c\n        if np.sum(rec &gt;= t) == 0:\n            p = 0\n        else:\n            p = np.max(np.nan_to_num(prec)&#91;rec &gt;= t])\n        ap += p \/ 11.  #\u52a0\u6743\u5e73\u5747\n    return ap<\/code><\/pre>\n\n\n\n<h2> \u6b63\u786e\u7406\u89e3 YOLO \u7684\u8fa8\u8bc6\u51c6\u786e\u7387 <\/h2>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img src=\"https:\/\/i.imgur.com\/NG4nEoT.png\" alt=\"\"\/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u8bc4\u4ef7\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5\u7684\u201c\u597d\u574f\u201d\u7a0b\u5ea6\u7684\u65f6\u5019\uff0c\u5f80\u5f80\u91c7\u7528\u7684\u662fpascal voc 2012\u7684\u8bc4\u4ef7\u6807\u51c6mAP\u3002 \u5b98\u65b9 &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2021\/12\/27\/map\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">mAP&#8212;&#8211;\u76ee\u6807\u68c0\u6d4b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,12],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/836"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=836"}],"version-history":[{"count":24,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/836\/revisions"}],"predecessor-version":[{"id":14022,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/836\/revisions\/14022"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=836"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}