Commit c622eb29 authored by Jonas Müller's avatar Jonas Müller

comments measure mean average precision

parent 37aca0a6
......@@ -76,11 +76,12 @@ def get_map(pred, gt, f):
break
else:
continue
print(found_match)
T[pred_class].append(int(found_match))
for gt_box in gt:
#if not gt_box['bbox_matched'] and not gt_box['difficult']:
# In case the GT was not found by the network
if not gt_box['bbox_matched']:
if gt_box['class'] not in P:
P[gt_box['class']] = []
......@@ -135,7 +136,7 @@ C.model_path = 'data/model_frcnn.hdf5'
img_path = options.test_path
# Adapt size of image to input size of network and return also the resizing values
def format_img(img, C):
img_min_side = float(C.im_size)
(height,width,_) = img.shape
......@@ -209,8 +210,8 @@ all_imgs, _, _ = get_data(options.test_path)
test_imgs = all_imgs
T = {}
P = {}
T = {} # Truth
P = {} # Prediction
for idx, img_data in enumerate(test_imgs):
print('{}/{}'.format(idx,len(test_imgs)))
st = time.time()
......@@ -218,6 +219,9 @@ for idx, img_data in enumerate(test_imgs):
img = cv2.imread(filepath, cv2.IMREAD_IGNORE_ORIENTATION | cv2.IMREAD_COLOR)
# X is the resized image
# fx is the resizing factor along the x axis
# fy is the resizing factor along the y axis
X, fx, fy = format_img(img, C)
if K.image_dim_ordering() == 'tf':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment