JunRecFour6 commited on
Commit
d751d47
ยท
verified ยท
1 Parent(s): 20d4564

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
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
- from flask import send_file
81
-
82
- @app.route('/results/test')
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)