feat: closes #24

This commit is contained in:
2023-10-03 19:02:02 +01:00
parent f68f0e2444
commit 84b9c40a72
4 changed files with 26 additions and 38 deletions

View File

@@ -110,7 +110,7 @@ func handleRun(handle *Handle) {
root := tg.NewRoot()
tf_img := ReadPNG(root, path.Join(run_path, "img.png"), 3)
tf_img := ReadPNG(root, path.Join(run_path, "img.png"), int64(model.ImageMode))
exec_results := tg.Exec(root, []tf.Output{tf_img.Value()}, nil, &tf.SessionOptions{})
inputImage, err:= tf.NewTensor(exec_results[0].Value())
@@ -130,8 +130,6 @@ func handleRun(handle *Handle) {
vi := 0
var predictions = results[0].Value().([][]float32)[0]
fmt.Println(predictions)
for i, v := range predictions {
if v > vmax {
vi = i
@@ -155,7 +153,6 @@ func handleRun(handle *Handle) {
var name string
if err = rows.Scan(&name); err != nil { return nil }
LoadDefineTemplate(w, "/models/edit.html", "run-model-card", c.AddMap(AnyMap{
"Model": model,
"Result": name,