Skip to content

Commit

Permalink
YOLOv3 detectiongit add experimental/dog.jpg!
Browse files Browse the repository at this point in the history
  • Loading branch information
experiencor committed Apr 3, 2018
1 parent e82ecd8 commit b751077
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
15 changes: 14 additions & 1 deletion Yolo Step-by-Step.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,18 @@
"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def normalize(image):\n",
" return image / 255."
]
},
{
"cell_type": "code",
"execution_count": 16,
Expand Down Expand Up @@ -998,7 +1010,8 @@
"end_time": "2018-04-04T00:19:07.263359",
"start_time": "2018-04-04T00:19:05.658285"
},
"collapsed": false
"collapsed": false,
"scrolled": true
},
"outputs": [
{
Expand Down
2 changes: 1 addition & 1 deletion experimental/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This is a work in progress. Only detection with YOLOv3 is supported at the moment.

python yolo3_detect.py -w yolov3.weights -i dog.jpg
python yolo3_detect.py -w yolov3.weights -i dog.jpg
2 changes: 1 addition & 1 deletion experimental/yolo3_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _main_(args):
do_nms(boxes, nms_thresh)

# draw bounding boxes on the image using labels
draw_boxes(image, boxes, labels, obj_thresh)
draw_boxes(image, boxes, labels, obj_thresh)

# write the image with bounding boxes to file
cv2.imwrite(image_path[:-4] + '_detected' + image_path[-4:], (image).astype('uint8'))
Expand Down
2 changes: 1 addition & 1 deletion frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def evaluate(self,
precision = true_positives / np.maximum(true_positives + false_positives, np.finfo(np.float64).eps)

# compute average precision
average_precision = compute_ap(recall, precision)
average_precision = compute_ap(recall, precision)
average_precisions[label] = average_precision

return average_precisions
Expand Down
2 changes: 1 addition & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def reset(self):

def bbox_iou(box1, box2):
intersect_w = _interval_overlap([box1.xmin, box1.xmax], [box2.xmin, box2.xmax])
intersect_h = _interval_overlap([box1.ymin, box1.ymax], [box2.ymin, box2.ymax])
intersect_h = _interval_overlap([box1.ymin, box1.ymax], [box2.ymin, box2.ymax])

intersect = intersect_w * intersect_h

Expand Down

0 comments on commit b751077

Please sign in to comment.