Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
|
|
|
|
|
|
|
| 2 |
try:
|
| 3 |
from analyzer.process_video import analyze_video
|
| 4 |
except Exception as e:
|
|
@@ -76,19 +78,10 @@ def uploaded_file(filename):
|
|
| 76 |
print("๐ฅ Received file:", video.filename)
|
| 77 |
print(f"๐ Saved video to: {filepath}")
|
| 78 |
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
def test_result_image():
|
| 84 |
-
test_img_path = "static/placeholder.jpg"
|
| 85 |
-
if os.path.exists(test_img_path):
|
| 86 |
-
print("๐ผ๏ธ Serving static placeholder image for test")
|
| 87 |
-
return send_file(test_img_path, mimetype="image/jpeg")
|
| 88 |
-
else:
|
| 89 |
-
print("โ placeholder.jpg not found")
|
| 90 |
-
return "Image not found", 404
|
| 91 |
-
|
| 92 |
|
| 93 |
if __name__ == '__main__':
|
| 94 |
app.run(host='0.0.0.0', port=7860, debug=False)
|
|
|
|
| 1 |
|
| 2 |
+
from analyzer.process_video import analyze_video
|
| 3 |
+
|
| 4 |
try:
|
| 5 |
from analyzer.process_video import analyze_video
|
| 6 |
except Exception as e:
|
|
|
|
| 78 |
print("๐ฅ Received file:", video.filename)
|
| 79 |
print(f"๐ Saved video to: {filepath}")
|
| 80 |
|
| 81 |
+
@app.route('/results/<path:filename>')
|
| 82 |
+
def result_file(filename):
|
| 83 |
+
user_result_folder = os.path.join('/tmp/results', session['user_id'])
|
| 84 |
+
return send_from_directory(user_result_folder, filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
if __name__ == '__main__':
|
| 87 |
app.run(host='0.0.0.0', port=7860, debug=False)
|