Spaces:
Runtime error
Runtime error
Commit
•
6b1e533
1
Parent(s):
2aae5c8
defined mp_holistic in predict with webcam fn
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def extract_keypoints(results):
|
|
48 |
# Main prediction function that combines everything
|
49 |
def predict_with_webcam(frame):
|
50 |
# Perform holistic detection
|
51 |
-
image, results = mediapipe_detection(frame,
|
52 |
# Extract keypoints
|
53 |
keypoints = extract_keypoints(results)
|
54 |
if np.count_nonzero(keypoints) > 0:
|
@@ -60,6 +60,7 @@ def predict_with_webcam(frame):
|
|
60 |
prediction = outputs[0].argmax()
|
61 |
return str(prediction)
|
62 |
|
|
|
63 |
# Define the Gradio interface with the Webcam input and Text output
|
64 |
webcam_interface = gr.Interface(
|
65 |
fn=predict_with_webcam,
|
|
|
48 |
# Main prediction function that combines everything
|
49 |
def predict_with_webcam(frame):
|
50 |
# Perform holistic detection
|
51 |
+
image, results = mediapipe_detection(frame, mp_holistic) # Use mp_holistic here
|
52 |
# Extract keypoints
|
53 |
keypoints = extract_keypoints(results)
|
54 |
if np.count_nonzero(keypoints) > 0:
|
|
|
60 |
prediction = outputs[0].argmax()
|
61 |
return str(prediction)
|
62 |
|
63 |
+
|
64 |
# Define the Gradio interface with the Webcam input and Text output
|
65 |
webcam_interface = gr.Interface(
|
66 |
fn=predict_with_webcam,
|