Spaces:
Sleeping
Sleeping
Update analyzer/process_video.py
Browse files
analyzer/process_video.py
CHANGED
|
@@ -110,16 +110,16 @@ def analyze_video(video_path, video_id, user_id):
|
|
| 110 |
plt.xlabel("Normalized Time (0–150 points)")
|
| 111 |
plt.tight_layout()
|
| 112 |
|
| 113 |
-
|
|
|
|
| 114 |
os.makedirs(output_folder, exist_ok=True)
|
| 115 |
|
| 116 |
output_file = os.path.join(output_folder, f"{video_id}_popup_analysis.png")
|
| 117 |
plt.savefig(output_file)
|
| 118 |
plt.close()
|
| 119 |
|
| 120 |
-
print(f"
|
| 121 |
-
print(f"
|
| 122 |
|
| 123 |
-
|
| 124 |
return f"{video_id}_popup_analysis.png"
|
| 125 |
-
|
|
|
|
| 110 |
plt.xlabel("Normalized Time (0–150 points)")
|
| 111 |
plt.tight_layout()
|
| 112 |
|
| 113 |
+
# Save figure to /tmp/results/{user_id}/
|
| 114 |
+
output_folder = os.path.join('/tmp/results', user_id)
|
| 115 |
os.makedirs(output_folder, exist_ok=True)
|
| 116 |
|
| 117 |
output_file = os.path.join(output_folder, f"{video_id}_popup_analysis.png")
|
| 118 |
plt.savefig(output_file)
|
| 119 |
plt.close()
|
| 120 |
|
| 121 |
+
print(f"✅ Saved result to: {output_file}")
|
| 122 |
+
print(f"✅ Returning filename: {video_id}_popup_analysis.png")
|
| 123 |
|
|
|
|
| 124 |
return f"{video_id}_popup_analysis.png"
|
| 125 |
+
|