Skip to content

Commit

Permalink
add missing return-values of detection model function
Browse files Browse the repository at this point in the history
change from returning just the cropped frame to returning the frame with box
points
  • Loading branch information
jangyj405 committed Aug 21, 2023
1 parent 211d98b commit ac6964d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions model/joodetection/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def infer(self,frame, ):
for entity in annotation_scene.shapes:
x1, y1 = int(entity.x1 * frame.shape[1]), int(entity.y1 * frame.shape[0])
x2, y2 = int(entity.x2 * frame.shape[1]), int(entity.y2 * frame.shape[0])
cropped.append(frame[y1:y2, x1:x2])
cropped.append((frame[y1:y2, x1:x2], (x1,y1), (x2,y2)))
return cropped

def get_detector():
Expand All @@ -36,9 +36,14 @@ def get_detector():
detector = get_detector()
img = cv2.imread('/home/intel/workspace/carplate/images/0000_0001.png')
cropped = detector.infer(img)

for crop in cropped:
cv2.imshow("asdf",crop)
cropped_frame, tl, br = crop
cv2.rectangle(img, tl, br, (255,0,0), thickness=2)
cv2.imshow("asdf",cropped_frame)
cv2.imshow('frame', img)
cv2.waitKey(0)




0 comments on commit ac6964d

Please sign in to comment.