Skip to content
Snippets Groups Projects
Commit 63b9d104 authored by simon wu's avatar simon wu Committed by Kai Chen
Browse files

Press key to exit (#1155)

parent 87d9ca49
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,15 @@ def main(): ...@@ -27,9 +27,15 @@ def main():
camera = cv2.VideoCapture(args.camera_id) camera = cv2.VideoCapture(args.camera_id)
print('Press "Esc", "q" or "Q" to exit.')
while True: while True:
ret_val, img = camera.read() ret_val, img = camera.read()
result = inference_detector(model, img) result = inference_detector(model, img)
ch = cv2.waitKey(1)
if ch == 27 or ch == ord('q') or ch == ord('Q'):
break
show_result( show_result(
img, result, model.CLASSES, score_thr=args.score_thr, wait_time=1) img, result, model.CLASSES, score_thr=args.score_thr, wait_time=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment