clean up some things

master
michael 2022-10-12 15:48:45 -07:00
parent aaba03c50b
commit aa26b1cf2f
1 changed files with 0 additions and 13 deletions

View File

@ -22,8 +22,6 @@ def index():
@app.route('/ratio_pyro', methods=['POST']) @app.route('/ratio_pyro', methods=['POST'])
def ratio_pyro(): def ratio_pyro():
f = request.files['file'] f = request.files['file']
f_name = f.filename.split('.')[0]
f_ext = f.filename.split('.')[1]
f_bytes = np.fromstring(f.read(), np.uint8) f_bytes = np.fromstring(f.read(), np.uint8)
img_orig, img_res, key = ratio_pyrometry_pipeline( img_orig, img_res, key = ratio_pyrometry_pipeline(
f_bytes, f_bytes,
@ -38,17 +36,6 @@ def ratio_pyro():
img_orig_b64 = base64.b64encode(cv.imencode('.png', img_orig)[1]).decode(encoding='utf-8') img_orig_b64 = base64.b64encode(cv.imencode('.png', img_orig)[1]).decode(encoding='utf-8')
img_res_b64 = base64.b64encode(cv.imencode('.png', img_res)[1]).decode(encoding='utf-8') img_res_b64 = base64.b64encode(cv.imencode('.png', img_res)[1]).decode(encoding='utf-8')
# img_res_b64 = base64.b64encode(img_res).decode()
# img_orig_fname = secure_filename(f'{f_name}.{f_ext}')
# img_res_fname = secure_filename(f'{f_name}-{hex(int(random.random() * 10000000000000000000))}.{f_ext}')
# cv.imwrite(f'{app.config["STATIC_FOLDER"]}/{img_orig_fname}', img_orig)
# cv.imwrite(f'{app.config["STATIC_FOLDER"]}/{img_res_fname}', img_res)
# img_orig_path = f'{app.config["STATIC_URL_PATH"]}/{img_orig_fname}'
# img_res_path = f'{app.config["STATIC_URL_PATH"]}/{img_res_fname}'
return render_template( return render_template(
'results.jinja2', 'results.jinja2',
# img_orig_path=img_orig_path, # img_orig_path=img_orig_path,