fix(label): label result
This commit is contained in:
@@ -14,7 +14,12 @@ import { processVideo } from "@/app/component/label/video2image/processVideo"
|
|||||||
import { Box, Flex, LoadingOverlay, Stack } from "@mantine/core"
|
import { Box, Flex, LoadingOverlay, Stack } from "@mantine/core"
|
||||||
import { showNotification } from "@mantine/notifications"
|
import { showNotification } from "@mantine/notifications"
|
||||||
import { getLabelResult, getServerImage } from "./api/label"
|
import { getLabelResult, getServerImage } from "./api/label"
|
||||||
import { Comment, WorkLoad } from "./api/label/typing"
|
import {
|
||||||
|
Comment,
|
||||||
|
ImageObjects,
|
||||||
|
LabelResult,
|
||||||
|
WorkLoad,
|
||||||
|
} from "./api/label/typing"
|
||||||
import { getProjectDetail } from "./api/project"
|
import { getProjectDetail } from "./api/project"
|
||||||
import { Project } from "./api/project/typing"
|
import { Project } from "./api/project/typing"
|
||||||
import { getTaskList, getTaskWorkFlow } from "./api/task"
|
import { getTaskList, getTaskWorkFlow } from "./api/task"
|
||||||
@@ -91,6 +96,29 @@ const normalizeNamePrefix = (name: string) => {
|
|||||||
return value || "video"
|
return value || "video"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ResultImageEntry {
|
||||||
|
frameName: string
|
||||||
|
imageObjects: ImageObjects
|
||||||
|
}
|
||||||
|
|
||||||
|
const expandLabelResultImages = (item: LabelResult): ResultImageEntry[] => {
|
||||||
|
if (item.image_objects) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
frameName: item.data_name,
|
||||||
|
imageObjects: item.image_objects,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
if (!item.video_objects) return []
|
||||||
|
return Object.entries(item.video_objects).map(([frameName, imageObjects]) => {
|
||||||
|
return {
|
||||||
|
frameName,
|
||||||
|
imageObjects,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
interface LabelProps {
|
interface LabelProps {
|
||||||
headerHeight: number
|
headerHeight: number
|
||||||
leftWidth: number
|
leftWidth: number
|
||||||
@@ -237,11 +265,10 @@ const LabelPage = ({
|
|||||||
|
|
||||||
const normalizeVideoTaskData = useCallback(
|
const normalizeVideoTaskData = useCallback(
|
||||||
async (detail: Task.DataProps) => {
|
async (detail: Task.DataProps) => {
|
||||||
try {
|
|
||||||
const sourceNames = detail.data_name
|
const sourceNames = detail.data_name
|
||||||
.map((item) => item?.name?.[0] || "")
|
.map((item) => item?.name?.[0] || "")
|
||||||
.filter((name) => !!name)
|
.filter((name) => !!name)
|
||||||
if (!sourceNames.length || !projectId) return detail
|
if (!sourceNames.length || !projectId || !taskId) return detail
|
||||||
|
|
||||||
const taskDataType = Number(
|
const taskDataType = Number(
|
||||||
(detail as { [key: string]: any })?.data_type ??
|
(detail as { [key: string]: any })?.data_type ??
|
||||||
@@ -250,10 +277,12 @@ const LabelPage = ({
|
|||||||
)
|
)
|
||||||
const isVideoTask =
|
const isVideoTask =
|
||||||
taskDataType === 2 ||
|
taskDataType === 2 ||
|
||||||
|
taskDataType === 7 ||
|
||||||
sourceNames.some((name) => videoExtPattern.test(name))
|
sourceNames.some((name) => videoExtPattern.test(name))
|
||||||
if (!isVideoTask) return detail
|
if (!isVideoTask) return detail
|
||||||
|
|
||||||
const imagesMap = new Map(useImagesStore.getState().images)
|
const imagesMap = new Map(useImagesStore.getState().images)
|
||||||
|
const frameMapUpdates = new Map<string, string[]>()
|
||||||
let imageMapUpdated = false
|
let imageMapUpdated = false
|
||||||
const normalizedDataName: Task.DataProps["data_name"] = []
|
const normalizedDataName: Task.DataProps["data_name"] = []
|
||||||
|
|
||||||
@@ -270,24 +299,37 @@ const LabelPage = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (!hasAllCachedFrames) {
|
if (!hasAllCachedFrames) {
|
||||||
|
let frameData: Awaited<ReturnType<typeof processVideo>> = []
|
||||||
|
try {
|
||||||
const base64Video = await getServerImage({
|
const base64Video = await getServerImage({
|
||||||
data_names: [videoName],
|
data_names: [videoName],
|
||||||
data_type: 2,
|
data_type: 2,
|
||||||
project_id: projectId,
|
project_id: projectId,
|
||||||
})
|
})
|
||||||
const frameData = await processVideo({
|
frameData = await processVideo({
|
||||||
base64Data: String(base64Video || ""),
|
base64Data: String(base64Video || ""),
|
||||||
fileName: videoName,
|
fileName: videoName,
|
||||||
namePrefix: normalizeNamePrefix(
|
namePrefix: normalizeNamePrefix(
|
||||||
`${projectId}_${taskId}_${videoName.replace(/\.[^.]+$/, "")}`
|
`${projectId}_${taskId}_${videoName.replace(/\.[^.]+$/, "")}`
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
} catch (error) {
|
||||||
|
const message = error instanceof Error ? error.message : "未知错误"
|
||||||
|
throw new Error(`视频帧生成失败:${videoName}(${message})`)
|
||||||
|
}
|
||||||
frameNames = frameData.map((frame) => frame.name)
|
frameNames = frameData.map((frame) => frame.name)
|
||||||
|
if (!frameNames.length) {
|
||||||
|
throw new Error(`视频帧生成失败:${videoName}`)
|
||||||
|
}
|
||||||
frameData.forEach((frame) => {
|
frameData.forEach((frame) => {
|
||||||
imagesMap.set(frame.name, frame.dataUrl)
|
imagesMap.set(frame.name, frame.dataUrl)
|
||||||
})
|
})
|
||||||
imageMapUpdated = true
|
imageMapUpdated = true
|
||||||
useVideoFrameStore.getState().setVideoFrames(cacheKey, frameNames)
|
frameMapUpdates.set(cacheKey, frameNames)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!frameNames.length) {
|
||||||
|
throw new Error(`视频帧映射为空:${videoName}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
frameNames.forEach((frameName) => {
|
frameNames.forEach((frameName) => {
|
||||||
@@ -298,24 +340,21 @@ const LabelPage = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!normalizedDataName.length) {
|
||||||
|
throw new Error("未生成可用视频帧")
|
||||||
|
}
|
||||||
|
|
||||||
if (imageMapUpdated) {
|
if (imageMapUpdated) {
|
||||||
useImagesStore.getState().setImages(imagesMap)
|
useImagesStore.getState().setImages(imagesMap)
|
||||||
}
|
}
|
||||||
if (!normalizedDataName.length) return detail
|
frameMapUpdates.forEach((frameNames, cacheKey) => {
|
||||||
|
useVideoFrameStore.getState().setVideoFrames(cacheKey, frameNames)
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...detail,
|
...detail,
|
||||||
data_name: normalizedDataName,
|
data_name: normalizedDataName,
|
||||||
}
|
}
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
showNotification({
|
|
||||||
color: "red",
|
|
||||||
title: "视频解码失败",
|
|
||||||
message: "视频帧生成失败,已回退到原始数据",
|
|
||||||
})
|
|
||||||
return detail
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[projectId, taskId]
|
[projectId, taskId]
|
||||||
)
|
)
|
||||||
@@ -385,6 +424,9 @@ const LabelPage = ({
|
|||||||
// 获取并处理当前任务标注结果数据
|
// 获取并处理当前任务标注结果数据
|
||||||
const dataRes = await getLabelResult(taskId)
|
const dataRes = await getLabelResult(taskId)
|
||||||
const { results } = dataRes
|
const { results } = dataRes
|
||||||
|
const resultImageEntries = results.flatMap((item) =>
|
||||||
|
expandLabelResultImages(item)
|
||||||
|
)
|
||||||
|
|
||||||
let currentWorkTime = 0
|
let currentWorkTime = 0
|
||||||
if (label_status === 2) {
|
if (label_status === 2) {
|
||||||
@@ -411,13 +453,14 @@ const LabelPage = ({
|
|||||||
review_key_frame_size: {},
|
review_key_frame_size: {},
|
||||||
question_size: {},
|
question_size: {},
|
||||||
}
|
}
|
||||||
results.forEach((item) => {
|
resultImageEntries.forEach(({ frameName, imageObjects }) => {
|
||||||
const { image_objects } = item
|
const { annotations, images, key_frame, desc } = imageObjects
|
||||||
if (image_objects) {
|
const rasterName = frameName || images.file_name
|
||||||
const { annotations, images, key_frame, desc } = image_objects
|
if (rasterName) {
|
||||||
usePaperStore
|
usePaperStore
|
||||||
.getState()
|
.getState()
|
||||||
.setRasterSize(images.file_name, [images.width, images.height])
|
.setRasterSize(rasterName, [images.width, images.height])
|
||||||
|
}
|
||||||
annotations.forEach((annotation) => {
|
annotations.forEach((annotation) => {
|
||||||
let reviewed = false
|
let reviewed = false
|
||||||
const { comment, prelabel, uid } = annotation
|
const { comment, prelabel, uid } = annotation
|
||||||
@@ -440,19 +483,19 @@ const LabelPage = ({
|
|||||||
})
|
})
|
||||||
if (key_frame) {
|
if (key_frame) {
|
||||||
if (label_status === 2) {
|
if (label_status === 2) {
|
||||||
let id = image_objects.label1_uid!
|
let id = imageObjects.label1_uid!
|
||||||
if (id)
|
if (id)
|
||||||
workLoad.key_frame_size[id]
|
workLoad.key_frame_size[id]
|
||||||
? workLoad.key_frame_size[id]++
|
? workLoad.key_frame_size[id]++
|
||||||
: (workLoad.key_frame_size[id] = 1)
|
: (workLoad.key_frame_size[id] = 1)
|
||||||
} else if (label_status === 4) {
|
} else if (label_status === 4) {
|
||||||
let id = image_objects.review1_uid!
|
let id = imageObjects.review1_uid!
|
||||||
if (id)
|
if (id)
|
||||||
workLoad.review_key_frame_size[id]
|
workLoad.review_key_frame_size[id]
|
||||||
? workLoad.review_key_frame_size[id]++
|
? workLoad.review_key_frame_size[id]++
|
||||||
: (workLoad.review_key_frame_size[id] = 1)
|
: (workLoad.review_key_frame_size[id] = 1)
|
||||||
} else if (label_status === 6) {
|
} else if (label_status === 6) {
|
||||||
let id = image_objects.review2_uid!
|
let id = imageObjects.review2_uid!
|
||||||
if (id)
|
if (id)
|
||||||
workLoad.review_key_frame_size[id]
|
workLoad.review_key_frame_size[id]
|
||||||
? workLoad.review_key_frame_size[id]++
|
? workLoad.review_key_frame_size[id]++
|
||||||
@@ -481,7 +524,6 @@ const LabelPage = ({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
console.log("获取时计算的工作量统计", workLoad)
|
console.log("获取时计算的工作量统计", workLoad)
|
||||||
setOldWorkLoad(workLoad)
|
setOldWorkLoad(workLoad)
|
||||||
@@ -492,11 +534,11 @@ const LabelPage = ({
|
|||||||
// 重置 PathGroupIds
|
// 重置 PathGroupIds
|
||||||
useRightToolsStore.getState().setPathGroupIds([])
|
useRightToolsStore.getState().setPathGroupIds([])
|
||||||
// 生成标注结果
|
// 生成标注结果
|
||||||
results.forEach((item) => {
|
resultImageEntries.forEach(({ frameName, imageObjects }) => {
|
||||||
const { data_name, image_objects } = item
|
const key = frameName
|
||||||
if (image_objects) {
|
if (!key) return
|
||||||
const categoryMap = new Map()
|
const categoryMap = new Map()
|
||||||
const { annotations, image_groups, desc } = image_objects
|
const { annotations, image_groups, desc } = imageObjects
|
||||||
// 赋值用过的 id
|
// 赋值用过的 id
|
||||||
annotations.map((annotation) => {
|
annotations.map((annotation) => {
|
||||||
useRightToolsStore.getState().pushPathId(annotation.id)
|
useRightToolsStore.getState().pushPathId(annotation.id)
|
||||||
@@ -578,17 +620,16 @@ const LabelPage = ({
|
|||||||
|
|
||||||
categoryMap.set(categoryKey, arr)
|
categoryMap.set(categoryKey, arr)
|
||||||
})
|
})
|
||||||
const key = data_name
|
|
||||||
taskLabelData.set(key, categoryMap)
|
taskLabelData.set(key, categoryMap)
|
||||||
// 关键帧信息
|
// 关键帧信息
|
||||||
const keyFrame = {
|
const keyFrame = {
|
||||||
key_frame: image_objects.key_frame || false,
|
key_frame: imageObjects.key_frame || false,
|
||||||
label1_ts: image_objects.label1_ts || 0,
|
label1_ts: imageObjects.label1_ts || 0,
|
||||||
label1_uid: image_objects.label1_uid || 0,
|
label1_uid: imageObjects.label1_uid || 0,
|
||||||
review1_ts: image_objects.review1_ts || 0,
|
review1_ts: imageObjects.review1_ts || 0,
|
||||||
review1_uid: image_objects.review1_uid || 0,
|
review1_uid: imageObjects.review1_uid || 0,
|
||||||
review2_ts: image_objects.review2_ts || 0,
|
review2_ts: imageObjects.review2_ts || 0,
|
||||||
review2_uid: image_objects.review2_uid || 0,
|
review2_uid: imageObjects.review2_uid || 0,
|
||||||
}
|
}
|
||||||
useBottomToolsStore.getState().setKeyFrameData(key, keyFrame)
|
useBottomToolsStore.getState().setKeyFrameData(key, keyFrame)
|
||||||
// 大语言模型 两种数据情况
|
// 大语言模型 两种数据情况
|
||||||
@@ -665,7 +706,6 @@ const LabelPage = ({
|
|||||||
])
|
])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
setLabel(taskLabelData)
|
setLabel(taskLabelData)
|
||||||
// 获取任务详情时设置状态栈初始值
|
// 获取任务详情时设置状态栈初始值
|
||||||
@@ -675,9 +715,18 @@ const LabelPage = ({
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
setOldWorkLoad(null)
|
setOldWorkLoad(null)
|
||||||
|
setTaskDetail(undefined)
|
||||||
|
useBottomToolsStore.getState().setAllItems([])
|
||||||
setLabel(new Map())
|
setLabel(new Map())
|
||||||
setStateStack([])
|
setStateStack([])
|
||||||
useRightToolsStore.getState().setPathGroupMap(new Map())
|
useRightToolsStore.getState().setPathGroupMap(new Map())
|
||||||
|
if (err instanceof Error && err.message.includes("视频")) {
|
||||||
|
showNotification({
|
||||||
|
color: "red",
|
||||||
|
title: "视频解码失败",
|
||||||
|
message: err.message,
|
||||||
|
})
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
usePaperStore.getState().setLoadingData(false)
|
usePaperStore.getState().setLoadingData(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
export interface LabelResult {
|
export interface LabelResult {
|
||||||
data_name: string
|
data_name: string
|
||||||
image_objects?: ImageObjects
|
image_objects?: ImageObjects
|
||||||
|
video_objects?: {
|
||||||
|
[key: string]: ImageObjects
|
||||||
|
}
|
||||||
pc_box_objects?: { [key: string]: any }[]
|
pc_box_objects?: { [key: string]: any }[]
|
||||||
pc_segment_objects?: { [key: string]: any }[]
|
pc_segment_objects?: { [key: string]: any }[]
|
||||||
pc_vegetation_objects?: { [key: string]: any }[]
|
pc_vegetation_objects?: { [key: string]: any }[]
|
||||||
@@ -129,6 +132,7 @@ export interface DataList {
|
|||||||
data_name: string
|
data_name: string
|
||||||
data_type: string
|
data_type: string
|
||||||
image_data?: string
|
image_data?: string
|
||||||
|
video_data?: string
|
||||||
pointcloud_data?: PointcloudDatum[]
|
pointcloud_data?: PointcloudDatum[]
|
||||||
[property: string]: any
|
[property: string]: any
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ export namespace Task {
|
|||||||
id: number
|
id: number
|
||||||
create_date: string
|
create_date: string
|
||||||
data_type?: number
|
data_type?: number
|
||||||
task_data_type?: number
|
|
||||||
data_name: {
|
data_name: {
|
||||||
name: [string]
|
name: [string]
|
||||||
related_images: []
|
related_images: []
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ import {
|
|||||||
useKeyEventStore,
|
useKeyEventStore,
|
||||||
useLabelStore,
|
useLabelStore,
|
||||||
useObjectStore,
|
useObjectStore,
|
||||||
|
useVideoFrameStore,
|
||||||
} from "../store"
|
} from "../store"
|
||||||
import { useBackUrlStore, usePermissionStore } from "../store/auth"
|
import { useBackUrlStore, usePermissionStore } from "../store/auth"
|
||||||
import { useBottomToolsStore } from "../useBottomToolsStore"
|
import { useBottomToolsStore } from "../useBottomToolsStore"
|
||||||
@@ -450,7 +451,7 @@ const TopTools = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { label_status, data_name } = taskDetail!
|
const { label_status, data_name } = taskDetail!
|
||||||
let results = data_name.map((item, imageId) => {
|
const frameResults = data_name.map((item, imageId) => {
|
||||||
const name = item.name?.[0]
|
const name = item.name?.[0]
|
||||||
let finalData: LabelResult = {
|
let finalData: LabelResult = {
|
||||||
data_name: name,
|
data_name: name,
|
||||||
@@ -637,6 +638,90 @@ const TopTools = (
|
|||||||
finalData.image_objects = image_objects
|
finalData.image_objects = image_objects
|
||||||
return finalData
|
return finalData
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let saveResults: LabelResult[] = frameResults
|
||||||
|
if (projectDetail?.label_type === 7) {
|
||||||
|
const frameNamesFromTask = data_name
|
||||||
|
.map((item) => item.name?.[0] || "")
|
||||||
|
.filter((name) => !!name)
|
||||||
|
const frameNameSet = new Set(frameNamesFromTask)
|
||||||
|
const frameStore = useVideoFrameStore.getState().videoFrames
|
||||||
|
const taskVideoPrefix = `${taskDetail!.project_id}:${taskDetail!.id}:`
|
||||||
|
const videoFrameEntries = Array.from(frameStore.entries()).filter(
|
||||||
|
([key]) => key.startsWith(taskVideoPrefix)
|
||||||
|
)
|
||||||
|
if (!videoFrameEntries.length) {
|
||||||
|
throw new Error("视频帧映射缺失,无法保存,请刷新任务后重试")
|
||||||
|
}
|
||||||
|
|
||||||
|
const videoFrameMap = new Map<string, string[]>()
|
||||||
|
videoFrameEntries.forEach(([key, frameNames]) => {
|
||||||
|
const videoName = key.slice(taskVideoPrefix.length)
|
||||||
|
if (!videoName) return
|
||||||
|
videoFrameMap.set(
|
||||||
|
videoName,
|
||||||
|
(frameNames || []).filter((frameName) =>
|
||||||
|
frameNameSet.has(frameName)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
})
|
||||||
|
if (!videoFrameMap.size) {
|
||||||
|
throw new Error("视频帧映射无效,无法保存,请刷新任务后重试")
|
||||||
|
}
|
||||||
|
|
||||||
|
const videoNames = Array.from(videoFrameMap.keys())
|
||||||
|
const frameToVideoMap = new Map<string, string>()
|
||||||
|
videoFrameMap.forEach((frameNames, videoName) => {
|
||||||
|
frameNames.forEach((frameName) => {
|
||||||
|
frameToVideoMap.set(frameName, videoName)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const unresolvedFrames = frameNamesFromTask.filter(
|
||||||
|
(frameName) => !frameToVideoMap.has(frameName)
|
||||||
|
)
|
||||||
|
if (unresolvedFrames.length) {
|
||||||
|
throw new Error(
|
||||||
|
`视频帧映射缺失,无法保存,请刷新任务后重试: ${unresolvedFrames.slice(0, 5).join(", ")}`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const frameResultMap = new Map<string, ImageObjects>()
|
||||||
|
frameResults.forEach((item) => {
|
||||||
|
if (item.image_objects) {
|
||||||
|
frameResultMap.set(item.data_name, item.image_objects)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const groupedVideoObjects = new Map<
|
||||||
|
string,
|
||||||
|
{ [key: string]: ImageObjects }
|
||||||
|
>()
|
||||||
|
frameResultMap.forEach((imageObjects, frameName) => {
|
||||||
|
const videoName = frameToVideoMap.get(frameName)
|
||||||
|
if (!videoName) return
|
||||||
|
if (!groupedVideoObjects.has(videoName)) {
|
||||||
|
groupedVideoObjects.set(videoName, {})
|
||||||
|
}
|
||||||
|
groupedVideoObjects.get(videoName)![frameName] = imageObjects
|
||||||
|
})
|
||||||
|
|
||||||
|
saveResults = videoNames
|
||||||
|
.map((videoName) => {
|
||||||
|
const videoObjects = groupedVideoObjects.get(videoName)
|
||||||
|
if (!videoObjects || !Object.keys(videoObjects).length) return null
|
||||||
|
return {
|
||||||
|
data_name: videoName,
|
||||||
|
video_objects: videoObjects,
|
||||||
|
} as LabelResult
|
||||||
|
})
|
||||||
|
.filter((item): item is LabelResult => !!item)
|
||||||
|
|
||||||
|
if (!saveResults.length) {
|
||||||
|
throw new Error("视频任务保存结果为空")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const workTime = {
|
const workTime = {
|
||||||
label_work_time: labelTime.label,
|
label_work_time: labelTime.label,
|
||||||
first_review_work_time: labelTime.review1,
|
first_review_work_time: labelTime.review1,
|
||||||
@@ -653,7 +738,7 @@ const TopTools = (
|
|||||||
}
|
}
|
||||||
const workLoad: WorkLoad = JSON.parse(JSON.stringify(initialWorkLoad))
|
const workLoad: WorkLoad = JSON.parse(JSON.stringify(initialWorkLoad))
|
||||||
workLoad.work_time = time ? time - oldWorkLoad.work_time : 0
|
workLoad.work_time = time ? time - oldWorkLoad.work_time : 0
|
||||||
results.forEach((item) => {
|
frameResults.forEach((item) => {
|
||||||
const { image_objects } = item
|
const { image_objects } = item
|
||||||
if (image_objects) {
|
if (image_objects) {
|
||||||
const { annotations, key_frame, desc } = image_objects
|
const { annotations, key_frame, desc } = image_objects
|
||||||
@@ -744,12 +829,9 @@ const TopTools = (
|
|||||||
let params: RequestLabelResult = {
|
let params: RequestLabelResult = {
|
||||||
uid: user_id,
|
uid: user_id,
|
||||||
task_id: taskDetail?.id || 0,
|
task_id: taskDetail?.id || 0,
|
||||||
results: results,
|
results: saveResults,
|
||||||
...defaultObj,
|
...defaultObj,
|
||||||
}
|
}
|
||||||
results.forEach((item) => {
|
|
||||||
console.log(item.image_objects)
|
|
||||||
})
|
|
||||||
console.log(params, workLoad)
|
console.log(params, workLoad)
|
||||||
await saveLabelResult(params)
|
await saveLabelResult(params)
|
||||||
notifications.show({
|
notifications.show({
|
||||||
@@ -760,6 +842,11 @@ const TopTools = (
|
|||||||
updateOldWorkLoad(workLoad)
|
updateOldWorkLoad(workLoad)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
notifications.hide("save")
|
||||||
|
notifications.show({
|
||||||
|
color: "red",
|
||||||
|
message: error?.message || "保存失败",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
labelCategories,
|
labelCategories,
|
||||||
|
|||||||
Reference in New Issue
Block a user