Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,22 @@
|
|
| 1 |
import cv2
|
| 2 |
-
import
|
| 3 |
import numpy as np
|
| 4 |
import gradio as gr
|
| 5 |
from moviepy import VideoFileClip
|
| 6 |
-
import os
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
# Create "Meaty" drawing specs
|
| 13 |
-
# High thickness (10) and larger circles (15) for better pixel tracking
|
| 14 |
MEATY_CONNECTIONS = mp_drawing.DrawingSpec(color=(0, 255, 0), thickness=10, circle_radius=5)
|
| 15 |
MEATY_JOINTS = mp_drawing.DrawingSpec(color=(255, 255, 255), thickness=12, circle_radius=15)
|
| 16 |
|
|
|
|
| 1 |
import cv2
|
| 2 |
+
import os
|
| 3 |
import numpy as np
|
| 4 |
import gradio as gr
|
| 5 |
from moviepy import VideoFileClip
|
|
|
|
| 6 |
|
| 7 |
+
# Robust MediaPipe Import
|
| 8 |
+
try:
|
| 9 |
+
import mediapipe as mp
|
| 10 |
+
from mediapipe.python.solutions import pose as mp_pose
|
| 11 |
+
from mediapipe.python.solutions import drawing_utils as mp_drawing
|
| 12 |
+
print("MediaPipe Solutions loaded successfully!")
|
| 13 |
+
except ImportError as e:
|
| 14 |
+
print(f"Direct import failed, trying legacy: {e}")
|
| 15 |
+
import mediapipe as mp
|
| 16 |
+
mp_pose = mp.solutions.pose
|
| 17 |
+
mp_drawing = mp.solutions.drawing_utils
|
| 18 |
|
| 19 |
+
# Create "Meaty" drawing specs
|
|
|
|
| 20 |
MEATY_CONNECTIONS = mp_drawing.DrawingSpec(color=(0, 255, 0), thickness=10, circle_radius=5)
|
| 21 |
MEATY_JOINTS = mp_drawing.DrawingSpec(color=(255, 255, 255), thickness=12, circle_radius=15)
|
| 22 |
|