INNER CODE UNIT · Python
upload_sample_image
chonyy/AI-basketball-analysis · app.py:43
def upload_sample_image():
if request.method == 'POST':
response = []
filename = "sample_image.jpg"
print("filename", filename)
filepath = "./static/uploads/sample_image.jpg"
print("filepath", filepath)
get_image(filepath, filename, response)
return render_template("shot_detection.html", display_detection=filename, fname=filename, response=response)
@app.route('/basketball_detection', methods=['GET', 'POST'])
def upload_image():
if request.method == 'POST':
response = []
f = request.files['image']
# create a secure filename
filename = secure_filename(f.filename)
print("filename", filename)