Skip to content

Commit 35d064f

Browse files
committed
add precision score
1 parent 0da1a68 commit 35d064f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/utils/tf_iou.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def pred_bbox():
7777
(boxes, scores, classes, num) = sess.run(
7878
[detection_boxes, detection_scores, detection_classes, num_detections],
7979
feed_dict={image_tensor: image_np_expanded})
80-
### 256 here is the image size from Label Maker, ajust it according to your input image size.
80+
### 256 here is the image size from Label Maker, adjust it according to your input image size.
8181
bboxe = (boxes*256).astype(np.int)
8282
bboxe = np.squeeze(bboxe)
8383
score = np.squeeze(((scores*100).transpose()).astype(np.int))
@@ -147,4 +147,10 @@ def get_iou():
147147
category_index = label_map_util.create_category_index(categories)
148148
iou_out = get_iou()
149149
pred_bboxes = pred_bbox()
150-
print("The IOU for your object detection is: {}".format(float(len(iou_out)/len(pred_bboxes))))
150+
gr_bboxes = gr_bbox()
151+
152+
print('*'*40)
153+
print("The precision score is: {}".format(float(len(iou_out)/len(pred_bboxes))))
154+
155+
print("Precision is when the model predicts yes, how often is it correct.")
156+
print('*'*40)

0 commit comments

Comments
 (0)