linoyts HF Staff commited on
Commit
6950574
·
verified ·
1 Parent(s): b8f8b4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -119,8 +119,9 @@ import imageio
119
  import cv2
120
  from PIL import Image
121
 
122
- # Lazy-loaded processors (heavy models, only init when needed)
123
- _pose_processor = None
 
124
  _depth_processor = None
125
 
126
 
@@ -172,7 +173,7 @@ def extract_first_frame(video_path: str) -> str:
172
 
173
  def preprocess_video_pose(frames: list[np.ndarray], width: int, height: int) -> list[np.ndarray]:
174
  """Extract DWPose skeletons from each frame. Returns float [0,1] frames."""
175
- processor = _get_pose_processor()
176
  result = []
177
  for frame in frames:
178
  pil = Image.fromarray(frame.astype(np.uint8)).convert("RGB")
 
119
  import cv2
120
  from PIL import Image
121
 
122
+ from dwpose import DwposeDetector
123
+ processor = DwposeDetector.from_pretrained_default() #load pose processor by default
124
+
125
  _depth_processor = None
126
 
127
 
 
173
 
174
  def preprocess_video_pose(frames: list[np.ndarray], width: int, height: int) -> list[np.ndarray]:
175
  """Extract DWPose skeletons from each frame. Returns float [0,1] frames."""
176
+
177
  result = []
178
  for frame in frames:
179
  pil = Image.fromarray(frame.astype(np.uint8)).convert("RGB")