INNER CODE UNIT · Python
upload_video
chonyy/AI-basketball-analysis · app.py:69
def upload_video():
global shooting_result
shooting_result['attempts'] = 0
shooting_result['made'] = 0
shooting_result['miss'] = 0
if (os.path.exists("./static/detections/trajectory_fitting.jpg")):
os.remove("./static/detections/trajectory_fitting.jpg")
if request.method == 'POST':
filename = "sample_video.mp4"
print("filename", filename)
filepath = "./static/uploads/sample_video.mp4"
print("filepath", filepath)
session['video_path'] = filepath
return render_template("shooting_analysis.html")
@app.route('/shooting_analysis', methods=['GET', 'POST'])
def upload_sample_video():
global shooting_result