This commit is contained in:
2026-09-02 11:49:56 +08:00
parent 1eb97faaa7
commit fcf5947545
8 changed files with 48 additions and 11 deletions
+20 -2
View File
@@ -206,26 +206,35 @@ function startLabelTask() {
ElMessage.success('已发起预标,进度见页顶进度条')
pollLabelTask(data.id)
})
.catch(() => {})
.catch((e) => {
const msg = e?.message || e
if (msg !== 'cancel' && msg !== 'close') ElMessage.error(`预标发起失败:${msg}`)
})
}
// VLM 藏匿位补检(「补标」按钮,勾选驱动批量执行):排除已确认框,按环境/光线/习性
// 找可能藏匿处,逐张追加疑似框(黄框,人工确认);依赖已确认框作为排除基准
const vlmReviewing = ref(false)
const vlmProgress = ref({ done: 0, total: 0 })
async function vlmBatchReview() {
if (!selected.value.length) return
const images = (detail.value.images || []).filter((it) => selected.value.includes(it.filename))
if (!images.length) return
vlmReviewing.value = true
vlmProgress.value = { done: 0, total: images.length }
try {
let added = 0
let note = ''
for (const item of images) {
const m = meta(item)
if (!m.id) continue
if (!m.id) {
vlmProgress.value.done++
continue
}
const d = await request.post('/datasets/images/vlm-review', { datasetId: datasetId.value, imageId: m.id }, { timeout: 300000 })
added += d.added || 0
note = d.note || note
vlmProgress.value.done++
}
if (added > 0) {
ElMessage.success(`补标新增 ${added} 个疑似框(黄框,请人工确认)`)
@@ -235,6 +244,8 @@ async function vlmBatchReview() {
await loadAll()
// 标注弹窗开着时刷新当前图的标注
if (editorVisible.value) nextTick(resetEditor)
} catch (e) {
ElMessage.error(`补标失败:${e?.message || e}`)
} finally {
vlmReviewing.value = false
}
@@ -770,6 +781,13 @@ onBeforeUnmount(() => {
<div v-if="labelTask && labelTask.status === 'done' && labelTask.error" class="label-error">
自动标注未完成{{ labelTask.error }}
</div>
<div v-if="vlmReviewing" class="label-progress">
<el-progress
:percentage="vlmProgress.total ? Math.min(100, Math.round((vlmProgress.done / vlmProgress.total) * 100)) : 0"
:stroke-width="10"
/>
<span class="label-progress-tip">补标中 {{ vlmProgress.done }}/{{ vlmProgress.total }} VLM 藏匿位补检</span>
</div>
<div v-if="genRunning" class="label-progress">
<el-progress
:percentage="genTask.total ? Math.min(100, Math.round((genTask.done / genTask.total) * 100)) : 0"