From 49fec29029715473cc1ad36266c5b4a253a8bddc Mon Sep 17 00:00:00 2001 From: hhhhsc <1710496817@qq.com> Date: Thu, 23 Apr 2026 10:07:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A0=87=E6=B3=A8?= =?UTF-8?q?=E7=AE=97=E5=AD=90=EF=BC=8C=E5=B1=8F=E8=94=BD=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=A0=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CreateAnnotationTaskDialog.tsx | 194 +++-- .../DataAnnotation/Home/DataAnnotation.tsx | 233 ++--- runtime/ops/annotation/__init__.py | 3 +- .../__init__.py | 9 - .../metadata.yml | 3 - .../process.py | 208 ----- .../image_semantic_segmentation/process.py | 166 ---- runtime/ops/pyproject.toml | 2 - .../datamate/auto_annotation_worker.py | 819 ------------------ .../datamate/operator_runtime.py | 14 +- scripts/db/data-operator-init.sql | 14 +- 11 files changed, 225 insertions(+), 1440 deletions(-) delete mode 100644 runtime/ops/annotation/image_object_detection_bounding_box/__init__.py delete mode 100644 runtime/ops/annotation/image_object_detection_bounding_box/metadata.yml delete mode 100644 runtime/ops/annotation/image_object_detection_bounding_box/process.py delete mode 100644 runtime/ops/annotation/image_semantic_segmentation/process.py delete mode 100644 runtime/python-executor/datamate/auto_annotation_worker.py diff --git a/frontend/src/pages/DataAnnotation/Create/components/CreateAnnotationTaskDialog.tsx b/frontend/src/pages/DataAnnotation/Create/components/CreateAnnotationTaskDialog.tsx index abb265a23..49aa0a55b 100644 --- a/frontend/src/pages/DataAnnotation/Create/components/CreateAnnotationTaskDialog.tsx +++ b/frontend/src/pages/DataAnnotation/Create/components/CreateAnnotationTaskDialog.tsx @@ -417,6 +417,7 @@ export default function CreateAnnotationTask({ } width={800} > + {/* 自动标注功能已屏蔽 - Tabs 结构保留但仅显示手动标注 */} setActiveMode(key as "manual" | "auto")} @@ -548,102 +549,103 @@ export default function CreateAnnotationTask({ ), }, - { - key: "auto", - label: t('dataAnnotation.create.auto'), - children: ( -
- {/* 自动标注:任务名称仍然放在第一行,必填 */} - - - - - - { - setSelectedDataset(dataset as Dataset | null); - autoForm.setFieldsValue({ datasetId: dataset?.id ?? "" }); - }} - datasetTypeFilter={DatasetType.IMAGE} - allowedFileExtensions={IMAGE_EXTENSIONS} - singleDatasetOnly - /> - {selectedDataset && ( -
- {t('dataAnnotation.create.form.currentDataset', { name: selectedDataset.name, count: imageFileCount })} -
- )} -
- - - - - - - - - `${(v || 0) * 100}%` }} - /> - - - - handleClassSelectionChange(e.target.checked)} - > - {t('dataAnnotation.create.form.selectAllClasses')} - - {!selectAllClasses && ( - - - - )} - -
- ), - }, + // 自动标注 Tab 已屏蔽(代码保留在下方注释中,需要恢复时可取消注释) + // { + // key: "auto", + // label: t('dataAnnotation.create.auto'), + // children: ( + //
+ // {/* 自动标注:任务名称仍然放在第一行,必填 */} + // + // + // + // + // + // { + // setSelectedDataset(dataset as Dataset | null); + // autoForm.setFieldsValue({ datasetId: dataset?.id ?? "" }); + // }} + // datasetTypeFilter={DatasetType.IMAGE} + // allowedFileExtensions={IMAGE_EXTENSIONS} + // singleDatasetOnly + // /> + // {selectedDataset && ( + //
+ // {t('dataAnnotation.create.form.currentDataset', { name: selectedDataset.name, count: imageFileCount })} + //
+ // )} + //
+ // + // + // + // + // + // + // + // + // `${(v || 0) * 100}%` }} + // /> + // + // + // + // handleClassSelectionChange(e.target.checked)} + // > + // {t('dataAnnotation.create.form.selectAllClasses')} + // + // {!selectAllClasses && ( + // + // + // + // )} + // + //
+ // ), + // }, ]} /> diff --git a/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx b/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx index 2d5035925..02cdc4589 100644 --- a/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx +++ b/frontend/src/pages/DataAnnotation/Home/DataAnnotation.tsx @@ -509,37 +509,38 @@ export default function DataAnnotation() { return !name.endsWith(" - 自动标注"); }); + // 自动标注功能已屏蔽:仅显示手动标注任务 const mergedTableData = [ // 手动标注任务(过滤掉自动生成的映射任务) ...manualVisibleTasks.map((task) => ({ ...task, _kind: "manual" as const, })), - // 自动标注任务 - ...autoTasks.map((task: any) => { - const sourceList = Array.isArray(task.sourceDatasets) - ? task.sourceDatasets - : task.datasetName - ? [task.datasetName] - : []; - const datasetName = sourceList.length > 0 ? sourceList.join(",") : "-"; - - return { - id: task.id, - name: task.name, - datasetId: task.datasetId || task.dataset_id, - datasetName, - createdAt: task.createdAt || "-", - updatedAt: task.updatedAt || "-", - _kind: "auto" as const, - autoStatus: task.status, - autoProgress: task.progress, - autoProcessedImages: task.processedImages, - autoTotalImages: task.totalImages, - autoDetectedObjects: task.detectedObjects, - autoConfig: task.config || {}, - }; - }), + // 自动标注任务已屏蔽(代码保留在下方注释中,需要恢复时可取消注释) + // ...autoTasks.map((task: any) => { + // const sourceList = Array.isArray(task.sourceDatasets) + // ? task.sourceDatasets + // : task.datasetName + // ? [task.datasetName] + // : []; + // const datasetName = sourceList.length > 0 ? sourceList.join(",") : "-"; + // + // return { + // id: task.id, + // name: task.name, + // datasetId: task.datasetId || task.dataset_id, + // datasetName, + // createdAt: task.createdAt || "-", + // updatedAt: task.updatedAt || "-", + // _kind: "auto" as const, + // autoStatus: task.status, + // autoProgress: task.progress, + // autoProcessedImages: task.processedImages, + // autoTotalImages: task.totalImages, + // autoDetectedObjects: task.detectedObjects, + // autoConfig: task.config || {}, + // }; + // }), ]; const columns: ColumnType[] = [ @@ -585,88 +586,89 @@ export default function DataAnnotation() { ); }, }, - { - title: t('dataAnnotation.home.columns.model'), - key: "modelSize", - width: 160, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const size = record.autoConfig?.modelSize; - return t(`dataAnnotation.home.autoModelSizeLabels.${size}`) || size || "-"; - }, - }, - { - title: t('dataAnnotation.home.columns.confidence'), - key: "confThreshold", - width: 120, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const threshold = record.autoConfig?.confThreshold; - if (typeof threshold !== "number") return "-"; - return `${(threshold * 100).toFixed(0)}%`; - }, - }, - { - title: t('dataAnnotation.home.columns.targetClasses'), - key: "targetClasses", - width: 160, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const classes: number[] = record.autoConfig?.targetClasses || []; - if (!classes.length) return t('dataAnnotation.home.allCategories'); - const text = classes.join(", "); - return ( - - {t('dataAnnotation.home.categoriesCount', { count: classes.length })} - - ); - }, - }, - { - title: t('dataAnnotation.home.columns.autoStatus'), - key: "autoStatus", - width: 130, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const status = record.autoStatus as string; - const label = t(`dataAnnotation.home.autoStatusLabels.${status}`) || status || "-"; - return {label}; - }, - }, - { - title: t('dataAnnotation.home.columns.autoProgress'), - key: "autoProgress", - width: 200, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const progress = typeof record.autoProgress === "number" ? record.autoProgress : 0; - const processed = record.autoProcessedImages ?? 0; - const total = record.autoTotalImages ?? 0; - return ( -
- -
- {processed} / {total} -
-
- ); - }, - }, - { - title: t('dataAnnotation.home.columns.detectedObjects'), - key: "detectedObjects", - width: 120, - render: (_: any, record: any) => { - if (record._kind !== "auto") return "-"; - const count = record.autoDetectedObjects; - if (typeof count !== "number") return "-"; - try { - return count.toLocaleString(); - } catch { - return String(count); - } - }, - }, + // 自动标注相关列已屏蔽(保留代码在注释中) + // { + // title: t('dataAnnotation.home.columns.model'), + // key: "modelSize", + // width: 160, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const size = record.autoConfig?.modelSize; + // return t(`dataAnnotation.home.autoModelSizeLabels.${size}`) || size || "-"; + // }, + // }, + // { + // title: t('dataAnnotation.home.columns.confidence'), + // key: "confThreshold", + // width: 120, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const threshold = record.autoConfig?.confThreshold; + // if (typeof threshold !== "number") return "-"; + // return `${(threshold * 100).toFixed(0)}%`; + // }, + // }, + // { + // title: t('dataAnnotation.home.columns.targetClasses'), + // key: "targetClasses", + // width: 160, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const classes: number[] = record.autoConfig?.targetClasses || []; + // if (!classes.length) return t('dataAnnotation.home.allCategories'); + // const text = classes.join(", "); + // return ( + // + // {t('dataAnnotation.home.categoriesCount', { count: classes.length })} + // + // ); + // }, + // }, + // { + // title: t('dataAnnotation.home.columns.autoStatus'), + // key: "autoStatus", + // width: 130, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const status = record.autoStatus as string; + // const label = t(`dataAnnotation.home.autoStatusLabels.${status}`) || status || "-"; + // return {label}; + // }, + // }, + // { + // title: t('dataAnnotation.home.columns.autoProgress'), + // key: "autoProgress", + // width: 200, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const progress = typeof record.autoProgress === "number" ? record.autoProgress : 0; + // const processed = record.autoProcessedImages ?? 0; + // const total = record.autoTotalImages ?? 0; + // return ( + //
+ // + //
+ // {processed} / {total} + //
+ //
+ // ); + // }, + // }, + // { + // title: t('dataAnnotation.home.columns.detectedObjects'), + // key: "detectedObjects", + // width: 120, + // render: (_: any, record: any) => { + // if (record._kind !== "auto") return "-"; + // const count = record.autoDetectedObjects; + // if (typeof count !== "number") return "-"; + // try { + // return count.toLocaleString(); + // } catch { + // return String(count); + // } + // }, + // }, { title: t('dataAnnotation.home.columns.createdAt'), dataIndex: "createdAt", @@ -736,7 +738,8 @@ export default function DataAnnotation() { )} - {task._kind === "auto" && ( + {/* 自动标注任务操作按钮已屏蔽(保留代码在注释中) */} + {/* {task._kind === "auto" && ( <>