diff --git a/frontend/api/api.ts b/frontend/api/api.ts index 0e48b606..3bc2bea7 100644 --- a/frontend/api/api.ts +++ b/frontend/api/api.ts @@ -2,7 +2,7 @@ import { ImageToTextArgs, ImageToTextResponse, AlignImageArgs, AlignImageRespons const apiUrl = import.meta.env.VITE_API_URL || "http://localhost:8000/" -export const AlignImage = async (args: AlignImageArgs): Promise => { +export const AlignImage = async (args: AlignImageArgs): Promise => { const { sourceImage, templateImage } = args; const form = new URLSearchParams({ source_image: sourceImage, @@ -21,15 +21,16 @@ export const AlignImage = async (args: AlignImageArgs): Promise => { const { sourceImage, templateImage, fieldNames } = args; + const aligned_result = await AlignImage({sourceImage, templateImage}); const form = new URLSearchParams({ - source_image: sourceImage, + source_image: aligned_result["result"], segmentation_template: templateImage, labels: JSON.stringify(fieldNames), }); diff --git a/frontend/api/types/types.ts b/frontend/api/types/types.ts index 62131944..be71ecc0 100644 --- a/frontend/api/types/types.ts +++ b/frontend/api/types/types.ts @@ -13,7 +13,7 @@ export type ImageToTextResponse = { }; export type AlignImageResponse = { - [key: string]: [string, number]; + [key: string]: string; }; export interface ResultItem {