Skip to content

Commit

Permalink
user gives model name and selects it from dropdown for images
Browse files Browse the repository at this point in the history
  • Loading branch information
GMBueno committed Oct 1, 2024
1 parent 6054478 commit 5f205a5
Show file tree
Hide file tree
Showing 8 changed files with 595 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/FormSubmitImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/>

<!-- Model (name) selector -->
<Select v-model="model" :options="models ?? []" optionLabel="id" optionValue="id" placeholder="Select Model" class="min-w-60 max-w-full ml-4" />
<Select v-model="model" :options="models ?? []" optionLabel="name" optionValue="id" placeholder="Select Model" class="min-w-60 max-w-full ml-4" />
<Button class="ml-4" label="Create Images" type="submit"></Button>
</form>
</template>
Expand Down
7 changes: 7 additions & 0 deletions components/TrainForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
:showUploadButton="true"
@select="onFileSelected"
/>

<div class="mt-4">
<InputText v-model="modelName" placeholder="Enter Model Name" />
</div>
<Button label="Train" @click="submit" />
</form>
</template>
Expand Down Expand Up @@ -93,6 +97,8 @@ const onFileSelected = (event: FileUploadSelectEvent) => {
files.value = [...event.files];
};
const modelName = ref<string>('');
const submit = async () => {
const zipped = await useZippedFiles(files.value);
Expand All @@ -101,6 +107,7 @@ const submit = async () => {
gender: selectedGender.value as Gender,
eyeColor: selectedEyeColor.value as EyeColor,
trainingType: selectedTrainingType.value as Training,
name: modelName.value || `Model_${new Date().toISOString().split('T')[0]}`, // User input or Model_YYYY-MM-DD
};
emits("submit", values);
Expand Down
1 change: 1 addition & 0 deletions drizzle/0002_shallow_spot.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "trainings" ADD COLUMN "name" text NOT NULL;
Loading

0 comments on commit 5f205a5

Please sign in to comment.