@glodon-aiot/dataset-annotation 3.24.0-alpha.4 → 3.24.0-alpha.5
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/DetectionAnnotation/index.mjs +210 -210
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +33 -33
- package/dist/es/components/OcrAnnotation/index.mjs +170 -170
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +83 -83
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var g = (f, p, l) => new Promise((w, o) => {
|
|
2
|
+
var M = (a) => {
|
|
3
3
|
try {
|
|
4
|
-
h(
|
|
5
|
-
} catch (
|
|
6
|
-
o(
|
|
4
|
+
h(l.next(a));
|
|
5
|
+
} catch (s) {
|
|
6
|
+
o(s);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, k = (a) => {
|
|
9
9
|
try {
|
|
10
|
-
h(
|
|
11
|
-
} catch (
|
|
12
|
-
o(
|
|
10
|
+
h(l.throw(a));
|
|
11
|
+
} catch (s) {
|
|
12
|
+
o(s);
|
|
13
13
|
}
|
|
14
|
-
}, h = (a) => a.done ?
|
|
15
|
-
h((
|
|
14
|
+
}, h = (a) => a.done ? w(a.value) : Promise.resolve(a.value).then(M, k);
|
|
15
|
+
h((l = l.apply(f, p)).next());
|
|
16
16
|
});
|
|
17
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
18
|
-
import { useRef as Y, useState as m, useContext as we, useEffect as
|
|
19
|
-
import { Modal as Z, Button as v, Space as _, Spin as ke, Tabs as
|
|
17
|
+
import { jsx as e, jsxs as r, Fragment as y } from "react/jsx-runtime";
|
|
18
|
+
import { useRef as Y, useState as m, useContext as we, useEffect as V, useCallback as Me } from "react";
|
|
19
|
+
import { Modal as Z, Button as v, Space as _, Spin as ke, Tabs as be, message as ee } from "antd";
|
|
20
20
|
import "./style.less.mjs";
|
|
21
21
|
import { useKeyPress as ie } from "ahooks";
|
|
22
|
-
import { LoadingOutlined as
|
|
22
|
+
import { LoadingOutlined as xe, MenuUnfoldOutlined as Ie, MenuFoldOutlined as qe } from "@ant-design/icons";
|
|
23
23
|
import Ve from "../../../DatasetContext/index.mjs";
|
|
24
24
|
import Qe from "../../VLMAnnotation/index.mjs";
|
|
25
25
|
import Ae from "../../VQAAnnotation/VQAAnnotationPanel.mjs";
|
|
@@ -29,37 +29,37 @@ const Xe = (f) => {
|
|
|
29
29
|
var z, K, U, B, X, G, S, $;
|
|
30
30
|
const {
|
|
31
31
|
vlmMarkTmpl: p,
|
|
32
|
-
isVlmModalVisible:
|
|
33
|
-
setIsVlmModalVisible:
|
|
32
|
+
isVlmModalVisible: l,
|
|
33
|
+
setIsVlmModalVisible: w,
|
|
34
34
|
record: o,
|
|
35
|
-
onNextClick:
|
|
36
|
-
onPrevClick:
|
|
35
|
+
onNextClick: M,
|
|
36
|
+
onPrevClick: k,
|
|
37
37
|
listLoading: h = !1,
|
|
38
38
|
datasetId: a,
|
|
39
|
-
versionId:
|
|
39
|
+
versionId: s,
|
|
40
40
|
handleMarkClick: ae,
|
|
41
41
|
updateSampleList: te,
|
|
42
|
-
filterMode:
|
|
43
|
-
onFilterModeChange:
|
|
42
|
+
filterMode: le = "",
|
|
43
|
+
onFilterModeChange: se,
|
|
44
44
|
samples: oe,
|
|
45
|
-
onSave:
|
|
45
|
+
onSave: Q,
|
|
46
46
|
selectSampleId: re,
|
|
47
|
-
onClose:
|
|
47
|
+
onClose: A,
|
|
48
48
|
pagination: de,
|
|
49
49
|
currentIndex: ce
|
|
50
|
-
} = f, me = Y({}),
|
|
50
|
+
} = f, me = Y({}), b = Y(null), [i, fe] = m(), [ue, L] = m(!1), [c, x] = m(f.initialMode || "preview"), [ve, I] = m([]), [T, E] = m(0), [he, R] = m(!1), [O, q] = m(!0), [P, j] = m(!1), {
|
|
51
51
|
services: {
|
|
52
52
|
cvforceDatahub: d
|
|
53
53
|
},
|
|
54
54
|
featuresConfig: {
|
|
55
|
-
datasetManager:
|
|
55
|
+
datasetManager: N
|
|
56
56
|
} = {
|
|
57
57
|
datasetManager: !1
|
|
58
58
|
}
|
|
59
|
-
} = we(Ve),
|
|
60
|
-
|
|
59
|
+
} = we(Ve), C = !(ue || h), D = () => {
|
|
60
|
+
C && k();
|
|
61
61
|
}, F = () => {
|
|
62
|
-
|
|
62
|
+
C && M();
|
|
63
63
|
};
|
|
64
64
|
ie("rightarrow", (t) => {
|
|
65
65
|
if (c === "annotation")
|
|
@@ -73,48 +73,48 @@ const Xe = (f) => {
|
|
|
73
73
|
(n == null ? void 0 : n.tagName) === "INPUT" || (n == null ? void 0 : n.tagName) === "TEXTAREA" || n != null && n.isContentEditable || D();
|
|
74
74
|
});
|
|
75
75
|
const pe = p === "VQA";
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, [
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
76
|
+
V(() => {
|
|
77
|
+
l ? f.initialMode && x(f.initialMode) : x("preview");
|
|
78
|
+
}, [l, f.initialMode]), V(() => {
|
|
79
|
+
if (l && a && s && c === "preview") {
|
|
80
|
+
if (L(!0), !(o != null && o.id))
|
|
81
81
|
return;
|
|
82
|
-
d == null || d.getDatasetsIdVersionsVidSsamplesSid(a,
|
|
82
|
+
d == null || d.getDatasetsIdVersionsVidSsamplesSid(a, s, o.id).then((t) => {
|
|
83
83
|
fe(t);
|
|
84
|
-
}).finally(() =>
|
|
84
|
+
}).finally(() => L(!1));
|
|
85
85
|
}
|
|
86
|
-
}, [
|
|
87
|
-
const Ne = Me(() =>
|
|
88
|
-
if (!(!a || !
|
|
89
|
-
|
|
86
|
+
}, [l, o, c]);
|
|
87
|
+
const Ne = Me(() => g(void 0, null, function* () {
|
|
88
|
+
if (!(!a || !s || !(i != null && i.id))) {
|
|
89
|
+
R(!0);
|
|
90
90
|
try {
|
|
91
|
-
const t = yield d == null ? void 0 : d.postGenerateVlmKieQa(a,
|
|
91
|
+
const t = yield d == null ? void 0 : d.postGenerateVlmKieQa(a, s, {
|
|
92
92
|
sampleIds: [i.id]
|
|
93
93
|
});
|
|
94
|
-
|
|
94
|
+
I(t || []), E(0);
|
|
95
95
|
} catch (t) {
|
|
96
|
-
console.error("QA生成失败", t),
|
|
96
|
+
console.error("QA生成失败", t), I([]);
|
|
97
97
|
} finally {
|
|
98
|
-
|
|
98
|
+
R(!1);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
}), [a,
|
|
102
|
-
|
|
103
|
-
if (!
|
|
101
|
+
}), [a, s, i]);
|
|
102
|
+
V(() => {
|
|
103
|
+
if (!l || c !== "preview" || !(i != null && i.id))
|
|
104
104
|
return;
|
|
105
105
|
if (((i == null ? void 0 : i.labels) || []).length)
|
|
106
|
-
|
|
106
|
+
j(!1), Ne();
|
|
107
107
|
else {
|
|
108
|
-
|
|
108
|
+
I([]), q(!1), j(!0);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
}, [i]);
|
|
112
|
-
const Ce = () =>
|
|
113
|
-
if (c === "annotation" &&
|
|
114
|
-
yield
|
|
112
|
+
const Ce = () => g(void 0, null, function* () {
|
|
113
|
+
if (c === "annotation" && b.current) {
|
|
114
|
+
yield b.current.handleModalCancel();
|
|
115
115
|
return;
|
|
116
116
|
} else
|
|
117
|
-
|
|
117
|
+
A();
|
|
118
118
|
}), ge = () => {
|
|
119
119
|
x("annotation"), ae((i == null ? void 0 : i.id) || (o == null ? void 0 : o.id));
|
|
120
120
|
}, ye = () => {
|
|
@@ -122,8 +122,8 @@ const Xe = (f) => {
|
|
|
122
122
|
title: "确认要删除此数据吗?",
|
|
123
123
|
content: "删除后不可恢复,请慎重操作",
|
|
124
124
|
onOk: () => {
|
|
125
|
-
!a || !
|
|
126
|
-
ee.success("删除成功"),
|
|
125
|
+
!a || !s || !(i != null && i.id) || d == null || d.delDatasetsIdVersionsVidSamplesId(a, s, i.id).then(() => {
|
|
126
|
+
ee.success("删除成功"), w(!1), te();
|
|
127
127
|
}).catch(() => ee.error("删除失败"));
|
|
128
128
|
}
|
|
129
129
|
});
|
|
@@ -138,13 +138,13 @@ const Xe = (f) => {
|
|
|
138
138
|
width: "100%",
|
|
139
139
|
wrapClassName: "vlm-modal-wrap",
|
|
140
140
|
className: "vlm-modal",
|
|
141
|
-
open:
|
|
141
|
+
open: l,
|
|
142
142
|
destroyOnClose: !0,
|
|
143
143
|
onCancel: () => Ce(),
|
|
144
144
|
maskClosable: !1,
|
|
145
145
|
centered: !0,
|
|
146
146
|
footer: null,
|
|
147
|
-
children: c === "preview" ? /* @__PURE__ */ r(
|
|
147
|
+
children: c === "preview" ? /* @__PURE__ */ r(y, {
|
|
148
148
|
children: [/* @__PURE__ */ e("div", {
|
|
149
149
|
className: "vlm-detail",
|
|
150
150
|
children: /* @__PURE__ */ r("div", {
|
|
@@ -155,7 +155,7 @@ const Xe = (f) => {
|
|
|
155
155
|
type: "icon-zuojiantou"
|
|
156
156
|
}),
|
|
157
157
|
type: "text",
|
|
158
|
-
disabled: !
|
|
158
|
+
disabled: !C,
|
|
159
159
|
onClick: () => D()
|
|
160
160
|
}), /* @__PURE__ */ e("div", {
|
|
161
161
|
className: "select-main",
|
|
@@ -165,7 +165,7 @@ const Xe = (f) => {
|
|
|
165
165
|
labelDefinitions: [],
|
|
166
166
|
hideRightSide: !0,
|
|
167
167
|
readOnly: !0,
|
|
168
|
-
ocrRecognize: () =>
|
|
168
|
+
ocrRecognize: () => g(void 0, null, function* () {
|
|
169
169
|
return [];
|
|
170
170
|
})
|
|
171
171
|
})
|
|
@@ -176,8 +176,8 @@ const Xe = (f) => {
|
|
|
176
176
|
answer: ($ = (S = (G = (X = i == null ? void 0 : i.content) == null ? void 0 : X.conversations) == null ? void 0 : G[1]) == null ? void 0 : S.value) != null ? $ : "",
|
|
177
177
|
readOnly: !0
|
|
178
178
|
})
|
|
179
|
-
}) : /* @__PURE__ */ r(
|
|
180
|
-
children: [
|
|
179
|
+
}) : /* @__PURE__ */ r(y, {
|
|
180
|
+
children: [O && /* @__PURE__ */ r(y, {
|
|
181
181
|
children: [/* @__PURE__ */ r("div", {
|
|
182
182
|
className: "qa-preview-container",
|
|
183
183
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -187,7 +187,7 @@ const Xe = (f) => {
|
|
|
187
187
|
children: "QA预览"
|
|
188
188
|
}), /* @__PURE__ */ e(_, {
|
|
189
189
|
children: he && /* @__PURE__ */ e(ke, {
|
|
190
|
-
indicator: /* @__PURE__ */ e(
|
|
190
|
+
indicator: /* @__PURE__ */ e(xe, {
|
|
191
191
|
spin: !0,
|
|
192
192
|
style: {
|
|
193
193
|
fontSize: 16
|
|
@@ -203,10 +203,10 @@ const Xe = (f) => {
|
|
|
203
203
|
return !(((J = i == null ? void 0 : i.labels) == null ? void 0 : J.length) > 0) || t.length === 0 ? /* @__PURE__ */ e("div", {
|
|
204
204
|
className: "result-empty",
|
|
205
205
|
children: "暂无结果"
|
|
206
|
-
}) : /* @__PURE__ */ r(
|
|
207
|
-
children: [/* @__PURE__ */ e(
|
|
208
|
-
activeKey: String(
|
|
209
|
-
onChange: (u) =>
|
|
206
|
+
}) : /* @__PURE__ */ r(y, {
|
|
207
|
+
children: [/* @__PURE__ */ e(be, {
|
|
208
|
+
activeKey: String(T),
|
|
209
|
+
onChange: (u) => E(Number(u)),
|
|
210
210
|
items: t.map((u, W) => ({
|
|
211
211
|
key: String(W),
|
|
212
212
|
label: u.name || `模版${W + 1}`
|
|
@@ -214,7 +214,7 @@ const Xe = (f) => {
|
|
|
214
214
|
}), /* @__PURE__ */ e("div", {
|
|
215
215
|
className: "qa-preview-result",
|
|
216
216
|
children: (() => {
|
|
217
|
-
const u = t[
|
|
217
|
+
const u = t[T];
|
|
218
218
|
return u ? /* @__PURE__ */ r("div", {
|
|
219
219
|
className: "result-item-container",
|
|
220
220
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -250,17 +250,17 @@ const Xe = (f) => {
|
|
|
250
250
|
children: /* @__PURE__ */ e(v, {
|
|
251
251
|
type: "link",
|
|
252
252
|
icon: /* @__PURE__ */ e(Ie, {}),
|
|
253
|
-
disabled:
|
|
254
|
-
onClick: () =>
|
|
253
|
+
disabled: P,
|
|
254
|
+
onClick: () => q(!1)
|
|
255
255
|
})
|
|
256
256
|
})]
|
|
257
|
-
}), !
|
|
257
|
+
}), !O && /* @__PURE__ */ e("div", {
|
|
258
258
|
className: "qa-preview-collapsed",
|
|
259
259
|
children: /* @__PURE__ */ e(v, {
|
|
260
260
|
type: "link",
|
|
261
261
|
icon: /* @__PURE__ */ e(qe, {}),
|
|
262
|
-
disabled:
|
|
263
|
-
onClick: () =>
|
|
262
|
+
disabled: P,
|
|
263
|
+
onClick: () => q(!0)
|
|
264
264
|
})
|
|
265
265
|
})]
|
|
266
266
|
}), /* @__PURE__ */ e(v, {
|
|
@@ -269,18 +269,18 @@ const Xe = (f) => {
|
|
|
269
269
|
type: "icon-youjiantou"
|
|
270
270
|
}),
|
|
271
271
|
type: "text",
|
|
272
|
-
disabled: !
|
|
272
|
+
disabled: !C,
|
|
273
273
|
onClick: () => F()
|
|
274
274
|
})]
|
|
275
275
|
})
|
|
276
276
|
}), /* @__PURE__ */ e("div", {
|
|
277
277
|
className: "vlm-mark-action",
|
|
278
278
|
children: /* @__PURE__ */ r(_, {
|
|
279
|
-
children: [/* @__PURE__ */ e(v, {
|
|
279
|
+
children: [N && N.label && /* @__PURE__ */ e(v, {
|
|
280
280
|
type: "primary",
|
|
281
281
|
onClick: ge,
|
|
282
282
|
children: "标注"
|
|
283
|
-
}),
|
|
283
|
+
}), N && N.delete && /* @__PURE__ */ e(v, {
|
|
284
284
|
danger: !0,
|
|
285
285
|
type: "ghost",
|
|
286
286
|
onClick: ye,
|
|
@@ -290,19 +290,19 @@ const Xe = (f) => {
|
|
|
290
290
|
})]
|
|
291
291
|
}) : (
|
|
292
292
|
// 标注模式:使用VLMDetail组件
|
|
293
|
-
|
|
294
|
-
ref:
|
|
295
|
-
visible:
|
|
293
|
+
Q && /* @__PURE__ */ e(Le, {
|
|
294
|
+
ref: b,
|
|
295
|
+
visible: l,
|
|
296
296
|
selectSampleId: re,
|
|
297
297
|
datasetId: a,
|
|
298
|
-
versionId:
|
|
298
|
+
versionId: s,
|
|
299
299
|
vlmMarkTmpl: p,
|
|
300
300
|
onClose: () => {
|
|
301
|
-
|
|
301
|
+
A();
|
|
302
302
|
},
|
|
303
|
-
onSave:
|
|
304
|
-
externalFilterMode:
|
|
305
|
-
onFilterModeChange:
|
|
303
|
+
onSave: Q,
|
|
304
|
+
externalFilterMode: le,
|
|
305
|
+
onFilterModeChange: se,
|
|
306
306
|
externalSamples: oe,
|
|
307
307
|
externalPagination: de,
|
|
308
308
|
externalCurrentIndex: ce
|