feat: closes #23

This commit is contained in:
2023-10-03 18:49:36 +01:00
parent 884a978e3b
commit f68f0e2444
4 changed files with 24 additions and 10 deletions

View File

@@ -294,7 +294,11 @@
{{ define "run-model-card" }}
<form hx-headers='{"REQUEST-TYPE": "html"}' enctype="multipart/form-data" hx-post="/models/run" hx-swap="outerHTML">
{{ if .Result }}
{{ if .NotFound }}
<div>
The class was not found
</div>
{{ else if .Result }}
<div>
Img Class: {{.Result}}
</div>

View File

@@ -34,7 +34,7 @@ def pathToLabel(path):
def decode_image(img):
# channels were reduced to 1 since image is grayscale
# TODO chnage channel number based if grayscale
img = tf.io.decode_png(img, channels=1)
img = tf.io.decode_png(img, channels=3)
return tf.image.resize(img, image_size)