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: {
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<Array<[[number, number]]>>
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",
body: JSON.stringify(data),
})

View File

@@ -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