{{ define "title" }} Model: {{ .Model.Name }} {{ end }} {{ define "base-model-card" }}

{{ .Model.Name }}

Image Type: {{ .Model.Color_mode }}
Image Size: {{ .Model.Width }}x{{ .Model.Height }}
{{ end }} {{ define "delete-model-card" }}
To delete this model please type "{{ .Model.Name }}": {{ if .NameDoesNotMatch }} Name does not match "{{ .Model.Name }}" {{ end }}
{{ end }} {{/* Is called from a diffrent endpoint so that it does not matter where this is from :) which means that . can mean what ever I want */}} {{ define "data-model-create-class-table-table" }}
{{range .List}} {{end}}
File Path Mode
{{ if eq .FilePath "id://" }} Managed {{ else }} {{.FilePath}} {{ end }} {{ if (eq .Mode 2) }} Testing {{ else }} Training {{ end }} {{ if startsWith .FilePath "id://" }} {{ else }} TODO img {{ .FilePath }} {{ end }} {{ if eq .Status 1 }} {{ else }} {{ end }}
{{ if gt .Page 0 }} {{ end }}
{{ .Page }}
{{ if lt (mul .Page 10) .Count }} {{ end }}
{{ end }} {{ define "data-model-create-class-table" }} {{ if eq (len .Classes) 0 }} TODO CREATE TABLE {{else}}
{{/* Handle the case where there are to many buttons */}}
{{ range .Classes }} {{/* TODO Auto Load 1st */}} {{ end }}
{{ range $i, $a := .Classes }} {{ if eq $i 0}}
{{ else }}
{{ end }} {{ end }}
{{end}} {{ end }} {{ define "data-model-card" }}

Training data

{{ if eq (len .Classes) 0 }}

You need to upload data so the model can train.

Please provide a file that has the training and testing data
The file must have 2 folders one with testing images and one with training images.
Each of the folders will contain the classes of the model. The folders must be the same in testing and training. The class folders must have the images for the classes.
    training\
        class1\
            img1.png
            img2.png
            img2.png
            ...
        class2\
            img1.png
            img2.png
            img2.png
            ...
        ...
    testing\
        class1\
            img1.png
            img2.png
            img2.png
            ...
        class2\
            img1.png
            img2.png
            img2.png
            ...
        ...
{{ template "data-model-create-class-table" . }}
TODO
{{ else }}

You need to upload data so the model can train.

{{ if gt .NumberOfInvalidImages 0 }}

There are images {{ .NumberOfInvalidImages }} that were loaded that do not have the correct format. These images will be delete when the model trains.

{{ end }}
{{ template "data-model-create-class-table" . }}
TODO
{{ end }}
{{ end }} {{ define "train-model-card" }}
{{ if .HasData }} {{ if gt .NumberOfInvalidImages 0 }}

There are images {{ .NumberOfInvalidImages }} that were loaded that do not have the correct format. These images will be delete when the model trains.

{{ end }} {{/* TODO expading mode */}}
Model Type
{{/* TODO allow more models to be created */}}
{{/* TODO to Change the acc */}}
{{/* TODO allow to chose the base of the model */}} {{/* TODO allow to change the shape of the model */}} {{ else }}

To train the model please provide data to the model first

{{ end }}
{{ end }} {{ define "run-model-card" }}
{{ if .NotFound }}
The class was not found
{{ else if .Result }}
Img Class: {{.Result}}
{{ end }}
Run image through them model and get the result
{{ if .ImageError }} The provided image was not valid for this model {{ end }}
{{ end }} {{ define "mainbody" }}
{{ if (eq .Model.Status 1) }}

{{ .Model.Name }}

Preparing the model

{{ else if (eq .Model.Status -1) }}

{{ .Model.Name }}

Failed to prepare model

{{/* PRE TRAINING STATUS */}} {{ else if (eq .Model.Status 2) }} {{ template "base-model-card" . }} {{ template "data-model-card" . }} {{ template "train-model-card" . }} {{ template "delete-model-card" . }} {{/* FAILED TO PROCCESS THE ZIPFILE */}} {{ else if (eq .Model.Status -2)}} {{ template "base-model-card" . }}
Failed to proccess the zip file.
Delete file and proccess afain.

{{ template "delete-model-card" . }} {{/* PROCCESS THE ZIPFILE */}} {{ else if (eq .Model.Status 3)}} {{ template "base-model-card" . }}
{{/* TODO improve this */}} Processing zip file...
{{/* FAILED TO Prepare for training */}} {{ else if or (eq .Model.Status -3) (eq .Model.Status -4)}} {{ template "base-model-card" . }}
Failed Prepare for training.
{{ template "delete-model-card" . }} {{ else if (eq .Model.Status 4)}} {{ template "base-model-card" . }}
{{/* TODO improve this */}} Training the model...
{{/* TODO Add progress status on definitions */}} {{ range .Defs}} {{ if (eq .Status 3) }} {{ end }} {{ end }}
Done Progress Training Round Progress Accuracy Status
{{.Epoch}} {{.EpochProgress}}/20 {{.Accuracy}}% {{ if (eq .Status 2) }} {{ else if (eq .Status 3) }} {{ else if (eq .Status 6) }} {{ else if (eq .Status -3) }} {{ else }} {{.Status}} {{ end }}
{{ range $i, $layer := $.Layers }} {{ if (eq $layer.LayerType 1)}} {{ else if (eq $layer.LayerType 4)}} {{ else if (eq $layer.LayerType 3)}} {{ else if (eq $layer.LayerType 2)}} {{ else }}
{{ .LayerType }} {{ .Shape }}
{{ end }} {{ end }}
{{/* TODO Add ability to stop training */}}
{{/* Model Ready */}} {{ else if (eq .Model.Status 5)}} {{ template "base-model-card" . }} {{ template "run-model-card" . }} {{ template "delete-model-card" . }} {{ else }}

Unknown Status of the model.

{{ end }}
{{ end }}