Skip to content

Commit 51143b1

Browse files
committed
Also show camera for object detection model
1 parent 359dd7a commit 51143b1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

examples/image/classify.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from edge_impulse_linux.image import ImageImpulseRunner
99

1010
runner = None
11-
show_camera = False
11+
show_camera = True
1212

1313
def now():
1414
return round(time.time() * 1000)
@@ -104,16 +104,16 @@ def main(argv):
104104
print('%s: %.2f\t' % (label, score), end='')
105105
print('', flush=True)
106106

107-
if (show_camera):
108-
cv2.imshow('edgeimpulse', img)
109-
if cv2.waitKey(1) == ord('q'):
110-
break
111-
112107
elif "bounding_boxes" in res["result"].keys():
113108
print('Found %d bounding boxes (%d ms.)' % (len(res["result"]["bounding_boxes"]), res['timing']['dsp'] + res['timing']['classification']))
114109
for bb in res["result"]["bounding_boxes"]:
115110
print('\t%s (%.2f): x=%d y=%d w=%d h=%d' % (bb['label'], bb['value'], bb['x'], bb['y'], bb['width'], bb['height']))
116111

112+
if (show_camera):
113+
cv2.imshow('edgeimpulse', img)
114+
if cv2.waitKey(1) == ord('q'):
115+
break
116+
117117
next_frame = now() + 100
118118
finally:
119119
if (runner):

0 commit comments

Comments
 (0)