@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.7
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/ClassificationAnnotation/index.mjs +374 -325
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +82 -78
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +28 -26
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +173 -166
- package/dist/es/components/DetectionAnnotation/index.mjs +478 -473
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +249 -230
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +103 -98
- package/dist/es/components/OcrAnnotation/index.mjs +281 -248
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +277 -272
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +42 -40
- package/dist/es/components/VLMAnnotationDetail/index.mjs +331 -278
- package/dist/es/index.mjs +1 -1
- package/dist/es/utils/checkVlmSampleLabeled.mjs +7 -0
- package/dist/es/utils/scrollSampleIntoView.mjs +16 -0
- package/dist/lib/index.js +4 -4
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -0
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +2 -0
- package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +2 -0
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +6 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +5 -0
- package/dist/src/utils/checkVlmSampleLabeled.d.ts +8 -0
- package/dist/src/utils/scrollSampleIntoView.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1,98 +1,99 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Be = Object.defineProperty, Ee = Object.defineProperties;
|
|
2
|
+
var Ue = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var he = Object.getOwnPropertySymbols;
|
|
4
|
+
var $e = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var pe = (b, l, i) => l in b ? Be(b, l, { enumerable: !0, configurable: !0, writable: !0, value: i }) : b[l] = i, h = (b, l) => {
|
|
6
6
|
for (var i in l || (l = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, g = (
|
|
13
|
-
import { jsx as c, jsxs as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { message as
|
|
16
|
-
import
|
|
7
|
+
$e.call(l, i) && pe(b, i, l[i]);
|
|
8
|
+
if (he)
|
|
9
|
+
for (var i of he(l))
|
|
10
|
+
Ze.call(l, i) && pe(b, i, l[i]);
|
|
11
|
+
return b;
|
|
12
|
+
}, g = (b, l) => Ee(b, Ue(l));
|
|
13
|
+
import { jsx as c, jsxs as T } from "react/jsx-runtime";
|
|
14
|
+
import { useState as d, useRef as X, useEffect as C } from "react";
|
|
15
|
+
import { message as B, ConfigProvider as je, Space as w, Select as qe, Dropdown as We, Tooltip as _e, Button as Y, Tabs as He, Row as Je, Col as Qe, Pagination as Ge, Modal as Xe } from "antd";
|
|
16
|
+
import Ye from "antd/es/locale/zh_CN";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { UploadZipsStatus as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { DEFAULT_FILTER_SWITCH as
|
|
29
|
-
import
|
|
30
|
-
import { DownOutlined as
|
|
31
|
-
import
|
|
32
|
-
|
|
18
|
+
import et from "./OcrModal/index.mjs";
|
|
19
|
+
import tt from "./MarkKVOCRModal/index.mjs";
|
|
20
|
+
import nt from "./MarkOCRBoxModal/index.mjs";
|
|
21
|
+
import rt from "./PreLabelOCR/index.mjs";
|
|
22
|
+
import ot from "lodash/merge";
|
|
23
|
+
import { UploadZipsStatus as ge, PreLabelTaskStatus as it } from "@glodon-aiot/apis";
|
|
24
|
+
import ct from "../../Common/Page/index.mjs";
|
|
25
|
+
import lt from "../Thumbnail/index.mjs";
|
|
26
|
+
import at from "../DataEmpty/index.mjs";
|
|
27
|
+
import st from "../../DatasetContext/index.mjs";
|
|
28
|
+
import { DEFAULT_FILTER_SWITCH as dt } from "../../constant.mjs";
|
|
29
|
+
import ut from "../PageNav/index.mjs";
|
|
30
|
+
import { DownOutlined as ft } from "@ant-design/icons";
|
|
31
|
+
import mt from "../DetectionStatus/index.mjs";
|
|
32
|
+
import { scrollSampleIntoView as ht } from "../../utils/scrollSampleIntoView.mjs";
|
|
33
|
+
const At = (b) => {
|
|
33
34
|
const {
|
|
34
35
|
services: l,
|
|
35
36
|
datasetId: i,
|
|
36
|
-
versionId:
|
|
37
|
-
backTo:
|
|
38
|
-
labelManager:
|
|
39
|
-
datasetManager:
|
|
40
|
-
annotation:
|
|
37
|
+
versionId: E,
|
|
38
|
+
backTo: be,
|
|
39
|
+
labelManager: Ce = !1,
|
|
40
|
+
datasetManager: v = !1,
|
|
41
|
+
annotation: ke,
|
|
41
42
|
header: p = {
|
|
42
43
|
versionSelect: !1
|
|
43
44
|
},
|
|
44
|
-
exampleSrcRoot:
|
|
45
|
-
} =
|
|
45
|
+
exampleSrcRoot: Se
|
|
46
|
+
} = b, U = !!(v && v.label), [o, xe] = d(), [t, $] = d(), [V, Me] = d([]), [ee, te] = d(!1), [x, L] = d(!1), [I, ne] = d(0), [u, P] = d(), [m, k] = d(), [re, O] = d(), [Z, y] = d(-1), oe = X(null), N = X(void 0), D = X(!1), [f, M] = d({
|
|
46
47
|
current: 1,
|
|
47
48
|
pageSize: 50
|
|
48
|
-
}), [
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
O(void 0), (
|
|
52
|
-
},
|
|
53
|
-
|
|
49
|
+
}), [z, ie] = d(0), [A, ce] = d(0), [S, j] = d(""), [le, q] = d(!1), [ae, se] = d(), [W, de] = d(!1), [K, _] = d(null), [Te, ue] = d(!1), [Ie, ye] = d(!1), [H, De] = d(""), [J, F] = d("preview"), Q = h({}, dt);
|
|
50
|
+
ot(Q, b.filterSwitch);
|
|
51
|
+
const we = () => {
|
|
52
|
+
O(void 0), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? q(!0) : (F("annotation"), L(!0), j("nocode"));
|
|
53
|
+
}, ve = (e, n) => {
|
|
54
|
+
M({
|
|
54
55
|
current: e,
|
|
55
56
|
pageSize: n
|
|
56
57
|
});
|
|
57
|
-
},
|
|
58
|
+
}, Re = (e) => {
|
|
58
59
|
if (!u)
|
|
59
60
|
return;
|
|
60
|
-
|
|
61
|
+
y(e);
|
|
61
62
|
const n = u[e];
|
|
62
|
-
|
|
63
|
+
k(n), F("preview"), L(!0);
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
-
i && (
|
|
65
|
+
C(() => {
|
|
66
|
+
i && (te(!0), Promise.all([
|
|
66
67
|
// 数据集
|
|
67
68
|
l.cvforceDatahub.getDatasetsId(i).then((e) => {
|
|
68
|
-
|
|
69
|
+
xe(e);
|
|
69
70
|
}),
|
|
70
71
|
// 版本列表
|
|
71
72
|
l.cvforceDatahub.getDatasetsIdVersions(i, 1, 1e3).then((e) => {
|
|
72
|
-
|
|
73
|
+
Me(e.recordList), $(E ? e.recordList.find((n) => n.id === E) : e.recordList[0]);
|
|
73
74
|
})
|
|
74
|
-
]).finally(() =>
|
|
75
|
-
}, [i,
|
|
76
|
-
const
|
|
75
|
+
]).finally(() => te(!1)));
|
|
76
|
+
}, [i, E]);
|
|
77
|
+
const Ve = () => {
|
|
77
78
|
!i || !t || l.cvforceDatahub.getDatasetsIdVersionsVid(i, t.id).then((e) => {
|
|
78
|
-
|
|
79
|
+
De(e.versionAsyncTask.state);
|
|
79
80
|
});
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}, [i, t == null ? void 0 : t.id]),
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
const
|
|
82
|
+
C(() => {
|
|
83
|
+
Ve();
|
|
84
|
+
}, [i, t == null ? void 0 : t.id]), C(() => {
|
|
85
|
+
H !== ge.Pending && H !== ge.Started || B.warning("文件导入中,请刷新页面再试");
|
|
86
|
+
}, [H]);
|
|
87
|
+
const fe = () => {
|
|
87
88
|
!i || !t || l.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(i, t.id, {
|
|
88
89
|
label: "allcode",
|
|
89
90
|
confirmStatus: 2
|
|
90
91
|
}).then((e) => {
|
|
91
|
-
const n = e.find((
|
|
92
|
-
|
|
92
|
+
const n = e.find((s) => s.id === "allcodeid"), r = e.find((s) => s.id === "nocodeid"), a = e.find((s) => s.id === "pendingid");
|
|
93
|
+
ne(n ? n.count : 0), ie(r ? r.count : 0), ce(a ? a.count : 0);
|
|
93
94
|
});
|
|
94
|
-
},
|
|
95
|
-
switch (
|
|
95
|
+
}, Le = () => {
|
|
96
|
+
switch (S) {
|
|
96
97
|
case "nocode":
|
|
97
98
|
case "hascode":
|
|
98
99
|
return 0;
|
|
@@ -101,8 +102,8 @@ const Vt = (h) => {
|
|
|
101
102
|
default:
|
|
102
103
|
return 2;
|
|
103
104
|
}
|
|
104
|
-
},
|
|
105
|
-
switch (
|
|
105
|
+
}, Pe = () => {
|
|
106
|
+
switch (S) {
|
|
106
107
|
case "nocode":
|
|
107
108
|
return "nocode";
|
|
108
109
|
case "pending":
|
|
@@ -112,198 +113,225 @@ const Vt = (h) => {
|
|
|
112
113
|
default:
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
|
-
},
|
|
116
|
-
const e =
|
|
117
|
-
!i || !t
|
|
118
|
-
|
|
116
|
+
}, R = () => {
|
|
117
|
+
const e = f.current || 1, n = f.pageSize || 50;
|
|
118
|
+
if (!i || !t) {
|
|
119
|
+
D.current = !1;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
l.cvforceDatahub.getDatasetsIdVersionsVidSamples(i, t.id, {
|
|
123
|
+
labels: Pe(),
|
|
119
124
|
pageNo: e,
|
|
120
125
|
pageSize: n,
|
|
121
|
-
confirmStatus:
|
|
122
|
-
}).then((
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
125
|
-
|
|
126
|
-
current: Math.ceil(
|
|
127
|
-
})), Math.ceil(
|
|
126
|
+
confirmStatus: Le()
|
|
127
|
+
}).then((r) => {
|
|
128
|
+
const a = r.recordList || [];
|
|
129
|
+
if (!a.length && r.totalResults > 0) {
|
|
130
|
+
M((s) => g(h({}, s), {
|
|
131
|
+
current: Math.ceil(r.totalResults / n)
|
|
132
|
+
})), Math.ceil(r.totalResults / n) === e && P([]);
|
|
128
133
|
return;
|
|
129
134
|
}
|
|
130
|
-
if (P(
|
|
131
|
-
total:
|
|
132
|
-
})),
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
135
|
+
if (P(a), M((s) => g(h({}, s), {
|
|
136
|
+
total: r.totalResults
|
|
137
|
+
})), f.type === "next" && a.length) {
|
|
138
|
+
y(0);
|
|
139
|
+
const s = r.recordList[0];
|
|
140
|
+
k(s);
|
|
136
141
|
}
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
142
|
+
if (f.type === "prev" && a.length) {
|
|
143
|
+
y(f.pageSize - 1);
|
|
144
|
+
const s = r.recordList[f.pageSize - 1];
|
|
145
|
+
k(s);
|
|
141
146
|
}
|
|
142
|
-
})
|
|
147
|
+
}).finally(() => {
|
|
148
|
+
D.current = !1;
|
|
149
|
+
}), fe();
|
|
143
150
|
};
|
|
144
|
-
|
|
145
|
-
const
|
|
151
|
+
C(R, [f.current, f.pageSize, S, ae, t == null ? void 0 : t.id, i]);
|
|
152
|
+
const Oe = () => {
|
|
146
153
|
if (!u)
|
|
147
154
|
return;
|
|
148
|
-
const e =
|
|
155
|
+
const e = Z + 1;
|
|
149
156
|
if (e >= u.length) {
|
|
150
|
-
let n =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
let n = I;
|
|
158
|
+
if (S === "hascode" && (n = I - z - A), S === "nocode" && (n = z), S === "pending" && (n = A), (f.current - 1) * f.pageSize + e >= n)
|
|
159
|
+
B.error("已经是最后一个了");
|
|
160
|
+
else {
|
|
161
|
+
if (D.current)
|
|
162
|
+
return;
|
|
163
|
+
D.current = !0, M((a) => g(h({}, a), {
|
|
164
|
+
current: a.current + 1,
|
|
165
|
+
type: "next"
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
156
168
|
} else {
|
|
157
|
-
|
|
169
|
+
y(e);
|
|
158
170
|
const n = u[e];
|
|
159
|
-
|
|
171
|
+
k(n);
|
|
160
172
|
}
|
|
161
|
-
},
|
|
173
|
+
}, Ne = () => {
|
|
162
174
|
if (!u)
|
|
163
175
|
return;
|
|
164
|
-
const e =
|
|
176
|
+
const e = Z - 1;
|
|
165
177
|
if (e < 0)
|
|
166
|
-
(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
178
|
+
if ((f.current - 1) * f.pageSize + e < 0)
|
|
179
|
+
B.error("已经是第一个了");
|
|
180
|
+
else {
|
|
181
|
+
if (D.current)
|
|
182
|
+
return;
|
|
183
|
+
D.current = !0, M((r) => g(h({}, r), {
|
|
184
|
+
current: r.current - 1,
|
|
185
|
+
type: "prev"
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
171
188
|
else {
|
|
172
|
-
|
|
189
|
+
y(e);
|
|
173
190
|
const n = u[e];
|
|
174
|
-
|
|
191
|
+
k(n);
|
|
175
192
|
}
|
|
176
193
|
};
|
|
177
|
-
|
|
194
|
+
C(() => {
|
|
178
195
|
if (!i) {
|
|
179
|
-
|
|
196
|
+
K && (clearTimeout(K), _(null)), se(void 0);
|
|
180
197
|
return;
|
|
181
198
|
}
|
|
182
|
-
|
|
183
|
-
}, [t == null ? void 0 : t.id]),
|
|
184
|
-
|
|
185
|
-
}, [
|
|
186
|
-
const
|
|
199
|
+
G();
|
|
200
|
+
}, [t == null ? void 0 : t.id]), C(() => {
|
|
201
|
+
G();
|
|
202
|
+
}, [Ie]);
|
|
203
|
+
const G = () => {
|
|
187
204
|
!i || !t || l.cvforceDatahub.getPreLabelTask(i, t.id).then((e) => {
|
|
188
205
|
const n = e[0];
|
|
189
|
-
if (
|
|
190
|
-
|
|
206
|
+
if (se(n), K && (clearTimeout(K), _(null)), !(n != null && n.state) || n.state !== it.Started) {
|
|
207
|
+
de(!1);
|
|
191
208
|
return;
|
|
192
209
|
} else
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
210
|
+
de(!0);
|
|
211
|
+
_(setTimeout(() => {
|
|
212
|
+
G();
|
|
196
213
|
}, 1e4));
|
|
197
214
|
});
|
|
198
|
-
},
|
|
215
|
+
}, ze = [{
|
|
199
216
|
key: "",
|
|
200
|
-
label: `全部(${
|
|
217
|
+
label: `全部(${I})`,
|
|
201
218
|
children: null
|
|
202
219
|
}, {
|
|
203
220
|
key: "nocode",
|
|
204
|
-
label: `未标注(${
|
|
221
|
+
label: `未标注(${z})`,
|
|
205
222
|
children: null
|
|
206
223
|
}, {
|
|
207
224
|
key: "pending",
|
|
208
|
-
label: `待确认(${
|
|
225
|
+
label: `待确认(${A})`,
|
|
209
226
|
children: null
|
|
210
227
|
}, {
|
|
211
228
|
key: "hascode",
|
|
212
|
-
label: `已标注(${
|
|
229
|
+
label: `已标注(${I - z - A})`,
|
|
213
230
|
children: null
|
|
214
231
|
}];
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
}, [
|
|
218
|
-
|
|
232
|
+
C(() => {
|
|
233
|
+
!x || !(m != null && m.id) || (N.current = m.id);
|
|
234
|
+
}, [x, m == null ? void 0 : m.id]), C(() => {
|
|
235
|
+
const e = N.current;
|
|
236
|
+
if (x || !e || !(u != null && u.length))
|
|
237
|
+
return;
|
|
238
|
+
const n = requestAnimationFrame(() => {
|
|
239
|
+
var a;
|
|
240
|
+
ht((a = oe.current) == null ? void 0 : a.querySelector(".d-right"), e) && (N.current = void 0);
|
|
241
|
+
});
|
|
242
|
+
return () => cancelAnimationFrame(n);
|
|
243
|
+
}, [x, u]), C(() => {
|
|
244
|
+
x || ((o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? k(void 0) : (J === "annotation" && R(), k(void 0), y(-1), O(void 0), F("preview")));
|
|
245
|
+
}, [x, J]), C(() => {
|
|
246
|
+
o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
|
|
219
247
|
请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
|
|
220
|
-
}, [
|
|
221
|
-
const
|
|
248
|
+
}, [o]);
|
|
249
|
+
const Ae = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? tt : nt, Ke = () => {
|
|
222
250
|
if (console.log("一键确认", l, t), !(l != null && l.cvforceDatahub) || !(t != null && t.id))
|
|
223
251
|
return Promise.resolve(!1);
|
|
224
|
-
|
|
252
|
+
Xe.confirm({
|
|
225
253
|
title: "一键保存所有标注?",
|
|
226
254
|
content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
|
|
227
255
|
onOk: () => {
|
|
228
256
|
l.cvforceDatahub.getAllConfirmSamples(i, t.id).then((e) => {
|
|
229
|
-
|
|
257
|
+
B.success("保存成功"), M(g(h({}, f), {
|
|
230
258
|
current: 1
|
|
231
|
-
})),
|
|
259
|
+
})), fe(), R();
|
|
232
260
|
});
|
|
233
261
|
}
|
|
234
262
|
});
|
|
235
|
-
},
|
|
236
|
-
return /* @__PURE__ */ c(
|
|
237
|
-
locale:
|
|
238
|
-
children: /* @__PURE__ */ c(
|
|
263
|
+
}, me = !m && !!(v && v.preLabel) && !!(t != null && t.id), Fe = U || me;
|
|
264
|
+
return /* @__PURE__ */ c(je, {
|
|
265
|
+
locale: Ye,
|
|
266
|
+
children: /* @__PURE__ */ c(st.Provider, {
|
|
239
267
|
value: {
|
|
240
268
|
datasetId: i,
|
|
241
269
|
versionId: (t == null ? void 0 : t.id) || "",
|
|
242
270
|
no: (t == null ? void 0 : t.no) || "",
|
|
243
|
-
loading:
|
|
271
|
+
loading: ee,
|
|
244
272
|
version: t,
|
|
245
|
-
versions:
|
|
273
|
+
versions: V,
|
|
246
274
|
samples: u,
|
|
247
|
-
pagination:
|
|
275
|
+
pagination: f,
|
|
248
276
|
services: l,
|
|
249
277
|
featuresConfig: {
|
|
250
|
-
labelManager:
|
|
251
|
-
datasetManager:
|
|
252
|
-
annotation:
|
|
253
|
-
filterSwitch:
|
|
278
|
+
labelManager: Ce,
|
|
279
|
+
datasetManager: v,
|
|
280
|
+
annotation: ke,
|
|
281
|
+
filterSwitch: Q,
|
|
254
282
|
header: p,
|
|
255
|
-
exampleSrcRoot:
|
|
283
|
+
exampleSrcRoot: Se
|
|
256
284
|
}
|
|
257
285
|
},
|
|
258
|
-
children:
|
|
286
|
+
children: o ? o.markType === "ocr" ? /* @__PURE__ */ T("div", {
|
|
259
287
|
className: "ocr-version-detail",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
288
|
+
children: [/* @__PURE__ */ T(ct, {
|
|
261
289
|
className: "product-details-page",
|
|
262
|
-
header: p === !1 ? void 0 : /* @__PURE__ */ c(
|
|
263
|
-
backTo:
|
|
290
|
+
header: p === !1 ? void 0 : /* @__PURE__ */ c(ut, {
|
|
291
|
+
backTo: be,
|
|
264
292
|
onBackClick: p != null && p.onBackClick ? () => {
|
|
265
293
|
p.onBackClick && p.onBackClick();
|
|
266
294
|
} : void 0,
|
|
267
|
-
left: !
|
|
295
|
+
left: !ee && /* @__PURE__ */ T(w, {
|
|
268
296
|
children: [/* @__PURE__ */ c("span", {
|
|
269
297
|
style: {
|
|
270
298
|
fontWeight: "bold"
|
|
271
299
|
},
|
|
272
|
-
children:
|
|
273
|
-
}), /* @__PURE__ */ c(
|
|
300
|
+
children: o == null ? void 0 : o.name
|
|
301
|
+
}), /* @__PURE__ */ c(qe, {
|
|
274
302
|
disabled: (p == null ? void 0 : p.versionSelect) === !1,
|
|
275
303
|
value: t == null ? void 0 : t.id,
|
|
276
304
|
style: {
|
|
277
305
|
width: 70
|
|
278
306
|
},
|
|
279
|
-
options:
|
|
307
|
+
options: V.map((e) => ({
|
|
280
308
|
label: e.no,
|
|
281
309
|
value: e.id
|
|
282
310
|
})),
|
|
283
311
|
onChange: (e) => {
|
|
284
|
-
const n =
|
|
285
|
-
if (!
|
|
312
|
+
const n = V.find((a) => a.id === e);
|
|
313
|
+
if (!o || !n)
|
|
286
314
|
return;
|
|
287
|
-
const
|
|
288
|
-
|
|
315
|
+
const r = V.find((a) => a.id === n.id);
|
|
316
|
+
$(r), p != null && p.onVersionChange && p.onVersionChange(r);
|
|
289
317
|
}
|
|
290
318
|
})]
|
|
291
319
|
}),
|
|
292
|
-
right: /* @__PURE__ */ c(
|
|
293
|
-
children:
|
|
320
|
+
right: /* @__PURE__ */ c(w, {
|
|
321
|
+
children: Fe && /* @__PURE__ */ c(We, {
|
|
294
322
|
menu: {
|
|
295
|
-
items: [...
|
|
323
|
+
items: [...U ? [{
|
|
296
324
|
key: "manual",
|
|
297
|
-
label: /* @__PURE__ */ c(
|
|
298
|
-
children: /* @__PURE__ */ c(
|
|
325
|
+
label: /* @__PURE__ */ c(w, {
|
|
326
|
+
children: /* @__PURE__ */ c(_e, {
|
|
299
327
|
title: "预标注进行中,请任务完成后再试",
|
|
300
|
-
open:
|
|
301
|
-
children: /* @__PURE__ */ c(
|
|
328
|
+
open: Te,
|
|
329
|
+
children: /* @__PURE__ */ c(Y, {
|
|
302
330
|
type: "text",
|
|
303
|
-
disabled: !
|
|
304
|
-
onClick:
|
|
305
|
-
onMouseEnter: () =>
|
|
306
|
-
onMouseLeave: () =>
|
|
331
|
+
disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || W,
|
|
332
|
+
onClick: we,
|
|
333
|
+
onMouseEnter: () => W && ue(!0),
|
|
334
|
+
onMouseLeave: () => ue(!1),
|
|
307
335
|
style: {
|
|
308
336
|
marginRight: "10px"
|
|
309
337
|
},
|
|
@@ -311,71 +339,73 @@ const Vt = (h) => {
|
|
|
311
339
|
})
|
|
312
340
|
})
|
|
313
341
|
})
|
|
314
|
-
}] : [],
|
|
342
|
+
}] : [], me ? {
|
|
315
343
|
key: "auto",
|
|
316
|
-
label: /* @__PURE__ */ c(
|
|
344
|
+
label: /* @__PURE__ */ c(rt, {
|
|
317
345
|
buttonType: "text",
|
|
318
346
|
datasetId: i,
|
|
319
347
|
versionId: (t == null ? void 0 : t.id) || "",
|
|
320
|
-
disabled: !
|
|
321
|
-
setIsTaskChange:
|
|
322
|
-
preLabelTask:
|
|
348
|
+
disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
|
|
349
|
+
setIsTaskChange: ye,
|
|
350
|
+
preLabelTask: ae,
|
|
323
351
|
datasetType: "ocr"
|
|
324
352
|
})
|
|
325
353
|
} : null]
|
|
326
354
|
},
|
|
327
355
|
placement: "bottom",
|
|
328
|
-
children: /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ T(Y, {
|
|
329
357
|
type: "primary",
|
|
330
|
-
children: ["开始标注", /* @__PURE__ */ c(
|
|
358
|
+
children: ["开始标注", /* @__PURE__ */ c(ft, {})]
|
|
331
359
|
})
|
|
332
360
|
})
|
|
333
361
|
})
|
|
334
362
|
}),
|
|
335
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ T("div", {
|
|
336
364
|
className: "ocr-header",
|
|
337
|
-
children: [/* @__PURE__ */ c(
|
|
338
|
-
children:
|
|
365
|
+
children: [/* @__PURE__ */ c(w, {
|
|
366
|
+
children: Q.tabs && /* @__PURE__ */ c(He, {
|
|
339
367
|
className: "header-tab",
|
|
340
|
-
activeKey:
|
|
368
|
+
activeKey: S,
|
|
341
369
|
onChange: (e) => {
|
|
342
|
-
|
|
370
|
+
M(g(h({}, f), {
|
|
343
371
|
current: 1,
|
|
344
372
|
total: 0
|
|
345
|
-
})),
|
|
373
|
+
})), j(e);
|
|
346
374
|
},
|
|
347
|
-
items:
|
|
375
|
+
items: ze
|
|
348
376
|
})
|
|
349
|
-
}), /* @__PURE__ */ c(
|
|
350
|
-
children:
|
|
377
|
+
}), /* @__PURE__ */ c(w, {
|
|
378
|
+
children: S === "pending" && U && /* @__PURE__ */ c(Y, {
|
|
351
379
|
type: "primary",
|
|
352
380
|
className: "pending-confirm-button",
|
|
353
|
-
onClick:
|
|
381
|
+
onClick: Ke,
|
|
354
382
|
children: "一键确认"
|
|
355
383
|
})
|
|
356
384
|
})]
|
|
357
385
|
}), /* @__PURE__ */ c("div", {
|
|
358
386
|
className: "d-row",
|
|
359
|
-
|
|
387
|
+
ref: oe,
|
|
388
|
+
children: u != null && u.length ? /* @__PURE__ */ T(w, {
|
|
360
389
|
direction: "vertical",
|
|
361
390
|
className: "d-right",
|
|
362
|
-
children: [/* @__PURE__ */ c(
|
|
391
|
+
children: [/* @__PURE__ */ c(Je, {
|
|
363
392
|
gutter: [16, 16],
|
|
364
393
|
wrap: !0,
|
|
365
394
|
className: "d-right-row",
|
|
366
|
-
children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(
|
|
395
|
+
children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(Qe, {
|
|
367
396
|
className: "d-right-col",
|
|
368
|
-
|
|
369
|
-
|
|
397
|
+
"data-sample-id": e.id,
|
|
398
|
+
onClick: () => Re(n),
|
|
399
|
+
children: /* @__PURE__ */ T("div", {
|
|
370
400
|
className: "right-col-wrapper",
|
|
371
401
|
children: [/* @__PURE__ */ c("div", {
|
|
372
402
|
className: "detection-status-wrapper",
|
|
373
|
-
children: /* @__PURE__ */ c(
|
|
403
|
+
children: /* @__PURE__ */ c(mt, {
|
|
374
404
|
sample: e
|
|
375
405
|
})
|
|
376
406
|
}), /* @__PURE__ */ c("div", {
|
|
377
407
|
className: "right-col-img",
|
|
378
|
-
children: /* @__PURE__ */ c(
|
|
408
|
+
children: /* @__PURE__ */ c(lt, {
|
|
379
409
|
fileKey: e.fileKey,
|
|
380
410
|
width: 124,
|
|
381
411
|
thumbnailUrl: e.thumbnailUrl
|
|
@@ -388,94 +418,97 @@ const Vt = (h) => {
|
|
|
388
418
|
})]
|
|
389
419
|
})
|
|
390
420
|
}, e.id))
|
|
391
|
-
}), /* @__PURE__ */ c(
|
|
392
|
-
onChange:
|
|
421
|
+
}), /* @__PURE__ */ c(Ge, h({
|
|
422
|
+
onChange: ve,
|
|
393
423
|
className: "d-right-pageination",
|
|
394
424
|
showQuickJumper: !0,
|
|
395
425
|
showSizeChanger: !0
|
|
396
|
-
},
|
|
397
|
-
}) : /* @__PURE__ */ c(
|
|
426
|
+
}, f))]
|
|
427
|
+
}) : /* @__PURE__ */ c(at, {})
|
|
398
428
|
})]
|
|
399
|
-
}),
|
|
400
|
-
mode:
|
|
401
|
-
visible:
|
|
402
|
-
onClose: () =>
|
|
403
|
-
record:
|
|
404
|
-
onNextClick: () =>
|
|
405
|
-
onPrevClick: () =>
|
|
406
|
-
ocrMarkTmpl:
|
|
429
|
+
}), x && /* @__PURE__ */ c(et, {
|
|
430
|
+
mode: J,
|
|
431
|
+
visible: x,
|
|
432
|
+
onClose: () => L(!1),
|
|
433
|
+
record: m,
|
|
434
|
+
onNextClick: () => Oe(),
|
|
435
|
+
onPrevClick: () => Ne(),
|
|
436
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
407
437
|
datasetId: i,
|
|
408
438
|
versionId: t == null ? void 0 : t.id,
|
|
409
439
|
handleMarkClick: (e) => {
|
|
410
|
-
O(e), (
|
|
440
|
+
O(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), q(!0)) : F("annotation");
|
|
411
441
|
},
|
|
412
|
-
updateSampleList:
|
|
413
|
-
isPreLabel:
|
|
414
|
-
selectSampleId:
|
|
442
|
+
updateSampleList: R,
|
|
443
|
+
isPreLabel: W,
|
|
444
|
+
selectSampleId: re,
|
|
415
445
|
onSave: (e) => {
|
|
416
446
|
var n;
|
|
417
447
|
if (!i || !t)
|
|
418
448
|
throw "datasetId or version is not exist.";
|
|
419
|
-
return l.cvforceDatahub.updateSamples(i, t.id, [g(
|
|
420
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
421
|
-
box:
|
|
449
|
+
return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
|
|
450
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
|
|
451
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
422
452
|
}))
|
|
423
|
-
})]).then(() => (u && (
|
|
424
|
-
if (!
|
|
425
|
-
return
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
return
|
|
453
|
+
})]).then(() => (u && (m == null ? void 0 : m.id) === e.id && (P((r) => {
|
|
454
|
+
if (!r)
|
|
455
|
+
return r;
|
|
456
|
+
const a = r.findIndex((s) => s.id === e.id);
|
|
457
|
+
if (a > -1) {
|
|
458
|
+
const s = [...r];
|
|
459
|
+
return s[a] = e, s;
|
|
430
460
|
}
|
|
431
|
-
return
|
|
432
|
-
}),
|
|
461
|
+
return r;
|
|
462
|
+
}), k(e)), !0));
|
|
433
463
|
},
|
|
434
464
|
onPending: (e) => {
|
|
435
465
|
var n;
|
|
436
466
|
if (!i || !t)
|
|
437
467
|
throw "datasetId or version is not exist.";
|
|
438
|
-
return l.cvforceDatahub.updateSamples(i, t.id, [g(
|
|
439
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
440
|
-
box:
|
|
468
|
+
return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
|
|
469
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
|
|
470
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
441
471
|
}))
|
|
442
|
-
})], 1).then(() => (u && (
|
|
443
|
-
if (!
|
|
444
|
-
return
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
return
|
|
472
|
+
})], 1).then(() => (u && (m == null ? void 0 : m.id) === e.id && (P((r) => {
|
|
473
|
+
if (!r)
|
|
474
|
+
return r;
|
|
475
|
+
const a = r.findIndex((s) => s.id === e.id);
|
|
476
|
+
if (a > -1) {
|
|
477
|
+
const s = [...r];
|
|
478
|
+
return s[a] = e, s;
|
|
449
479
|
}
|
|
450
|
-
return
|
|
451
|
-
}),
|
|
480
|
+
return r;
|
|
481
|
+
}), k(e)), !0));
|
|
452
482
|
},
|
|
453
|
-
filterMode:
|
|
483
|
+
filterMode: S,
|
|
454
484
|
onFilterModeChange: (e) => {
|
|
455
|
-
O(void 0),
|
|
485
|
+
O(void 0), j(e);
|
|
456
486
|
},
|
|
457
487
|
onPaginationChange: (e) => {
|
|
458
|
-
|
|
488
|
+
M(e);
|
|
489
|
+
},
|
|
490
|
+
onCurrentSampleChange: (e) => {
|
|
491
|
+
N.current = e;
|
|
459
492
|
},
|
|
460
493
|
samples: u,
|
|
461
|
-
pagination:
|
|
462
|
-
currentIndex:
|
|
463
|
-
}),
|
|
464
|
-
visible:
|
|
465
|
-
selectSampleId:
|
|
466
|
-
ocrMarkTmpl:
|
|
494
|
+
pagination: f,
|
|
495
|
+
currentIndex: Z
|
|
496
|
+
}), le && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(Ae, {
|
|
497
|
+
visible: le,
|
|
498
|
+
selectSampleId: re,
|
|
499
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
467
500
|
datasetId: i,
|
|
468
501
|
versionId: t.id,
|
|
469
|
-
onClose: () =>
|
|
502
|
+
onClose: () => q(!1),
|
|
470
503
|
onSave: (e) => {
|
|
471
504
|
var n;
|
|
472
505
|
if (!i || !t)
|
|
473
506
|
throw "datasetId or version is not exist.";
|
|
474
|
-
return l.cvforceDatahub.updateSamples(i, t.id, [g(
|
|
475
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
476
|
-
box:
|
|
507
|
+
return l.cvforceDatahub.updateSamples(i, t.id, [g(h({}, e), {
|
|
508
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(h({}, r), {
|
|
509
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
477
510
|
}))
|
|
478
|
-
})]).then(() => (
|
|
511
|
+
})]).then(() => (R(), !0));
|
|
479
512
|
}
|
|
480
513
|
})]
|
|
481
514
|
}) : /* @__PURE__ */ c("div", {
|
|
@@ -489,5 +522,5 @@ const Vt = (h) => {
|
|
|
489
522
|
});
|
|
490
523
|
};
|
|
491
524
|
export {
|
|
492
|
-
|
|
525
|
+
At as default
|
|
493
526
|
};
|