Skip to content

Commit

Permalink
Merge pull request #1 from AlexeyAB/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
edwardxliu authored Sep 28, 2020
2 parents 3aef7cf + 9db0ed9 commit 6c8d550
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion darknet_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def image_detection(image_path, network, class_names, class_colors, thresh):

darknet.copy_image_from_bytes(darknet_image, image_resized.tobytes())
detections = darknet.detect_image(network, class_names, darknet_image, thresh=thresh)
darknet.free_image(darknet_image)
image = darknet.draw_boxes(detections, image_resized, class_colors)
return cv2.cvtColor(image, cv2.COLOR_BGR2RGB), detections

Expand Down Expand Up @@ -139,7 +140,7 @@ def convert2relative(image, bbox):
YOLO format use relative coordinates for annotation
"""
x, y, w, h = bbox
width, height, _ = image.shape
height, width, _ = image.shape
return x/width, y/height, w/width, h/height


Expand Down
1 change: 1 addition & 0 deletions darknet_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def inference(darknet_image_queue, detections_queue, fps_queue):
fps_queue.put(fps)
print("FPS: {}".format(fps))
darknet.print_detections(detections, args.ext_output)
darknet.free_image(darknet_image)
cap.release()


Expand Down

0 comments on commit 6c8d550

Please sign in to comment.