Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
|
4 |
# Install mediapipe
|
@@ -12,6 +12,7 @@ from time import time
|
|
12 |
import mediapipe as mp
|
13 |
import matplotlib.pyplot as plt
|
14 |
#from openpose import pyopenpose as op
|
|
|
15 |
|
16 |
#*******************Initialize the Pose Detection Model*****************
|
17 |
|
@@ -369,7 +370,8 @@ def classifyPose(landmarks, output_image, display=False):
|
|
369 |
#******************************Pose Classification On Real-Time Webcam Feed*****************
|
370 |
|
371 |
# Setup Pose function for video.
|
372 |
-
pose_video = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.5, model_complexity=
|
|
|
373 |
|
374 |
# Initialize the VideoCapture object to read from the webcam.
|
375 |
camera_video = cv2.VideoCapture(0)
|
@@ -435,3 +437,6 @@ iface = gr.Interface(
|
|
435 |
title="Live Yoga Pose Detection",
|
436 |
description="This app detects yoga poses from the live camera feed using MediaPipe.",
|
437 |
)
|
|
|
|
|
|
|
|
1 |
+
import transformers
|
2 |
import gradio as gr
|
3 |
|
4 |
# Install mediapipe
|
|
|
12 |
import mediapipe as mp
|
13 |
import matplotlib.pyplot as plt
|
14 |
#from openpose import pyopenpose as op
|
15 |
+
from transformers import pipeline
|
16 |
|
17 |
#*******************Initialize the Pose Detection Model*****************
|
18 |
|
|
|
370 |
#******************************Pose Classification On Real-Time Webcam Feed*****************
|
371 |
|
372 |
# Setup Pose function for video.
|
373 |
+
#pose_video = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.5, model_complexity=2)
|
374 |
+
pose_video = mp_pose.Pose(static_image_mode=False, min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
375 |
|
376 |
# Initialize the VideoCapture object to read from the webcam.
|
377 |
camera_video = cv2.VideoCapture(0)
|
|
|
437 |
title="Live Yoga Pose Detection",
|
438 |
description="This app detects yoga poses from the live camera feed using MediaPipe.",
|
439 |
)
|
440 |
+
|
441 |
+
# Launch the interface
|
442 |
+
iface.launch()
|