fix model retrain not working closes #93

This commit is contained in:
2024-04-16 16:02:57 +01:00
parent 026932cfab
commit f182b205f8
7 changed files with 144 additions and 179 deletions

View File

@@ -54,7 +54,7 @@
try {
let temp_model: Model = await get(`models/edit?id=${id}`);
if ([3, 6].includes(temp_model.status)) {
if ([3, 7, 6].includes(temp_model.status)) {
setTimeout(getModel, 2000);
}
@@ -143,7 +143,7 @@
>
Model
</button>
{#if _model && [2, 3, 4, 5, 6, 7].includes(_model.status)}
{#if _model && [2, 3, 4, 5, 6, 7, -6, -7].includes(_model.status)}
<button
class="tab"
on:click|preventDefault={setActive('model-data')}
@@ -152,7 +152,7 @@
Model Data
</button>
{/if}
{#if _model && [5, 6, 7].includes(_model.status)}
{#if _model && [5, 6, 7, -6, -7].includes(_model.status)}
<button
class="tab"
on:click|preventDefault={setActive('tasks')}

View File

@@ -15,6 +15,7 @@
import { createEventDispatcher } from 'svelte';
import ModelTable from './ModelTable.svelte';
import TrainModel from './TrainModel.svelte';
import ZipStructure from './ZipStructure.svelte';
let { model, simple } = $props<{ model: Model; simple?: boolean }>();
@@ -103,32 +104,7 @@
<br />
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.
<pre>
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
...
...
</pre>
<ZipStructure />
</div>
<FileUpload replace_slot bind:file accept="application/zip" notExpand>
<img src="/imgs/upload-icon.png" alt="" />

View File

@@ -11,6 +11,7 @@
Colors
} from 'chart.js';
import type { ModelStats } from './types';
import { onDestroy } from 'svelte';
Chart.register(
Title,
@@ -23,7 +24,7 @@
Colors
);
let { data } = $props<{ data: ModelStats }>();
let { data }: { data: ModelStats } = $props();
let ctx: HTMLCanvasElement;
@@ -78,6 +79,10 @@
}
}
});
onDestroy(() => {
if (chart) chart.destroy();
});
</script>
<div><canvas bind:this={ctx} /></div>

View File

@@ -255,6 +255,8 @@
{:else if selected_class?.status == 3}
Class trained
{/if}
{:else}
Class to train
{/if}
<button on:click={() => uploadImageDialog.showModal()}> Upload Image </button>
</h2>