Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,15 +22,15 @@ model_map = {
|
|
| 22 |
def process_workout(reference_video_path, user_video_path):
|
| 23 |
# Here you would add your actual MediaPipe logic
|
| 24 |
# For demo, just return the user video as "processed"
|
| 25 |
-
return user_video_path
|
| 26 |
|
| 27 |
# --- Video processing function ---
|
| 28 |
|
| 29 |
def process_video(model_name, video_file, reference_file=None):
|
| 30 |
-
if not video_file:
|
| 31 |
-
return None
|
| 32 |
-
|
| 33 |
|
|
|
|
| 34 |
# MediaPipe workflow
|
| 35 |
if model_name == "Workout Pose (MediaPipe)":
|
| 36 |
if not reference_file:
|
|
@@ -73,12 +73,14 @@ if out:
|
|
| 73 |
out.release()
|
| 74 |
|
| 75 |
return output_file
|
|
|
|
| 76 |
|
| 77 |
# --- Gradio Interface ---
|
| 78 |
|
| 79 |
with gr.Blocks() as demo:
|
| 80 |
gr.Markdown("# Multi-Model AI Video Analyzer")
|
| 81 |
|
|
|
|
| 82 |
with gr.Row():
|
| 83 |
model_choice = gr.Dropdown(list(model_map.keys()), label="Select Model")
|
| 84 |
video_input = gr.File(label="Upload Video")
|
|
@@ -97,5 +99,6 @@ submit_btn.click(
|
|
| 97 |
inputs=[model_choice, video_input, reference_input],
|
| 98 |
outputs=output_video
|
| 99 |
)
|
|
|
|
| 100 |
|
| 101 |
demo.launch()
|
|
|
|
| 22 |
def process_workout(reference_video_path, user_video_path):
|
| 23 |
# Here you would add your actual MediaPipe logic
|
| 24 |
# For demo, just return the user video as "processed"
|
| 25 |
+
return user_video_path
|
| 26 |
|
| 27 |
# --- Video processing function ---
|
| 28 |
|
| 29 |
def process_video(model_name, video_file, reference_file=None):
|
| 30 |
+
if not video_file:
|
| 31 |
+
return None
|
|
|
|
| 32 |
|
| 33 |
+
```
|
| 34 |
# MediaPipe workflow
|
| 35 |
if model_name == "Workout Pose (MediaPipe)":
|
| 36 |
if not reference_file:
|
|
|
|
| 73 |
out.release()
|
| 74 |
|
| 75 |
return output_file
|
| 76 |
+
```
|
| 77 |
|
| 78 |
# --- Gradio Interface ---
|
| 79 |
|
| 80 |
with gr.Blocks() as demo:
|
| 81 |
gr.Markdown("# Multi-Model AI Video Analyzer")
|
| 82 |
|
| 83 |
+
```
|
| 84 |
with gr.Row():
|
| 85 |
model_choice = gr.Dropdown(list(model_map.keys()), label="Select Model")
|
| 86 |
video_input = gr.File(label="Upload Video")
|
|
|
|
| 99 |
inputs=[model_choice, video_input, reference_input],
|
| 100 |
outputs=output_video
|
| 101 |
)
|
| 102 |
+
```
|
| 103 |
|
| 104 |
demo.launch()
|