Spaces:
Sleeping
Sleeping
Update routes/video_routes.py
Browse files- routes/video_routes.py +4 -4
routes/video_routes.py
CHANGED
|
@@ -31,13 +31,13 @@ async def receive_video(video: VideoUrl = Body(...)):
|
|
| 31 |
temp_file.write(chunk)
|
| 32 |
video_filename = temp_file.name
|
| 33 |
|
| 34 |
-
noaudio_video = remove_audio_from_video(video_filename)
|
| 35 |
-
if not noaudio_video:
|
| 36 |
-
|
| 37 |
|
| 38 |
start_time = time.time()
|
| 39 |
print("\n<======= Extracting faces from video =======>")
|
| 40 |
-
extract_face_from_video(
|
| 41 |
if not os.listdir(EXTRACTED_FRAMES_DIR):
|
| 42 |
raise HTTPException(status_code=400, detail="No frames were extracted.")
|
| 43 |
print(f"Face extraction completed in {time.time() - start_time:.2f} seconds")
|
|
|
|
| 31 |
temp_file.write(chunk)
|
| 32 |
video_filename = temp_file.name
|
| 33 |
|
| 34 |
+
# noaudio_video = remove_audio_from_video(video_filename)
|
| 35 |
+
# if not noaudio_video:
|
| 36 |
+
# raise HTTPException(status_code=400, detail="Failed to remove audio from the video.")
|
| 37 |
|
| 38 |
start_time = time.time()
|
| 39 |
print("\n<======= Extracting faces from video =======>")
|
| 40 |
+
extract_face_from_video(video_filename, EXTRACTED_FRAMES_DIR)
|
| 41 |
if not os.listdir(EXTRACTED_FRAMES_DIR):
|
| 42 |
raise HTTPException(status_code=400, detail="No frames were extracted.")
|
| 43 |
print(f"Face extraction completed in {time.time() - start_time:.2f} seconds")
|