From 9787259b8994b616805531196c3a6e06451f80c7 Mon Sep 17 00:00:00 2001 From: zhangheng Date: Tue, 7 Apr 2026 13:52:45 +0800 Subject: [PATCH] fix(sam2): fix api --- components/label/api/label/index.ts | 6 +++--- components/label/components/PaperContainer.tsx | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/label/api/label/index.ts b/components/label/api/label/index.ts index 8762c52..72775e7 100644 --- a/components/label/api/label/index.ts +++ b/components/label/api/label/index.ts @@ -121,8 +121,8 @@ export const getAuxiliaryAnnotation = (data: any) => { } export const getAuxiliaryAnnotation2 = (data: { - project_id: string - image: string + project_id: number + image_name: string prompt: { foreground_points?: Array<[number, number]> background_points?: Array<[number, number]> @@ -133,7 +133,7 @@ export const getAuxiliaryAnnotation2 = (data: { contours: Array> hollows: Array }>({ - url: "http://172.30.21.211:9000/image_predictor", + url: "http://172.30.21.211:8000/api/sam2/image_predictor", method: "POST", body: JSON.stringify(data), }) diff --git a/components/label/components/PaperContainer.tsx b/components/label/components/PaperContainer.tsx index b134bff..1dcb00f 100644 --- a/components/label/components/PaperContainer.tsx +++ b/components/label/components/PaperContainer.tsx @@ -540,10 +540,7 @@ const PaperContainer = ( Math.round(Math.max(left, right) / currentScale), Math.round(Math.max(top, bottom) / currentScale), ]) as SupportBox[] - const projectId = - projectDetail?.name || - projectDetail?.rpath || - `${projectDetail?.id || ""}` + const projectId = projectDetail?.id || "" if (!projectId) { throw new Error("缺少 project_id,无法调用模型接口") @@ -556,7 +553,7 @@ const PaperContainer = ( try { const data = await getAuxiliaryAnnotation2({ project_id: projectId, - image: activeImage, + image_name: activeImage, // project_id: "image_test_bk", prompt: { ...(promptPoints.length