Commit a5ce8c7f authored by Ivan Tyagov's avatar Ivan Tyagov

stop iteration if key pressed ONLY in a non headless mode

parent 9cd47af7
...@@ -185,10 +185,10 @@ async def main(): ...@@ -185,10 +185,10 @@ async def main():
if not headless: if not headless:
cv2.imshow("Frame", frame) cv2.imshow("Frame", frame)
cv2.imshow("Mask", mask) cv2.imshow("Mask", mask)
# stop iteration if key pressed in a non headless mode
key = cv2.waitKey(1) key = cv2.waitKey(1)
if key == 27: if key == 27:
break break
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.ERROR) logging.basicConfig(level=logging.ERROR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment