@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.8
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 +399 -343
- 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 -243
- 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, m = (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), [M, L] = d(!1), [I, ne] = d(0), [u, P] = d(), [h, k] = d(), [re, O] = d(), [Z, y] = d(-1), oe = X(null), N = X(void 0), D = X(!1), [f, S] = d({
|
|
46
47
|
current: 1,
|
|
47
48
|
pageSize: 50
|
|
48
|
-
}), [
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
O(void 0), (
|
|
52
|
-
},
|
|
49
|
+
}), [z, ie] = d(0), [A, ce] = d(0), [x, 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 = m({}, 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) => {
|
|
53
54
|
S({
|
|
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 (x) {
|
|
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 (x) {
|
|
106
107
|
case "nocode":
|
|
107
108
|
return "nocode";
|
|
108
109
|
case "pending":
|
|
@@ -112,198 +113,230 @@ 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
|
-
S(g(m({},
|
|
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
|
+
S((s) => g(m({}, 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), S((s) => g(m({}, 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, x, 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 (x === "hascode" && (n = I - z - A), x === "nocode" && (n = z), x === "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, S((a) => g(m({}, 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, S((r) => g(m({}, 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
|
+
!M || !(h != null && h.id) || (N.current = h.id);
|
|
234
|
+
}, [M, h == null ? void 0 : h.id]), C(() => {
|
|
235
|
+
const e = N.current;
|
|
236
|
+
if (M || !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
|
+
}, [M, u]), C(() => {
|
|
244
|
+
M || (S((e) => e.type ? m({
|
|
245
|
+
current: e.current,
|
|
246
|
+
pageSize: e.pageSize
|
|
247
|
+
}, e.total !== void 0 ? {
|
|
248
|
+
total: e.total
|
|
249
|
+
} : {}) : e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? k(void 0) : (J === "annotation" && R(), k(void 0), y(-1), O(void 0), F("preview")));
|
|
250
|
+
}, [M, J]), C(() => {
|
|
251
|
+
o && (o.markType !== "ocr" || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
|
|
219
252
|
请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
|
|
220
|
-
}, [
|
|
221
|
-
const
|
|
253
|
+
}, [o]);
|
|
254
|
+
const Ae = (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? tt : nt, Ke = () => {
|
|
222
255
|
if (console.log("一键确认", l, t), !(l != null && l.cvforceDatahub) || !(t != null && t.id))
|
|
223
256
|
return Promise.resolve(!1);
|
|
224
|
-
|
|
257
|
+
Xe.confirm({
|
|
225
258
|
title: "一键保存所有标注?",
|
|
226
259
|
content: "待确认的所有带预标注信息的图片将保存至已标注页签下",
|
|
227
260
|
onOk: () => {
|
|
228
261
|
l.cvforceDatahub.getAllConfirmSamples(i, t.id).then((e) => {
|
|
229
|
-
|
|
262
|
+
B.success("保存成功"), S(g(m({}, f), {
|
|
230
263
|
current: 1
|
|
231
|
-
})),
|
|
264
|
+
})), fe(), R();
|
|
232
265
|
});
|
|
233
266
|
}
|
|
234
267
|
});
|
|
235
|
-
},
|
|
236
|
-
return /* @__PURE__ */ c(
|
|
237
|
-
locale:
|
|
238
|
-
children: /* @__PURE__ */ c(
|
|
268
|
+
}, me = !h && !!(v && v.preLabel) && !!(t != null && t.id), Fe = U || me;
|
|
269
|
+
return /* @__PURE__ */ c(je, {
|
|
270
|
+
locale: Ye,
|
|
271
|
+
children: /* @__PURE__ */ c(st.Provider, {
|
|
239
272
|
value: {
|
|
240
273
|
datasetId: i,
|
|
241
274
|
versionId: (t == null ? void 0 : t.id) || "",
|
|
242
275
|
no: (t == null ? void 0 : t.no) || "",
|
|
243
|
-
loading:
|
|
276
|
+
loading: ee,
|
|
244
277
|
version: t,
|
|
245
|
-
versions:
|
|
278
|
+
versions: V,
|
|
246
279
|
samples: u,
|
|
247
|
-
pagination:
|
|
280
|
+
pagination: f,
|
|
248
281
|
services: l,
|
|
249
282
|
featuresConfig: {
|
|
250
|
-
labelManager:
|
|
251
|
-
datasetManager:
|
|
252
|
-
annotation:
|
|
253
|
-
filterSwitch:
|
|
283
|
+
labelManager: Ce,
|
|
284
|
+
datasetManager: v,
|
|
285
|
+
annotation: ke,
|
|
286
|
+
filterSwitch: Q,
|
|
254
287
|
header: p,
|
|
255
|
-
exampleSrcRoot:
|
|
288
|
+
exampleSrcRoot: Se
|
|
256
289
|
}
|
|
257
290
|
},
|
|
258
|
-
children:
|
|
291
|
+
children: o ? o.markType === "ocr" ? /* @__PURE__ */ T("div", {
|
|
259
292
|
className: "ocr-version-detail",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ T(ct, {
|
|
261
294
|
className: "product-details-page",
|
|
262
|
-
header: p === !1 ? void 0 : /* @__PURE__ */ c(
|
|
263
|
-
backTo:
|
|
295
|
+
header: p === !1 ? void 0 : /* @__PURE__ */ c(ut, {
|
|
296
|
+
backTo: be,
|
|
264
297
|
onBackClick: p != null && p.onBackClick ? () => {
|
|
265
298
|
p.onBackClick && p.onBackClick();
|
|
266
299
|
} : void 0,
|
|
267
|
-
left: !
|
|
300
|
+
left: !ee && /* @__PURE__ */ T(w, {
|
|
268
301
|
children: [/* @__PURE__ */ c("span", {
|
|
269
302
|
style: {
|
|
270
303
|
fontWeight: "bold"
|
|
271
304
|
},
|
|
272
|
-
children:
|
|
273
|
-
}), /* @__PURE__ */ c(
|
|
305
|
+
children: o == null ? void 0 : o.name
|
|
306
|
+
}), /* @__PURE__ */ c(qe, {
|
|
274
307
|
disabled: (p == null ? void 0 : p.versionSelect) === !1,
|
|
275
308
|
value: t == null ? void 0 : t.id,
|
|
276
309
|
style: {
|
|
277
310
|
width: 70
|
|
278
311
|
},
|
|
279
|
-
options:
|
|
312
|
+
options: V.map((e) => ({
|
|
280
313
|
label: e.no,
|
|
281
314
|
value: e.id
|
|
282
315
|
})),
|
|
283
316
|
onChange: (e) => {
|
|
284
|
-
const n =
|
|
285
|
-
if (!
|
|
317
|
+
const n = V.find((a) => a.id === e);
|
|
318
|
+
if (!o || !n)
|
|
286
319
|
return;
|
|
287
|
-
const
|
|
288
|
-
|
|
320
|
+
const r = V.find((a) => a.id === n.id);
|
|
321
|
+
$(r), p != null && p.onVersionChange && p.onVersionChange(r);
|
|
289
322
|
}
|
|
290
323
|
})]
|
|
291
324
|
}),
|
|
292
|
-
right: /* @__PURE__ */ c(
|
|
293
|
-
children:
|
|
325
|
+
right: /* @__PURE__ */ c(w, {
|
|
326
|
+
children: Fe && /* @__PURE__ */ c(We, {
|
|
294
327
|
menu: {
|
|
295
|
-
items: [...
|
|
328
|
+
items: [...U ? [{
|
|
296
329
|
key: "manual",
|
|
297
|
-
label: /* @__PURE__ */ c(
|
|
298
|
-
children: /* @__PURE__ */ c(
|
|
330
|
+
label: /* @__PURE__ */ c(w, {
|
|
331
|
+
children: /* @__PURE__ */ c(_e, {
|
|
299
332
|
title: "预标注进行中,请任务完成后再试",
|
|
300
|
-
open:
|
|
301
|
-
children: /* @__PURE__ */ c(
|
|
333
|
+
open: Te,
|
|
334
|
+
children: /* @__PURE__ */ c(Y, {
|
|
302
335
|
type: "text",
|
|
303
|
-
disabled: !
|
|
304
|
-
onClick:
|
|
305
|
-
onMouseEnter: () =>
|
|
306
|
-
onMouseLeave: () =>
|
|
336
|
+
disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "StructKVCOCR" && (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR" || W,
|
|
337
|
+
onClick: we,
|
|
338
|
+
onMouseEnter: () => W && ue(!0),
|
|
339
|
+
onMouseLeave: () => ue(!1),
|
|
307
340
|
style: {
|
|
308
341
|
marginRight: "10px"
|
|
309
342
|
},
|
|
@@ -311,71 +344,73 @@ const Vt = (h) => {
|
|
|
311
344
|
})
|
|
312
345
|
})
|
|
313
346
|
})
|
|
314
|
-
}] : [],
|
|
347
|
+
}] : [], me ? {
|
|
315
348
|
key: "auto",
|
|
316
|
-
label: /* @__PURE__ */ c(
|
|
349
|
+
label: /* @__PURE__ */ c(rt, {
|
|
317
350
|
buttonType: "text",
|
|
318
351
|
datasetId: i,
|
|
319
352
|
versionId: (t == null ? void 0 : t.id) || "",
|
|
320
|
-
disabled: !
|
|
321
|
-
setIsTaskChange:
|
|
322
|
-
preLabelTask:
|
|
353
|
+
disabled: !I || (o == null ? void 0 : o.ocrMarkTmpl) !== "DetectionOCR",
|
|
354
|
+
setIsTaskChange: ye,
|
|
355
|
+
preLabelTask: ae,
|
|
323
356
|
datasetType: "ocr"
|
|
324
357
|
})
|
|
325
358
|
} : null]
|
|
326
359
|
},
|
|
327
360
|
placement: "bottom",
|
|
328
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ T(Y, {
|
|
329
362
|
type: "primary",
|
|
330
|
-
children: ["开始标注", /* @__PURE__ */ c(
|
|
363
|
+
children: ["开始标注", /* @__PURE__ */ c(ft, {})]
|
|
331
364
|
})
|
|
332
365
|
})
|
|
333
366
|
})
|
|
334
367
|
}),
|
|
335
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ T("div", {
|
|
336
369
|
className: "ocr-header",
|
|
337
|
-
children: [/* @__PURE__ */ c(
|
|
338
|
-
children:
|
|
370
|
+
children: [/* @__PURE__ */ c(w, {
|
|
371
|
+
children: Q.tabs && /* @__PURE__ */ c(He, {
|
|
339
372
|
className: "header-tab",
|
|
340
|
-
activeKey:
|
|
373
|
+
activeKey: x,
|
|
341
374
|
onChange: (e) => {
|
|
342
|
-
S(g(m({},
|
|
375
|
+
S(g(m({}, f), {
|
|
343
376
|
current: 1,
|
|
344
377
|
total: 0
|
|
345
|
-
})),
|
|
378
|
+
})), j(e);
|
|
346
379
|
},
|
|
347
|
-
items:
|
|
380
|
+
items: ze
|
|
348
381
|
})
|
|
349
|
-
}), /* @__PURE__ */ c(
|
|
350
|
-
children:
|
|
382
|
+
}), /* @__PURE__ */ c(w, {
|
|
383
|
+
children: x === "pending" && U && /* @__PURE__ */ c(Y, {
|
|
351
384
|
type: "primary",
|
|
352
385
|
className: "pending-confirm-button",
|
|
353
|
-
onClick:
|
|
386
|
+
onClick: Ke,
|
|
354
387
|
children: "一键确认"
|
|
355
388
|
})
|
|
356
389
|
})]
|
|
357
390
|
}), /* @__PURE__ */ c("div", {
|
|
358
391
|
className: "d-row",
|
|
359
|
-
|
|
392
|
+
ref: oe,
|
|
393
|
+
children: u != null && u.length ? /* @__PURE__ */ T(w, {
|
|
360
394
|
direction: "vertical",
|
|
361
395
|
className: "d-right",
|
|
362
|
-
children: [/* @__PURE__ */ c(
|
|
396
|
+
children: [/* @__PURE__ */ c(Je, {
|
|
363
397
|
gutter: [16, 16],
|
|
364
398
|
wrap: !0,
|
|
365
399
|
className: "d-right-row",
|
|
366
|
-
children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(
|
|
400
|
+
children: u == null ? void 0 : u.map((e, n) => /* @__PURE__ */ c(Qe, {
|
|
367
401
|
className: "d-right-col",
|
|
368
|
-
|
|
369
|
-
|
|
402
|
+
"data-sample-id": e.id,
|
|
403
|
+
onClick: () => Re(n),
|
|
404
|
+
children: /* @__PURE__ */ T("div", {
|
|
370
405
|
className: "right-col-wrapper",
|
|
371
406
|
children: [/* @__PURE__ */ c("div", {
|
|
372
407
|
className: "detection-status-wrapper",
|
|
373
|
-
children: /* @__PURE__ */ c(
|
|
408
|
+
children: /* @__PURE__ */ c(mt, {
|
|
374
409
|
sample: e
|
|
375
410
|
})
|
|
376
411
|
}), /* @__PURE__ */ c("div", {
|
|
377
412
|
className: "right-col-img",
|
|
378
|
-
children: /* @__PURE__ */ c(
|
|
413
|
+
children: /* @__PURE__ */ c(lt, {
|
|
379
414
|
fileKey: e.fileKey,
|
|
380
415
|
width: 124,
|
|
381
416
|
thumbnailUrl: e.thumbnailUrl
|
|
@@ -388,94 +423,97 @@ const Vt = (h) => {
|
|
|
388
423
|
})]
|
|
389
424
|
})
|
|
390
425
|
}, e.id))
|
|
391
|
-
}), /* @__PURE__ */ c(
|
|
392
|
-
onChange:
|
|
426
|
+
}), /* @__PURE__ */ c(Ge, m({
|
|
427
|
+
onChange: ve,
|
|
393
428
|
className: "d-right-pageination",
|
|
394
429
|
showQuickJumper: !0,
|
|
395
430
|
showSizeChanger: !0
|
|
396
|
-
},
|
|
397
|
-
}) : /* @__PURE__ */ c(
|
|
431
|
+
}, f))]
|
|
432
|
+
}) : /* @__PURE__ */ c(at, {})
|
|
398
433
|
})]
|
|
399
|
-
}),
|
|
400
|
-
mode:
|
|
401
|
-
visible:
|
|
402
|
-
onClose: () =>
|
|
403
|
-
record:
|
|
404
|
-
onNextClick: () =>
|
|
405
|
-
onPrevClick: () =>
|
|
406
|
-
ocrMarkTmpl:
|
|
434
|
+
}), M && /* @__PURE__ */ c(et, {
|
|
435
|
+
mode: J,
|
|
436
|
+
visible: M,
|
|
437
|
+
onClose: () => L(!1),
|
|
438
|
+
record: h,
|
|
439
|
+
onNextClick: () => Oe(),
|
|
440
|
+
onPrevClick: () => Ne(),
|
|
441
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
407
442
|
datasetId: i,
|
|
408
443
|
versionId: t == null ? void 0 : t.id,
|
|
409
444
|
handleMarkClick: (e) => {
|
|
410
|
-
O(e), (
|
|
445
|
+
O(e), (o == null ? void 0 : o.ocrMarkTmpl) === "StructKVCOCR" ? (L(!1), q(!0)) : F("annotation");
|
|
411
446
|
},
|
|
412
|
-
updateSampleList:
|
|
413
|
-
isPreLabel:
|
|
414
|
-
selectSampleId:
|
|
447
|
+
updateSampleList: R,
|
|
448
|
+
isPreLabel: W,
|
|
449
|
+
selectSampleId: re,
|
|
415
450
|
onSave: (e) => {
|
|
416
451
|
var n;
|
|
417
452
|
if (!i || !t)
|
|
418
453
|
throw "datasetId or version is not exist.";
|
|
419
454
|
return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
|
|
420
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
421
|
-
box:
|
|
455
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
|
|
456
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
422
457
|
}))
|
|
423
|
-
})]).then(() => (u && (
|
|
424
|
-
if (!
|
|
425
|
-
return
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
428
|
-
const
|
|
429
|
-
return
|
|
458
|
+
})]).then(() => (u && (h == null ? void 0 : h.id) === e.id && (P((r) => {
|
|
459
|
+
if (!r)
|
|
460
|
+
return r;
|
|
461
|
+
const a = r.findIndex((s) => s.id === e.id);
|
|
462
|
+
if (a > -1) {
|
|
463
|
+
const s = [...r];
|
|
464
|
+
return s[a] = e, s;
|
|
430
465
|
}
|
|
431
|
-
return
|
|
432
|
-
}),
|
|
466
|
+
return r;
|
|
467
|
+
}), k(e)), !0));
|
|
433
468
|
},
|
|
434
469
|
onPending: (e) => {
|
|
435
470
|
var n;
|
|
436
471
|
if (!i || !t)
|
|
437
472
|
throw "datasetId or version is not exist.";
|
|
438
473
|
return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
|
|
439
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
440
|
-
box:
|
|
474
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
|
|
475
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
441
476
|
}))
|
|
442
|
-
})], 1).then(() => (u && (
|
|
443
|
-
if (!
|
|
444
|
-
return
|
|
445
|
-
const
|
|
446
|
-
if (
|
|
447
|
-
const
|
|
448
|
-
return
|
|
477
|
+
})], 1).then(() => (u && (h == null ? void 0 : h.id) === e.id && (P((r) => {
|
|
478
|
+
if (!r)
|
|
479
|
+
return r;
|
|
480
|
+
const a = r.findIndex((s) => s.id === e.id);
|
|
481
|
+
if (a > -1) {
|
|
482
|
+
const s = [...r];
|
|
483
|
+
return s[a] = e, s;
|
|
449
484
|
}
|
|
450
|
-
return
|
|
451
|
-
}),
|
|
485
|
+
return r;
|
|
486
|
+
}), k(e)), !0));
|
|
452
487
|
},
|
|
453
|
-
filterMode:
|
|
488
|
+
filterMode: x,
|
|
454
489
|
onFilterModeChange: (e) => {
|
|
455
|
-
O(void 0),
|
|
490
|
+
O(void 0), j(e);
|
|
456
491
|
},
|
|
457
492
|
onPaginationChange: (e) => {
|
|
458
493
|
S(e);
|
|
459
494
|
},
|
|
495
|
+
onCurrentSampleChange: (e) => {
|
|
496
|
+
N.current = e;
|
|
497
|
+
},
|
|
460
498
|
samples: u,
|
|
461
|
-
pagination:
|
|
462
|
-
currentIndex:
|
|
463
|
-
}),
|
|
464
|
-
visible:
|
|
465
|
-
selectSampleId:
|
|
466
|
-
ocrMarkTmpl:
|
|
499
|
+
pagination: f,
|
|
500
|
+
currentIndex: Z
|
|
501
|
+
}), le && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(Ae, {
|
|
502
|
+
visible: le,
|
|
503
|
+
selectSampleId: re,
|
|
504
|
+
ocrMarkTmpl: o == null ? void 0 : o.ocrMarkTmpl,
|
|
467
505
|
datasetId: i,
|
|
468
506
|
versionId: t.id,
|
|
469
|
-
onClose: () =>
|
|
507
|
+
onClose: () => q(!1),
|
|
470
508
|
onSave: (e) => {
|
|
471
509
|
var n;
|
|
472
510
|
if (!i || !t)
|
|
473
511
|
throw "datasetId or version is not exist.";
|
|
474
512
|
return l.cvforceDatahub.updateSamples(i, t.id, [g(m({}, e), {
|
|
475
|
-
labels: (n = e.labels) == null ? void 0 : n.map((
|
|
476
|
-
box:
|
|
513
|
+
labels: (n = e.labels) == null ? void 0 : n.map((r) => g(m({}, r), {
|
|
514
|
+
box: r.box.length > 4 ? r.box.splice(0, 4) : r.box
|
|
477
515
|
}))
|
|
478
|
-
})]).then(() => (
|
|
516
|
+
})]).then(() => (R(), !0));
|
|
479
517
|
}
|
|
480
518
|
})]
|
|
481
519
|
}) : /* @__PURE__ */ c("div", {
|
|
@@ -489,5 +527,5 @@ const Vt = (h) => {
|
|
|
489
527
|
});
|
|
490
528
|
};
|
|
491
529
|
export {
|
|
492
|
-
|
|
530
|
+
At as default
|
|
493
531
|
};
|