Skip to content

Pipeline not terminated #498

Discussion options

You must be logged in to vote

I fixed it by moving the pipeline.start() inside the try

    try:
        pipeline.start()
        pipeline.join()
    except (KeyboardInterrupt, SystemExit):
        pipeline.terminate()
        print("Program terminated.")

and added this in the on_prediction function

       def on_prediction()
           // code here
            if cv2.waitKey(1) & 0xFF == ord('q'):
                cv2.destroyAllWindows()
                raise SystemExit("Program terminated by user")

now I can quit it by pressing q key

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MubashirWaheed
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants