Spaces:
Paused
Paused
Commit
·
cad429f
1
Parent(s):
5d928ed
fixes
Browse files- static/__init__.py +0 -0
- tasks.py +0 -12
- vitpose.py +1 -1
static/__init__.py
ADDED
|
File without changes
|
tasks.py
CHANGED
|
@@ -12,8 +12,6 @@ def process_video(video_path: str,vitpose: VitPose,user_id: str):
|
|
| 12 |
|
| 13 |
logger.info(f"starting task {video_path}")
|
| 14 |
|
| 15 |
-
# Create the static directory if it doesn't exist
|
| 16 |
-
os.makedirs("static", exist_ok=True)
|
| 17 |
|
| 18 |
new_file_name = video_path.split(".")[0] + "edited." + video_path.split(".")[1]
|
| 19 |
new_file_name = os.path.join("static", new_file_name)
|
|
@@ -25,16 +23,6 @@ def process_video(video_path: str,vitpose: VitPose,user_id: str):
|
|
| 25 |
|
| 26 |
logger.info(f"Video processed {annotated_video_path}")
|
| 27 |
|
| 28 |
-
# Add debug logging to check if the file exists
|
| 29 |
-
if not os.path.exists(annotated_video_path):
|
| 30 |
-
logger.error(f"File not found at {annotated_video_path}")
|
| 31 |
-
# Try to find where the file might be
|
| 32 |
-
logger.info(f"Current working directory: {os.getcwd()}")
|
| 33 |
-
# Use the output_video_path from vitpose as backup
|
| 34 |
-
if os.path.exists(vitpose.output_video_path):
|
| 35 |
-
logger.info(f"Found file at {vitpose.output_video_path}")
|
| 36 |
-
annotated_video_path = vitpose.output_video_path
|
| 37 |
-
|
| 38 |
with open(annotated_video_path, "rb") as f:
|
| 39 |
contents = f.read()
|
| 40 |
|
|
|
|
| 12 |
|
| 13 |
logger.info(f"starting task {video_path}")
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
new_file_name = video_path.split(".")[0] + "edited." + video_path.split(".")[1]
|
| 17 |
new_file_name = os.path.join("static", new_file_name)
|
|
|
|
| 23 |
|
| 24 |
logger.info(f"Video processed {annotated_video_path}")
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
with open(annotated_video_path, "rb") as f:
|
| 27 |
contents = f.read()
|
| 28 |
|
vitpose.py
CHANGED
|
@@ -38,7 +38,7 @@ class VitPose:
|
|
| 38 |
if not ret:
|
| 39 |
break
|
| 40 |
frames.append(frame)
|
| 41 |
-
return frames
|
| 42 |
|
| 43 |
def run(self,video):
|
| 44 |
frames = self.video_to_frames(video)
|
|
|
|
| 38 |
if not ret:
|
| 39 |
break
|
| 40 |
frames.append(frame)
|
| 41 |
+
return frames
|
| 42 |
|
| 43 |
def run(self,video):
|
| 44 |
frames = self.video_to_frames(video)
|