added the ability to expand the models
This commit is contained in:
@@ -146,14 +146,7 @@
|
||||
<!-- TODO improve message -->
|
||||
<h2 class="text-center">Failed to prepare model</h2>
|
||||
|
||||
<div>TODO button delete</div>
|
||||
|
||||
<!--form hx-delete="/models/delete">
|
||||
<input type="hidden" name="id" value="{{ .Model.Id }}" />
|
||||
<button class="danger">
|
||||
Delete
|
||||
</button>
|
||||
</form-->
|
||||
<DeleteModel model={m} />
|
||||
</div>
|
||||
<!-- PRE TRAINING STATUS -->
|
||||
{:else if m.status == 2}
|
||||
@@ -288,7 +281,7 @@
|
||||
{/await}
|
||||
<!-- TODO Add ability to stop training -->
|
||||
</div>
|
||||
{:else if [5, 6, -6].includes(m.status)}
|
||||
{:else if [5, 6, -6, 7, -7].includes(m.status)}
|
||||
<BaseModelInfo model={m} />
|
||||
<RunModel model={m} />
|
||||
{#if m.status == 6}
|
||||
@@ -299,6 +292,13 @@
|
||||
{#if m.status == -6}
|
||||
<DeleteZip model={m} on:reload={getModel} expand />
|
||||
{/if}
|
||||
{#if m.status == -7}
|
||||
<form>
|
||||
<!-- TODO add more info about the failure -->
|
||||
Failed to train the model!
|
||||
Try to retrain
|
||||
</form>
|
||||
{/if}
|
||||
{#if m.model_type == 2}
|
||||
<ModelData model={m} on:reload={getModel} />
|
||||
{/if}
|
||||
|
||||
@@ -142,15 +142,17 @@
|
||||
</FileUpload>
|
||||
</fieldset>
|
||||
<MessageSimple bind:this={uploadImage} />
|
||||
{#await uploading}
|
||||
<button disabled>
|
||||
Uploading
|
||||
</button>
|
||||
{:then}
|
||||
<button>
|
||||
Add
|
||||
</button>
|
||||
{/await}
|
||||
{#if file}
|
||||
{#await uploading}
|
||||
<button disabled>
|
||||
Uploading
|
||||
</button>
|
||||
{:then}
|
||||
<button>
|
||||
Add
|
||||
</button>
|
||||
{/await}
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
<div class="content" class:selected={isActive("create-class")}>
|
||||
@@ -190,4 +192,6 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<TrainModel number_of_invalid_images={numberOfInvalidImages} {model} {has_data} on:reload={() => dispatch('reload')} />
|
||||
{#if classes.some((item) => item.status == 1) && ![-6, 6].includes(model.status)}
|
||||
<TrainModel number_of_invalid_images={numberOfInvalidImages} {model} {has_data} on:reload={() => dispatch('reload')} />
|
||||
{/if}
|
||||
|
||||
@@ -106,6 +106,15 @@
|
||||
class:selected={isActive(item.name)}
|
||||
>
|
||||
{item.name}
|
||||
{#if model.model_type == 2}
|
||||
{#if item.status == 1}
|
||||
<span class="bi bi-book" style="color: orange;" />
|
||||
{:else if item.status == 2}
|
||||
<span class="bi bi-book" style="color: green;" />
|
||||
{:else if item.status == 3}
|
||||
<span class="bi bi-check" style="color: green;" />
|
||||
{/if}
|
||||
{/if}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -170,15 +179,17 @@
|
||||
</FileUpload>
|
||||
</fieldset>
|
||||
<MessageSimple bind:this={uploadImage} />
|
||||
{#await uploading}
|
||||
<button disabled>
|
||||
Uploading
|
||||
</button>
|
||||
{:then}
|
||||
<button>
|
||||
Add
|
||||
</button>
|
||||
{/await}
|
||||
{#if file}
|
||||
{#await uploading}
|
||||
<button disabled>
|
||||
Uploading
|
||||
</button>
|
||||
{:then}
|
||||
<button>
|
||||
Add
|
||||
</button>
|
||||
{/await}
|
||||
{/if}
|
||||
</form>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
let messages: MessageSimple;
|
||||
|
||||
async function submit() {
|
||||
messages.clear();
|
||||
submitted = true;
|
||||
try {
|
||||
await post('models/train', {
|
||||
@@ -34,62 +35,97 @@
|
||||
if (e instanceof Response) {
|
||||
messages.display(await e.json());
|
||||
} else {
|
||||
messages.display("Could not start the training of the model");
|
||||
messages.display('Could not start the training of the model');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function submitRetrain() {
|
||||
messages.clear();
|
||||
submitted = true;
|
||||
try {
|
||||
await post('model/train/retrain', { id: model.id });
|
||||
dispatch('reload');
|
||||
} catch (e) {
|
||||
if (e instanceof Response) {
|
||||
messages.display(await e.json());
|
||||
} else {
|
||||
messages.display('Could not start the training of the model');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<form class:submitted on:submit|preventDefault={submit}>
|
||||
{#if has_data}
|
||||
{#if number_of_invalid_images > 0}
|
||||
<p class="danger">
|
||||
There are images {number_of_invalid_images} that were loaded that do not have the correct format.DeleteZip
|
||||
These images will be delete when the model trains.
|
||||
</p>
|
||||
{#if model.status == 2}
|
||||
<form class:submitted on:submit|preventDefault={submit}>
|
||||
{#if has_data}
|
||||
{#if number_of_invalid_images > 0}
|
||||
<p class="danger">
|
||||
There are images {number_of_invalid_images} that were loaded that do not have the correct format.DeleteZip
|
||||
These images will be delete when the model trains.
|
||||
</p>
|
||||
{/if}
|
||||
<MessageSimple bind:this={messages} />
|
||||
<!-- TODO expading mode -->
|
||||
<fieldset>
|
||||
<legend> Model Type </legend>
|
||||
<div class="input-radial">
|
||||
<input
|
||||
id="model_type_simple"
|
||||
value="simple"
|
||||
name="model_type"
|
||||
type="radio"
|
||||
bind:group={data.model_type}
|
||||
/>
|
||||
<label for="model_type_simple">Simple</label><br />
|
||||
<input
|
||||
id="model_type_expandable"
|
||||
value="expandable"
|
||||
name="model_type"
|
||||
bind:group={data.model_type}
|
||||
type="radio"
|
||||
/>
|
||||
<label for="model_type_expandable">Expandable</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- TODO allow more models to be created -->
|
||||
<fieldset>
|
||||
<label for="number_of_models">Number of Models</label>
|
||||
<input
|
||||
id="number_of_models"
|
||||
type="number"
|
||||
name="number_of_models"
|
||||
bind:value={data.number_of_models}
|
||||
/>
|
||||
</fieldset>
|
||||
<!-- TODO to Change the acc -->
|
||||
<fieldset>
|
||||
<label for="accuracy">Target accuracy</label>
|
||||
<input id="accuracy" type="number" name="accuracy" bind:value={data.accuracy} />
|
||||
</fieldset>
|
||||
<!-- TODO allow to chose the base of the model -->
|
||||
<!-- TODO allow to change the shape of the model -->
|
||||
<button> Train </button>
|
||||
{:else}
|
||||
<h2>To train the model please provide data to the model first</h2>
|
||||
{/if}
|
||||
<MessageSimple bind:this={messages} />
|
||||
<!-- TODO expading mode -->
|
||||
<fieldset>
|
||||
<legend> Model Type </legend>
|
||||
<div class="input-radial">
|
||||
<input
|
||||
id="model_type_simple"
|
||||
value="simple"
|
||||
name="model_type"
|
||||
type="radio"
|
||||
bind:group={data.model_type}
|
||||
/>
|
||||
<label for="model_type_simple">Simple</label><br />
|
||||
<input
|
||||
id="model_type_expandable"
|
||||
value="expandable"
|
||||
name="model_type"
|
||||
bind:group={data.model_type}
|
||||
type="radio"
|
||||
/>
|
||||
<label for="model_type_expandable">Expandable</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<!-- TODO allow more models to be created -->
|
||||
<fieldset>
|
||||
<label for="number_of_models">Number of Models</label>
|
||||
<input
|
||||
id="number_of_models"
|
||||
type="number"
|
||||
name="number_of_models"
|
||||
bind:value={data.number_of_models}
|
||||
/>
|
||||
</fieldset>
|
||||
<!-- TODO to Change the acc -->
|
||||
<fieldset>
|
||||
<label for="accuracy">Target accuracy</label>
|
||||
<input id="accuracy" type="number" name="accuracy" bind:value={data.accuracy} />
|
||||
</fieldset>
|
||||
<!-- TODO allow to chose the base of the model -->
|
||||
<!-- TODO allow to change the shape of the model -->
|
||||
<button> Train </button>
|
||||
{:else}
|
||||
<h2>To train the model please provide data to the model first</h2>
|
||||
{/if}
|
||||
</form>
|
||||
</form>
|
||||
{:else}
|
||||
<form class:submitted on:submit|preventDefault={submitRetrain}>
|
||||
{#if has_data}
|
||||
<h2>
|
||||
This model has new classes and can be expanded
|
||||
</h2>
|
||||
{#if number_of_invalid_images > 0}
|
||||
<p class="danger">
|
||||
There are images {number_of_invalid_images} that were loaded that do not have the correct format.DeleteZip
|
||||
These images will be delete when the model trains.
|
||||
</p>
|
||||
{/if}
|
||||
<MessageSimple bind:this={messages} />
|
||||
<button> Retrain </button>
|
||||
{:else}
|
||||
<h2>To train the model please provide data to the model first</h2>
|
||||
{/if}
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user