Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gen2 NN sync output freezes if there is no input #99

Closed
dhruvmsheth opened this issue Mar 18, 2021 · 1 comment
Closed

Gen2 NN sync output freezes if there is no input #99

dhruvmsheth opened this issue Mar 18, 2021 · 1 comment

Comments

@dhruvmsheth
Copy link
Contributor

The Gen2 NN Sync inferencing basically freezes if the face_frame is none, because the loop gets stuck on the place if there is no face detected in the first frame -

            while q_land.has():
                face_frame = face_q.get()
                out = frame_norm(face_frame, q_land.get().getFirstLayerFp16())
                cv2.circle(face_frame, tuple(out[:2]), 1, (255, 255, 0))  # Right eye
                cv2.circle(face_frame, tuple(out[2:4]), 1, (255, 255, 0))  # Left eye
                cv2.circle(face_frame, tuple(out[4:6]), 1, (255, 255, 0))  # Nose
                cv2.circle(face_frame, tuple(out[6:8]), 1, (255, 255, 0))  # Right mouth
                cv2.circle(face_frame, tuple(out[8:]), 1, (255, 255, 0))  # Left mouth
                cv2.imshow("face", face_frame)

An alternative could be using threading, so even though face_frame is not extracted, the main loop could continue to work.
@VanDavv

@Luxonis-Brandon
Copy link
Contributor

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants