Created
November 14, 2022 13:57
-
-
Save Sachin-crypto/7c3625d155f672c3d8166037fe6b261b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prediction route | |
@app.route('/prediction', methods=['POST']) | |
def predict_image_file(): | |
try: | |
if request.method == 'POST': | |
img = preprocess_img(request.files['file'].stream) | |
pred = predict_result(img) | |
return render_template("result.html", predictions=str(pred)) | |
except: | |
error = "File cannot be processed." | |
return render_template("result.html", err=error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment