From dd5e74cb1a7c6939126b4da66b5a448f90f74e0d Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Wed, 12 Oct 2022 17:37:31 -0700 Subject: [PATCH] update frontend --- examples/ratio_pyrometry_legend.py | 7 ------- flask_frontend.py | 8 +++----- ratio_pyrometry.py | 4 +++- templates/index.jinja2 | 16 +++++++++++++--- templates/results.jinja2 | 21 ++++++++++++++------- 5 files changed, 33 insertions(+), 23 deletions(-) delete mode 100644 examples/ratio_pyrometry_legend.py diff --git a/examples/ratio_pyrometry_legend.py b/examples/ratio_pyrometry_legend.py deleted file mode 100644 index 908621c..0000000 --- a/examples/ratio_pyrometry_legend.py +++ /dev/null @@ -1,7 +0,0 @@ -import ratio_pyrometry - -@jit(nopython=True) -def normalization_func_customizable(i, I_Darkcurrent, ISO, f_stop, exposure_time): - return (i - I_Darkcurrent) * (f_stop ** 2) / (ISO * exposure_time) - - diff --git a/flask_frontend.py b/flask_frontend.py index af7bcbc..7f85205 100644 --- a/flask_frontend.py +++ b/flask_frontend.py @@ -3,7 +3,6 @@ from werkzeug.utils import secure_filename import numpy as np from ratio_pyrometry import ratio_pyrometry_pipeline import base64 -import random import cv2 as cv app = Flask( @@ -12,9 +11,6 @@ app = Flask( static_url_path='/s/' ) -app.config['STATIC_FOLDER'] = './static' -app.config['STATIC_URL_PATH'] = '/s' - @app.route('/', methods=['GET']) def index(): return render_template('index.jinja2') @@ -30,7 +26,9 @@ def ratio_pyro(): exposure_time=float(request.form['exposure_time']), f_stop=float(request.form['f_stop']), MAX_TEMP=float(request.form['max_temp']), - MIN_TEMP=float(request.form['min_temp']) + MIN_TEMP=float(request.form['min_temp']), + smoothing_radius=int(request.form['smoothing_radius']), + key_entries=int(request.form['legend_entries']) ) img_orig_b64 = base64.b64encode(cv.imencode('.png', img_orig)[1]).decode(encoding='utf-8') diff --git a/ratio_pyrometry.py b/ratio_pyrometry.py index 215d490..933a428 100644 --- a/ratio_pyrometry.py +++ b/ratio_pyrometry.py @@ -70,7 +70,9 @@ def ratio_pyrometry_pipeline( ISO: float, # pyrometry config MAX_TEMP: float, - MIN_TEMP: float + MIN_TEMP: float, + smoothing_radius: int, + key_entries: int ): # read image & crop diff --git a/templates/index.jinja2 b/templates/index.jinja2 index 3923677..54623f6 100644 --- a/templates/index.jinja2 +++ b/templates/index.jinja2 @@ -15,15 +15,15 @@
- +
- +
- +

Temperature Settings

@@ -36,6 +36,16 @@
+

Output Settings

+ + + +
+ + + +
+
diff --git a/templates/results.jinja2 b/templates/results.jinja2 index ffb9aa5..f44e35a 100644 --- a/templates/results.jinja2 +++ b/templates/results.jinja2 @@ -10,12 +10,10 @@ {# Original image #} original image - {# original image #} {# Result image #} result image - {# resulting heatmap #} {# Legend #} @@ -24,17 +22,16 @@ - - + + {% for temp, color in legend.items() %} - + {% endfor %}
ColorTemperatureColorTemperature
{{ temp }}°C
- @@ -52,8 +49,18 @@ width: 32rem; } + .legend { + border-spacing: 0px; + border-collapse: collapse; + } + + .legend-heading { + padding: 4px; + } + .legend-cell { - padding: 4px 30px; + border-width: 0px; + padding: 0px 20px; }