JunRecFour6 commited on
Commit
b372d57
·
verified ·
1 Parent(s): 7255632

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -42,7 +42,7 @@ def upload():
42
  return 'No video file uploaded', 400
43
 
44
  video = request.files['video']
45
- print("Received file:", video.filename)
46
 
47
  if video.filename == '':
48
  return 'No selected file', 400
@@ -58,12 +58,15 @@ def upload():
58
  filepath = os.path.join(user_upload_folder, filename)
59
  video.save(filepath)
60
 
61
- print(f"Saved video to {filepath}")
62
 
63
- # Run the analysis and get back the result image filename
64
- result_image = analyze_video(filepath, filename, session['user_id'])
 
 
 
 
65
 
66
-
67
  return redirect(url_for('index', video_filename=filename, result_image=result_image))
68
 
69
  @app.route('/uploads/<path:filename>')
 
42
  return 'No video file uploaded', 400
43
 
44
  video = request.files['video']
45
+ print("📥 Received file:", video.filename)
46
 
47
  if video.filename == '':
48
  return 'No selected file', 400
 
58
  filepath = os.path.join(user_upload_folder, filename)
59
  video.save(filepath)
60
 
61
+ print(f"📁 Saved video to: {filepath}")
62
 
63
+ try:
64
+ result_image = analyze_video(filepath, filename, session['user_id'])
65
+ print(f"✅ analyze_video returned: {result_image}")
66
+ except Exception as e:
67
+ print(f"❌ analyze_video failed: {e}")
68
+ result_image = "placeholder.jpg"
69
 
 
70
  return redirect(url_for('index', video_filename=filename, result_image=result_image))
71
 
72
  @app.route('/uploads/<path:filename>')