@glodon-aiot/dataset-annotation 3.14.0-alpha.33 → 3.14.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +217 -167
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +114 -122
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +445 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +249 -113
- package/dist/es/components/VLMAnnotationDetail/index.mjs +219 -213
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +21 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +11 -2
- package/package.json +2 -2
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +0 -455
- /package/dist/es/components/VLMAnnotationDetail/{MarkVLMBoxModal → VLMDetail}/style.less.mjs +0 -0
|
@@ -1,149 +1,285 @@
|
|
|
1
|
-
var N = (
|
|
2
|
-
var
|
|
1
|
+
var N = (d, s, m) => new Promise((n, v) => {
|
|
2
|
+
var y = (a) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
t(m.next(a));
|
|
5
|
+
} catch (h) {
|
|
6
|
+
v(h);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, M = (a) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
t(m.throw(a));
|
|
11
|
+
} catch (h) {
|
|
12
|
+
v(h);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, t = (a) => a.done ? n(a.value) : Promise.resolve(a.value).then(y, M);
|
|
15
|
+
t((m = m.apply(d, s)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import { useRef as
|
|
19
|
-
import { Modal as
|
|
17
|
+
import { jsx as e, jsxs as l, Fragment as b } from "react/jsx-runtime";
|
|
18
|
+
import { useRef as T, useState as c, useContext as oe, useEffect as q, useCallback as ce } from "react";
|
|
19
|
+
import { Modal as B, Button as C, Space as D, Spin as me, Tabs as ue, message as G } from "antd";
|
|
20
20
|
import "./style.less.mjs";
|
|
21
|
-
import { useKeyPress as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
21
|
+
import { useKeyPress as U } from "ahooks";
|
|
22
|
+
import { LoadingOutlined as fe, MenuUnfoldOutlined as he, MenuFoldOutlined as ve } from "@ant-design/icons";
|
|
23
|
+
import pe from "../../../DatasetContext/index.mjs";
|
|
24
|
+
import ge from "../../VLMAnnotation/index.mjs";
|
|
25
|
+
import $ from "../../Iconfont/index.mjs";
|
|
26
|
+
import Ne from "../VLMDetail/index.mjs";
|
|
27
|
+
const Qe = (d) => {
|
|
26
28
|
const {
|
|
27
|
-
isVlmModalVisible:
|
|
28
|
-
setIsVlmModalVisible:
|
|
29
|
-
record:
|
|
30
|
-
onNextClick:
|
|
31
|
-
onPrevClick:
|
|
32
|
-
listLoading:
|
|
33
|
-
datasetId:
|
|
34
|
-
versionId:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
isVlmModalVisible: s,
|
|
30
|
+
setIsVlmModalVisible: m,
|
|
31
|
+
record: n,
|
|
32
|
+
onNextClick: v,
|
|
33
|
+
onPrevClick: y,
|
|
34
|
+
listLoading: M = !1,
|
|
35
|
+
datasetId: t,
|
|
36
|
+
versionId: a,
|
|
37
|
+
handleMarkClick: h,
|
|
38
|
+
updateSampleList: H,
|
|
39
|
+
filterMode: J = "",
|
|
40
|
+
onFilterModeChange: W,
|
|
41
|
+
samples: X,
|
|
42
|
+
onSave: V,
|
|
43
|
+
selectSampleId: Y,
|
|
44
|
+
onClose: L,
|
|
45
|
+
pagination: Z,
|
|
46
|
+
currentIndex: _
|
|
47
|
+
} = d, ee = T({}), w = T(null), [i, ie] = c(), [ae, Q] = c(!1), [u, x] = c(d.initialMode || "preview"), [te, k] = c([]), [R, O] = c(0), [ne, I] = c(!1), [S, j] = c(!0), {
|
|
45
48
|
services: {
|
|
46
|
-
cvforceDatahub:
|
|
49
|
+
cvforceDatahub: r
|
|
47
50
|
},
|
|
48
51
|
featuresConfig: {
|
|
49
|
-
datasetManager:
|
|
52
|
+
datasetManager: A
|
|
50
53
|
} = {
|
|
51
54
|
datasetManager: !1
|
|
52
55
|
}
|
|
53
|
-
} =
|
|
54
|
-
|
|
55
|
-
}, y = () => {
|
|
56
|
-
c && r();
|
|
57
|
-
};
|
|
58
|
-
I("rightarrow", () => {
|
|
59
|
-
y();
|
|
60
|
-
}), I("leftarrow", () => {
|
|
61
|
-
v();
|
|
62
|
-
}), A(() => {
|
|
63
|
-
i && s && e && (g(!0), n == null || n.getDatasetsIdVersionsVidSsamplesSid(s, e, o.id).then((z) => {
|
|
64
|
-
R(z);
|
|
65
|
-
}).finally(() => g(!1)));
|
|
66
|
-
}, [i, o]);
|
|
67
|
-
const O = () => {
|
|
68
|
-
l(!1);
|
|
56
|
+
} = oe(pe), p = !(ae || M), F = () => {
|
|
57
|
+
p && y();
|
|
69
58
|
}, P = () => {
|
|
70
|
-
|
|
59
|
+
p && v();
|
|
60
|
+
};
|
|
61
|
+
U("rightarrow", () => {
|
|
62
|
+
P();
|
|
63
|
+
}), U("leftarrow", () => {
|
|
64
|
+
F();
|
|
65
|
+
}), q(() => {
|
|
66
|
+
s ? d.initialMode && x(d.initialMode) : x("preview");
|
|
67
|
+
}, [s, d.initialMode]), q(() => {
|
|
68
|
+
if (s && t && a && u === "preview") {
|
|
69
|
+
if (Q(!0), !(n != null && n.id))
|
|
70
|
+
return;
|
|
71
|
+
r == null || r.getDatasetsIdVersionsVidSsamplesSid(t, a, n.id).then((f) => {
|
|
72
|
+
ie(f);
|
|
73
|
+
}).finally(() => Q(!1));
|
|
74
|
+
}
|
|
75
|
+
}, [s, n, u]);
|
|
76
|
+
const le = ce(() => N(void 0, null, function* () {
|
|
77
|
+
if (!t || !a || !(i != null && i.id))
|
|
78
|
+
return;
|
|
79
|
+
if (!((i == null ? void 0 : i.labels) || []).length) {
|
|
80
|
+
k([]), I(!1);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
I(!0);
|
|
84
|
+
try {
|
|
85
|
+
const g = yield r == null ? void 0 : r.postGenerateVlmKieQa(t, a, {
|
|
86
|
+
sampleIds: [i.id]
|
|
87
|
+
});
|
|
88
|
+
k(g || []), O(0);
|
|
89
|
+
} catch (g) {
|
|
90
|
+
console.error("QA生成失败", g), k([]);
|
|
91
|
+
} finally {
|
|
92
|
+
I(!1);
|
|
93
|
+
}
|
|
94
|
+
}), [t, a, i]);
|
|
95
|
+
q(() => {
|
|
96
|
+
!s || u !== "preview" || i != null && i.id && le();
|
|
97
|
+
}, [i]);
|
|
98
|
+
const se = () => N(void 0, null, function* () {
|
|
99
|
+
if (u === "annotation" && w.current) {
|
|
100
|
+
yield w.current.handleModalCancel();
|
|
101
|
+
return;
|
|
102
|
+
} else
|
|
103
|
+
L();
|
|
104
|
+
}), re = () => {
|
|
105
|
+
x("annotation"), h((i == null ? void 0 : i.id) || (n == null ? void 0 : n.id));
|
|
106
|
+
}, de = () => {
|
|
107
|
+
B.confirm({
|
|
71
108
|
title: "确认要删除此数据吗?",
|
|
72
109
|
content: "删除后不可恢复,请慎重操作",
|
|
73
110
|
onOk: () => {
|
|
74
|
-
!
|
|
75
|
-
|
|
76
|
-
}).catch(() =>
|
|
111
|
+
!t || !a || !(i != null && i.id) || r == null || r.delDatasetsIdVersionsVidSamplesId(t, a, i.id).then(() => {
|
|
112
|
+
G.success("删除成功"), m(!1), H();
|
|
113
|
+
}).catch(() => G.error("删除失败"));
|
|
77
114
|
}
|
|
78
115
|
});
|
|
79
116
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
title: /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ e(B, {
|
|
118
|
+
title: /* @__PURE__ */ e("div", {
|
|
82
119
|
className: "vlm-sample-detail-title",
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
-
children: "详情"
|
|
120
|
+
children: /* @__PURE__ */ e("span", {
|
|
121
|
+
children: u === "preview" ? "详情" : "标注"
|
|
85
122
|
})
|
|
86
123
|
}),
|
|
87
124
|
width: "100%",
|
|
88
125
|
wrapClassName: "vlm-modal-wrap",
|
|
89
126
|
className: "vlm-modal",
|
|
90
|
-
open:
|
|
127
|
+
open: s,
|
|
91
128
|
destroyOnClose: !0,
|
|
92
|
-
onCancel: () =>
|
|
129
|
+
onCancel: () => se(),
|
|
93
130
|
maskClosable: !1,
|
|
94
131
|
centered: !0,
|
|
95
132
|
footer: null,
|
|
96
|
-
children:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
133
|
+
children: u === "preview" ? /* @__PURE__ */ l(b, {
|
|
134
|
+
children: [/* @__PURE__ */ e("div", {
|
|
135
|
+
className: "vlm-detail",
|
|
136
|
+
children: /* @__PURE__ */ l("div", {
|
|
137
|
+
className: "detail-content",
|
|
138
|
+
children: [/* @__PURE__ */ e(C, {
|
|
139
|
+
className: "select-prev",
|
|
140
|
+
icon: /* @__PURE__ */ e($, {
|
|
141
|
+
type: "icon-zuojiantou"
|
|
142
|
+
}),
|
|
143
|
+
type: "text",
|
|
144
|
+
disabled: !p,
|
|
145
|
+
onClick: () => F()
|
|
146
|
+
}), /* @__PURE__ */ e("div", {
|
|
147
|
+
className: "select-main",
|
|
148
|
+
ref: ee,
|
|
149
|
+
children: i && /* @__PURE__ */ e(ge, {
|
|
150
|
+
sample: i,
|
|
151
|
+
labelDefinitions: [],
|
|
152
|
+
hideRightSide: !0,
|
|
153
|
+
readOnly: !0,
|
|
154
|
+
ocrRecognize: () => N(void 0, null, function* () {
|
|
155
|
+
return [];
|
|
156
|
+
})
|
|
118
157
|
})
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
158
|
+
}), S && /* @__PURE__ */ l(b, {
|
|
159
|
+
children: [/* @__PURE__ */ l("div", {
|
|
160
|
+
className: "qa-preview-container",
|
|
161
|
+
children: [/* @__PURE__ */ l("div", {
|
|
162
|
+
className: "qa-preview-header",
|
|
163
|
+
children: [/* @__PURE__ */ e("div", {
|
|
164
|
+
className: "qa-preview-title",
|
|
165
|
+
children: "QA预览"
|
|
166
|
+
}), /* @__PURE__ */ e(D, {
|
|
167
|
+
children: ne && /* @__PURE__ */ e(me, {
|
|
168
|
+
indicator: /* @__PURE__ */ e(fe, {
|
|
169
|
+
spin: !0,
|
|
170
|
+
style: {
|
|
171
|
+
fontSize: 16
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
})]
|
|
176
|
+
}), /* @__PURE__ */ e("div", {
|
|
177
|
+
className: "qa-preview-content",
|
|
178
|
+
children: (() => {
|
|
179
|
+
var z, E;
|
|
180
|
+
const f = ((z = te[0]) == null ? void 0 : z.qas) || [];
|
|
181
|
+
return !(((E = i == null ? void 0 : i.labels) == null ? void 0 : E.length) > 0) || f.length === 0 ? /* @__PURE__ */ e("div", {
|
|
182
|
+
className: "result-empty",
|
|
183
|
+
children: "暂无结果"
|
|
184
|
+
}) : /* @__PURE__ */ l(b, {
|
|
185
|
+
children: [/* @__PURE__ */ e(ue, {
|
|
186
|
+
activeKey: String(R),
|
|
187
|
+
onChange: (o) => O(Number(o)),
|
|
188
|
+
items: f.map((o, K) => ({
|
|
189
|
+
key: String(K),
|
|
190
|
+
label: o.name || `模版${K + 1}`
|
|
191
|
+
}))
|
|
192
|
+
}), /* @__PURE__ */ e("div", {
|
|
193
|
+
className: "qa-preview-result",
|
|
194
|
+
children: (() => {
|
|
195
|
+
const o = f[R];
|
|
196
|
+
return o ? /* @__PURE__ */ l("div", {
|
|
197
|
+
className: "result-item-container",
|
|
198
|
+
children: [/* @__PURE__ */ l("div", {
|
|
199
|
+
className: "result-item-content",
|
|
200
|
+
children: [/* @__PURE__ */ e("div", {
|
|
201
|
+
className: "label",
|
|
202
|
+
children: "问题"
|
|
203
|
+
}), /* @__PURE__ */ e("div", {
|
|
204
|
+
className: "value question",
|
|
205
|
+
children: o.q
|
|
206
|
+
})]
|
|
207
|
+
}), /* @__PURE__ */ l("div", {
|
|
208
|
+
className: "result-item-content",
|
|
209
|
+
children: [/* @__PURE__ */ e("div", {
|
|
210
|
+
className: "label",
|
|
211
|
+
children: "回答"
|
|
212
|
+
}), /* @__PURE__ */ e("div", {
|
|
213
|
+
className: "value answer",
|
|
214
|
+
children: o.a
|
|
215
|
+
})]
|
|
216
|
+
})]
|
|
217
|
+
}) : /* @__PURE__ */ e("div", {
|
|
218
|
+
className: "result-empty",
|
|
219
|
+
children: "暂无结果"
|
|
220
|
+
});
|
|
221
|
+
})()
|
|
222
|
+
})]
|
|
223
|
+
});
|
|
224
|
+
})()
|
|
225
|
+
})]
|
|
226
|
+
}), /* @__PURE__ */ e("div", {
|
|
227
|
+
className: "qa-preview-collapsed",
|
|
228
|
+
children: /* @__PURE__ */ e(he, {
|
|
229
|
+
onClick: () => j(!1)
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
}), !S && /* @__PURE__ */ e("div", {
|
|
233
|
+
className: "qa-preview-collapsed",
|
|
234
|
+
children: /* @__PURE__ */ e(ve, {
|
|
235
|
+
onClick: () => j(!0)
|
|
236
|
+
})
|
|
237
|
+
}), /* @__PURE__ */ e(C, {
|
|
238
|
+
className: "select-next",
|
|
239
|
+
icon: /* @__PURE__ */ e($, {
|
|
240
|
+
type: "icon-youjiantou"
|
|
241
|
+
}),
|
|
242
|
+
type: "text",
|
|
243
|
+
disabled: !p,
|
|
244
|
+
onClick: () => P()
|
|
245
|
+
})]
|
|
246
|
+
})
|
|
247
|
+
}), /* @__PURE__ */ e("div", {
|
|
248
|
+
className: "vlm-mark-action",
|
|
249
|
+
children: /* @__PURE__ */ l(D, {
|
|
250
|
+
children: [/* @__PURE__ */ e(C, {
|
|
251
|
+
type: "primary",
|
|
252
|
+
onClick: re,
|
|
253
|
+
children: "标注"
|
|
254
|
+
}), A && A.delete && /* @__PURE__ */ e(C, {
|
|
255
|
+
danger: !0,
|
|
256
|
+
type: "ghost",
|
|
257
|
+
onClick: de,
|
|
258
|
+
children: "删除数据"
|
|
259
|
+
})]
|
|
260
|
+
})
|
|
261
|
+
})]
|
|
262
|
+
}) : (
|
|
263
|
+
// 标注模式:使用VLMDetail组件
|
|
264
|
+
V && /* @__PURE__ */ e(Ne, {
|
|
265
|
+
ref: w,
|
|
266
|
+
visible: s,
|
|
267
|
+
selectSampleId: Y,
|
|
268
|
+
datasetId: t,
|
|
269
|
+
versionId: a,
|
|
270
|
+
onClose: () => {
|
|
271
|
+
L();
|
|
272
|
+
},
|
|
273
|
+
onSave: V,
|
|
274
|
+
externalFilterMode: J,
|
|
275
|
+
onFilterModeChange: W,
|
|
276
|
+
externalSamples: X,
|
|
277
|
+
externalPagination: Z,
|
|
278
|
+
externalCurrentIndex: _
|
|
143
279
|
})
|
|
144
|
-
|
|
280
|
+
)
|
|
145
281
|
});
|
|
146
282
|
};
|
|
147
283
|
export {
|
|
148
|
-
|
|
284
|
+
Qe as default
|
|
149
285
|
};
|