Created
May 14, 2019 02:28
-
-
Save qmaruf/f59601100e51243cc560c7c150205a30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = image_np.copy()/255.0 | |
im_height, im_width, _ = img.shape | |
print (width, height) | |
for boxes, classes, scores in zip(output_dict['detection_boxes'], output_dict['detection_classes'], output_dict['detection_scores']): | |
if classes == 1 and scores >= 0.5: | |
ymin, xmin, ymax, xmax = boxes | |
xmin, xmax, ymin, ymax = xmin * im_width, xmax * im_width, ymin * im_height, ymax * im_height | |
xmin, xmax, ymin, ymax = int(xmin), int(xmax), int(ymin), int(ymax) | |
print (left, right, top, bottom) | |
img = cv2.rectangle(img, (xmin, ymin), (xmax, ymax), (255, 255, 0), 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment