Precision-Recall Curve feature update #1206
Browse files- utils/general.py +1 -1
utils/general.py
CHANGED
@@ -337,7 +337,7 @@ def compute_ap(recall, precision):
|
|
337 |
# Integrate area under curve
|
338 |
method = 'interp' # methods: 'continuous', 'interp'
|
339 |
if method == 'interp':
|
340 |
-
x = np.linspace(0, 1,
|
341 |
ap = np.trapz(np.interp(x, mrec, mpre), x) # integrate
|
342 |
else: # 'continuous'
|
343 |
i = np.where(mrec[1:] != mrec[:-1])[0] # points where x axis (recall) changes
|
|
|
337 |
# Integrate area under curve
|
338 |
method = 'interp' # methods: 'continuous', 'interp'
|
339 |
if method == 'interp':
|
340 |
+
x = np.linspace(0, 1, 101) # 101-point interp (COCO)
|
341 |
ap = np.trapz(np.interp(x, mrec, mpre), x) # integrate
|
342 |
else: # 'continuous'
|
343 |
i = np.where(mrec[1:] != mrec[:-1])[0] # points where x axis (recall) changes
|