fix model retrain not working closes #93
This commit is contained in:
@@ -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')}
|
||||
|
||||
@@ -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="" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user