Skip to content

Instantly share code, notes, and snippets.

@f-rumblefish
Created October 23, 2018 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f-rumblefish/e80824fd87f02c606bbe04c7668d8e75 to your computer and use it in GitHub Desktop.
Save f-rumblefish/e80824fd87f02c606bbe04c7668d8e75 to your computer and use it in GitHub Desktop.
SSD/MobileNet Prediction
# loop 100 bounding boxes
for detection in Net_SSD_pred[0,0,:,:]:
# get the class index
class_index = int(detection[1])
# get the score
score = float(detection[2])
# draw the bounding box
if score > threshold:
left = detection[3] * cols
top = detection[4] * rows
right = detection[5] * cols
bottom = detection[6] * rows
width = right - left
height = bottom - top
box = patch.Rectangle((int(left), int(top)),
width,
height,
linewidth=2, edgecolor='r', facecolor='none')
ax1.add_patch(box)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment