fix(sam2): fix api

This commit is contained in:
zhangheng
2026-04-07 13:52:45 +08:00
parent 5db5e18049
commit 9787259b89
2 changed files with 5 additions and 8 deletions

View File

@@ -121,8 +121,8 @@ export const getAuxiliaryAnnotation = (data: any) => {
} }
export const getAuxiliaryAnnotation2 = (data: { export const getAuxiliaryAnnotation2 = (data: {
project_id: string project_id: number
image: string image_name: string
prompt: { prompt: {
foreground_points?: Array<[number, number]> foreground_points?: Array<[number, number]>
background_points?: Array<[number, number]> background_points?: Array<[number, number]>
@@ -133,7 +133,7 @@ export const getAuxiliaryAnnotation2 = (data: {
contours: Array<Array<[[number, number]]>> contours: Array<Array<[[number, number]]>>
hollows: Array<boolean> hollows: Array<boolean>
}>({ }>({
url: "http://172.30.21.211:9000/image_predictor", url: "http://172.30.21.211:8000/api/sam2/image_predictor",
method: "POST", method: "POST",
body: JSON.stringify(data), body: JSON.stringify(data),
}) })

View File

@@ -540,10 +540,7 @@ const PaperContainer = (
Math.round(Math.max(left, right) / currentScale), Math.round(Math.max(left, right) / currentScale),
Math.round(Math.max(top, bottom) / currentScale), Math.round(Math.max(top, bottom) / currentScale),
]) as SupportBox[] ]) as SupportBox[]
const projectId = const projectId = projectDetail?.id || ""
projectDetail?.name ||
projectDetail?.rpath ||
`${projectDetail?.id || ""}`
if (!projectId) { if (!projectId) {
throw new Error("缺少 project_id无法调用模型接口") throw new Error("缺少 project_id无法调用模型接口")
@@ -556,7 +553,7 @@ const PaperContainer = (
try { try {
const data = await getAuxiliaryAnnotation2({ const data = await getAuxiliaryAnnotation2({
project_id: projectId, project_id: projectId,
image: activeImage, image_name: activeImage,
// project_id: "image_test_bk", // project_id: "image_test_bk",
prompt: { prompt: {
...(promptPoints.length ...(promptPoints.length