playing with AI image recognition

This commit is contained in:
vabene1111
2024-05-18 14:29:42 +02:00
parent fd1c6d718e
commit 6a8b2b6338
12 changed files with 222 additions and 21 deletions

View File

@@ -0,0 +1,41 @@
<template>
<v-file-input label="File input" v-model="image"></v-file-input>
<v-btn @click="imageToRecipe()">Upload</v-btn>
<v-textarea v-model="response"></v-textarea>
</template>
<script setup lang="ts">
import {ApiApi} from "@/openapi";
import {ref} from "vue";
const image = ref(File)
const response = ref('')
function imageToRecipe() {
const api = new ApiApi()
const reader = new FileReader()
reader.readAsDataURL(image.value)
api.apiImageToRecipeCreate({image: image.value}).then(r => {
console.log(r)
response.value = r
}).catch(err => {
console.log(err)
response.value = err
})
}
</script>
<style scoped>
</style>