Open KhomZ opened 2 years ago
from flask import Flask, render_template, request import os from deeplearning import OCR
app = Flask(name)
BASE_PATH = os.getcwd() UPLOAD_PATH = os.path.join( BASE_PATH, 'WebbApp/static/predict/upload')
@app.route('/', methods=['POST', 'GET']) def index(): if request.method == 'POST': upload_file = request.files['image_name'] filename = upload_file.filename path_save = os.path.join(UPLOAD_PATH, filename) upload_file.save(path_save) text = OCR(path_save, filename)
return render_template('index.html', upload=True, upload_image=filename, text=text) return render_template('index.html', upload=False)
if name == "main": app.run(debug=True)
SystemExit: 1
https://flask.palletsprojects.com/en/2.2.x/tutorial/deploy/
try
$ pip install waitress
from flask import Flask, render_template, request import os from deeplearning import OCR
webserver gateway interface
app = Flask(name)
BASE_PATH = os.getcwd() UPLOAD_PATH = os.path.join( BASE_PATH, 'WebbApp/static/predict/upload')
@app.route('/', methods=['POST', 'GET']) def index(): if request.method == 'POST': upload_file = request.files['image_name'] filename = upload_file.filename path_save = os.path.join(UPLOAD_PATH, filename) upload_file.save(path_save) text = OCR(path_save, filename)
if name == "main": app.run(debug=True)
SystemExit: 1