-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script> | ||
import { img1, img2 } from "../../store"; | ||
let resultados = { docs: [] }; | ||
async function EvSimilitud() { | ||
const formData = new FormData() | ||
formData.append('file1',$img1) | ||
formData.append('file2', $img2) | ||
try { | ||
const resImgDarks = await fetch('http://localhost:8001/similitud/', { | ||
method: "POST", | ||
body: formData | ||
}); | ||
// if (!resImgDarks.ok) { | ||
// console.error('Ocurrió un error durante la solicitud:', Error); | ||
// throw new Error('La solicitud no fue exitosa'); | ||
// } | ||
resultados = await resImgDarks.json(); | ||
} catch { | ||
console.error('Ocurrió un error durante la solicitud:', Error); | ||
} | ||
} | ||
EvSimilitud() | ||
</script> | ||
|
||
{#if resultados.docs.length > 0} | ||
{#each resultados.docs as resultado} | ||
<div> La similitud es del {Math.trunc(resultado.Mach)}%</div> | ||
{/each} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script> | ||
import { Alert } from 'flowbite-svelte'; | ||
import { APP_STATUS, appStatus, StatusImg1, StatusImg2 } from '../../store' | ||
import AnalyzeSimilitud from './AnalyzeSimilitud.svelte'; | ||
</script> | ||
|
||
<!-- EL $ en la store es para observar el valor que tienen --> | ||
|
||
{#if $StatusImg1 == true && $StatusImg2 == true} | ||
<AnalyzeSimilitud/> | ||
{:else if $appStatus == APP_STATUS.ERROR} | ||
<Alert class="mb-10"> | ||
<span class="font-medium">Algo malo a pasado!</span> | ||
Hay un error en la aplicación | ||
</Alert> | ||
{:else} | ||
<div></div> | ||
{/if} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters