Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -520,45 +520,6 @@ while camera_video.isOpened():
|
|
520 |
camera_video.release()
|
521 |
st.stop()
|
522 |
cv2.destroyAllWindows()
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
'''# Accessing the webcam
|
535 |
-
cap = cv2.VideoCapture(0)
|
536 |
-
|
537 |
-
# Run the app
|
538 |
-
while True:
|
539 |
-
ret, frame = cap.read()
|
540 |
-
|
541 |
-
# Display the webcam feed
|
542 |
-
st.image(frame, channels="BGR")
|
543 |
-
|
544 |
-
# Convert the OpenCV frame to PIL image
|
545 |
-
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
546 |
-
#pil_image = Image.fromarray(frame)
|
547 |
-
|
548 |
-
# Detect yoga pose from the image
|
549 |
-
pose = detect_yoga_pose(pil_image)
|
550 |
-
|
551 |
-
# Display the detected yoga pose
|
552 |
-
st.write("Detected Yoga Pose:", pose)
|
553 |
-
|
554 |
-
# Close the webcam feed
|
555 |
-
if st.button("Stop"):
|
556 |
-
break
|
557 |
-
|
558 |
-
# Release the webcam and close Streamlit app
|
559 |
-
cap.release()
|
560 |
-
st.stop()
|
561 |
-
'''
|
562 |
|
563 |
if __name__ == "__main__":
|
564 |
main()
|
|
|
520 |
camera_video.release()
|
521 |
st.stop()
|
522 |
cv2.destroyAllWindows()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
|
524 |
if __name__ == "__main__":
|
525 |
main()
|