Skip to content

Commit

Permalink
minor update to yolo.py code
Browse files Browse the repository at this point in the history
  • Loading branch information
sthanhng committed Jan 14, 2019
1 parent 3eb897a commit 026930a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions yolo/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@ def detect_img(yolo):
try:
image = Image.open(img)
except:
print('*** Open Error! Try again!')
continue
if img == 'q' or img == 'Q':
break
else:
print('*** Open Error! Try again!')
continue
else:
res_image, _ = yolo.detect_image(image)
res_image.show()

yolo.close_session()


Expand Down Expand Up @@ -247,6 +249,5 @@ def detect_video(model, video_path=None, output=None):
vid.release()
out.release()
cv2.destroyAllWindows()

# close the session
model.close_session()

0 comments on commit 026930a

Please sign in to comment.