fix(sam2): fix api
This commit is contained in:
@@ -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),
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user