@glodon-aiot/dataset-annotation 3.16.0-alpha.50 → 3.16.0
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/PicZipImportModal/index.mjs +133 -133
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var hl = Object.defineProperty;
|
|
2
|
+
var Ve = Object.getOwnPropertySymbols;
|
|
3
|
+
var gl = Object.prototype.hasOwnProperty, Cl = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var je = (S, e, s) => e in S ? hl(S, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : S[e] = s, Pe = (S, e) => {
|
|
5
5
|
for (var s in e || (e = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var s of
|
|
9
|
-
|
|
6
|
+
gl.call(e, s) && je(S, s, e[s]);
|
|
7
|
+
if (Ve)
|
|
8
|
+
for (var s of Ve(e))
|
|
9
|
+
Cl.call(e, s) && je(S, s, e[s]);
|
|
10
10
|
return S;
|
|
11
11
|
};
|
|
12
12
|
var de = (S, e, s) => new Promise((h, D) => {
|
|
13
|
-
var K = (
|
|
13
|
+
var K = (v) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
D(
|
|
15
|
+
R(s.next(v));
|
|
16
|
+
} catch (F) {
|
|
17
|
+
D(F);
|
|
18
18
|
}
|
|
19
|
-
}, m = (
|
|
19
|
+
}, m = (v) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
D(
|
|
21
|
+
R(s.throw(v));
|
|
22
|
+
} catch (F) {
|
|
23
|
+
D(F);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, R = (v) => v.done ? h(v.value) : Promise.resolve(v.value).then(K, m);
|
|
26
|
+
R((s = s.apply(S, e)).next());
|
|
27
27
|
});
|
|
28
28
|
import { jsxs as d, Fragment as pe, jsx as l } from "react/jsx-runtime";
|
|
29
|
-
import { useContext as
|
|
30
|
-
import { Form as V, message as U, Modal as X, Button as j, Radio as
|
|
29
|
+
import { useContext as bl, useState as c, useRef as yl, useEffect as O } from "react";
|
|
30
|
+
import { Form as V, message as U, Modal as X, Button as j, Radio as L, Tooltip as zl, Space as Me, Upload as De, Row as ue, Col as wl, Spin as El, Result as Ke } from "antd";
|
|
31
31
|
import "./style.less.mjs";
|
|
32
|
-
import { InfoCircleOutlined as
|
|
33
|
-
import
|
|
34
|
-
import { initMinio as
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import { MB as
|
|
40
|
-
import { fileSuffixToLowerCase as
|
|
32
|
+
import { InfoCircleOutlined as Sl, CloudUploadOutlined as Nl, PaperClipOutlined as Al, DeleteOutlined as Bl, PlusOutlined as vl } from "@ant-design/icons";
|
|
33
|
+
import Fl from "browser-md5-file";
|
|
34
|
+
import { initMinio as _e, putObjectBuffer as Ze } from "@glodon-aiot/minio";
|
|
35
|
+
import $l from "./pic_zip.svg.mjs";
|
|
36
|
+
import xl from "./pic_zip_json.svg.mjs";
|
|
37
|
+
import kl from "./pic_vlm_json_zip.svg.mjs";
|
|
38
|
+
import Tl from "./pic_vlm_zip.svg.mjs";
|
|
39
|
+
import { MB as Ge, GB as Ul } from "../../constant.mjs";
|
|
40
|
+
import { fileSuffixToLowerCase as Ll } from "../../utils/index.mjs";
|
|
41
41
|
import Rl from "../../DatasetContext/index.mjs";
|
|
42
|
-
import { EXAMPLE_SRC_ROOT as
|
|
43
|
-
import { getImportConfig as
|
|
42
|
+
import { EXAMPLE_SRC_ROOT as Ol } from "../../featuresConfig.mjs";
|
|
43
|
+
import { getImportConfig as Vl } from "./config.mjs";
|
|
44
44
|
let C = 0, Z = 0, P = 0, G = 0;
|
|
45
|
-
const
|
|
45
|
+
const nt = (S) => {
|
|
46
46
|
const {
|
|
47
47
|
datasetIam: e,
|
|
48
48
|
datasetId: s,
|
|
@@ -50,9 +50,9 @@ const st = (S) => {
|
|
|
50
50
|
tenCode: D,
|
|
51
51
|
isVisible: K,
|
|
52
52
|
markType: m,
|
|
53
|
-
setIsVisible:
|
|
54
|
-
getVersionListRequest:
|
|
55
|
-
onUploadStatusChange:
|
|
53
|
+
setIsVisible: R,
|
|
54
|
+
getVersionListRequest: v,
|
|
55
|
+
onUploadStatusChange: F,
|
|
56
56
|
setIsConfirm: H,
|
|
57
57
|
tableReload: me,
|
|
58
58
|
loadVersionData: I,
|
|
@@ -64,14 +64,14 @@ const st = (S) => {
|
|
|
64
64
|
featuresConfig: {
|
|
65
65
|
exampleSrcRoot: he
|
|
66
66
|
} = {
|
|
67
|
-
exampleSrcRoot:
|
|
67
|
+
exampleSrcRoot: Ol
|
|
68
68
|
}
|
|
69
|
-
} =
|
|
69
|
+
} = bl(Rl), [N, Ie] = c(0), [A, qe] = c(0), [Q, Je] = c([]), [M, We] = c(), [ge, jl] = c([]), [Y, q] = c(!1), [Ce, ee] = c(!1), [_, le] = c(!1), [te, Xe] = c(0), [He, Qe] = c(0), [ie, be] = c(-1), [se, Pl] = c([]), [ye, Ml] = c([]), [ze, ne] = c(!1), Ye = new Fl(), [J] = V.useForm(), o = V.useWatch("acceptType", J), $ = V.useWatch("labelState", J), [z, we] = c([]), [x, Ee] = c([]), [oe, el] = c(), [Se, Ne] = c(0), [Ae, Be] = c(!1), [Dl, ve] = c(""), [ll, Fe] = c(!1), [$e, tl] = c(
|
|
70
70
|
"unlabeled"
|
|
71
71
|
/* Unlabeled */
|
|
72
|
-
), ae =
|
|
73
|
-
Dragger:
|
|
74
|
-
} =
|
|
72
|
+
), ae = yl(!0), {
|
|
73
|
+
Dragger: il
|
|
74
|
+
} = De, b = Vl(m), re = b.imageMimeTypes, xe = b.imageAccept, ce = b.maxImageSize;
|
|
75
75
|
O(() => {
|
|
76
76
|
C = 0, Z = 0, P = 0, G = 0, le(!1), K && (ae.current = !1, I && I());
|
|
77
77
|
}, [K]);
|
|
@@ -90,11 +90,11 @@ const st = (S) => {
|
|
|
90
90
|
src: y.src,
|
|
91
91
|
width: y.width,
|
|
92
92
|
height: y.height
|
|
93
|
-
}),
|
|
93
|
+
}), Je(Q);
|
|
94
94
|
}, t.map((w) => {
|
|
95
|
-
const E = re.some((
|
|
96
|
-
E ?
|
|
97
|
-
}), r.length > 100 && r.splice(100, r.length),
|
|
95
|
+
const E = re.some((B) => B === w.type), k = w.size <= ce;
|
|
96
|
+
E ? k || (a = a + 1, r.splice(r.findIndex((B) => B.name === w.name), 1)) : (u = u + 1, r.splice(r.findIndex((B) => B.name === w.name), 1));
|
|
97
|
+
}), r.length > 100 && r.splice(100, r.length), Ie(u), qe(a), Z === t.length && (ne(!0), Z = 0);
|
|
98
98
|
const f = re.some((w) => w === i.type), T = i.size <= ce;
|
|
99
99
|
if (f) {
|
|
100
100
|
if (!T)
|
|
@@ -102,7 +102,7 @@ const st = (S) => {
|
|
|
102
102
|
} else
|
|
103
103
|
return !1;
|
|
104
104
|
} else {
|
|
105
|
-
if (i.size > 2 *
|
|
105
|
+
if (i.size > 2 * Ul)
|
|
106
106
|
return U.error(`${i.name}文件总大小不能超过2G`), !1;
|
|
107
107
|
const a = (n = i.name) == null ? void 0 : n.substring(i.name.lastIndexOf("."));
|
|
108
108
|
if (o === "zip" && a !== ".zip")
|
|
@@ -112,31 +112,31 @@ const st = (S) => {
|
|
|
112
112
|
return !1;
|
|
113
113
|
};
|
|
114
114
|
O(() => {
|
|
115
|
-
ze !== !1 && (!N && !A && !C || (C = C - G - N - A, C < 101 ? N > 0 && A > 0 ? (U.error(`${N + A}个文件添加失败,格式、大小或数量不符合要求`), C = C - N - A) : N > 0 && A === 0 ? U.error(`${N}个文件添加失败,格式不符合要求`) : N === 0 && A > 0 ? U.error(`${A}个文件添加失败,单张图片超过${b.maxImageSize /
|
|
115
|
+
ze !== !1 && (!N && !A && !C || (C = C - G - N - A, C < 101 ? N > 0 && A > 0 ? (U.error(`${N + A}个文件添加失败,格式、大小或数量不符合要求`), C = C - N - A) : N > 0 && A === 0 ? U.error(`${N}个文件添加失败,格式不符合要求`) : N === 0 && A > 0 ? U.error(`${A}个文件添加失败,单张图片超过${b.maxImageSize / Ge}M`) : N === 0 && A === 0 && U.success("校验成功") : N + A === 0 ? (U.error(`${C - 100}个文件添加失败,超过数量限制`), C = 100) : (U.error(`${C - 100 + N + A}个文件添加失败,格式、大小或数量不符合要求`), C = C < 101 ? C : 100), ne(!1)));
|
|
116
116
|
}, [ze]);
|
|
117
|
-
const
|
|
117
|
+
const sl = (i) => {
|
|
118
118
|
const t = i.originFileObj;
|
|
119
119
|
return new Promise((n, a) => {
|
|
120
|
-
|
|
121
|
-
u && a(u),
|
|
120
|
+
Ye.md5(t, (u, r) => {
|
|
121
|
+
u && a(u), ol(r, t), n(r);
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
|
-
},
|
|
124
|
+
}, nl = () => de(void 0, null, function* () {
|
|
125
125
|
if (!z)
|
|
126
126
|
return;
|
|
127
127
|
const i = [];
|
|
128
128
|
for (let t = 0; t < z.length; t++) {
|
|
129
|
-
const n = z[t], a = yield
|
|
129
|
+
const n = z[t], a = yield sl(n);
|
|
130
130
|
i.push(a);
|
|
131
131
|
}
|
|
132
132
|
!s || i.length === 0 || p == null || p.getDeduplication(i, s).then((t) => {
|
|
133
|
-
|
|
133
|
+
We(t), Fe(!1);
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
O(() => {
|
|
137
|
-
|
|
137
|
+
nl();
|
|
138
138
|
}, [z]);
|
|
139
|
-
const
|
|
139
|
+
const ol = (i, t) => {
|
|
140
140
|
t.md5 = i, ge.push(t);
|
|
141
141
|
}, Te = ({
|
|
142
142
|
fileList: i
|
|
@@ -147,8 +147,8 @@ const st = (S) => {
|
|
|
147
147
|
const t = i.filter((n) => n.size && n.size <= ce ? re.some((a) => n.type === a) : !1);
|
|
148
148
|
t.splice(100, t.length), t.length < z.length ? (we(t), G++) : (P = P - G, G = 0, P++, P == t.length && we(t), P > t.length && (P = t.length));
|
|
149
149
|
}, Ue = () => {
|
|
150
|
-
o === "zip" && (ae.current = !0),
|
|
151
|
-
},
|
|
150
|
+
o === "zip" && (ae.current = !0), R(!1);
|
|
151
|
+
}, al = () => {
|
|
152
152
|
if (o === "image") {
|
|
153
153
|
if (!M)
|
|
154
154
|
return;
|
|
@@ -168,24 +168,24 @@ const st = (S) => {
|
|
|
168
168
|
});
|
|
169
169
|
}), M.unduplicated.length !== 0) {
|
|
170
170
|
const n = M.unduplicated.map((a) => new Promise((u) => {
|
|
171
|
-
const r = ge.find((
|
|
171
|
+
const r = ge.find((k) => k.md5 === a);
|
|
172
172
|
if (!r)
|
|
173
173
|
return u();
|
|
174
|
-
const g = r.name, y = g.substring(g.indexOf(".")), f = Q.find((
|
|
174
|
+
const g = r.name, y = g.substring(g.indexOf(".")), f = Q.find((k) => k.name === g), T = {
|
|
175
175
|
"Content-Type": "application/octet-stream",
|
|
176
176
|
"X-Amz-Meta-Width": f == null ? void 0 : f.width,
|
|
177
177
|
"X-Amz-Meta-Height": f == null ? void 0 : f.height
|
|
178
|
-
}, w = `dataset/${s}/sample/${a}${
|
|
178
|
+
}, w = `dataset/${s}/sample/${a}${Ll(y)}`;
|
|
179
179
|
delete r.md5;
|
|
180
180
|
const E = new FileReader();
|
|
181
|
-
E.readAsArrayBuffer(r), E.onload = (
|
|
182
|
-
|
|
181
|
+
E.readAsArrayBuffer(r), E.onload = (k) => {
|
|
182
|
+
_e({
|
|
183
183
|
endPoint: e == null ? void 0 : e.endpoints[0],
|
|
184
184
|
useSSL: e == null ? void 0 : e.useSSL,
|
|
185
185
|
accessKey: e == null ? void 0 : e.accessKey,
|
|
186
186
|
secretKey: e == null ? void 0 : e.secretKey
|
|
187
|
-
}),
|
|
188
|
-
q(!0), t += 1,
|
|
187
|
+
}), Ze(D, w, k.target.result, T, (B, W) => {
|
|
188
|
+
q(!0), t += 1, B && (i += 1, Qe(i)), Xe(t), ye.push({
|
|
189
189
|
labels: [],
|
|
190
190
|
fileKey: `${D}/${w}`,
|
|
191
191
|
sampleFileName: {
|
|
@@ -202,7 +202,7 @@ const st = (S) => {
|
|
|
202
202
|
}).then(() => {
|
|
203
203
|
p.getDatasetsIdVersionsVid(s, h.id).then((a) => {
|
|
204
204
|
be(a.samplesCount - h.samplesCount);
|
|
205
|
-
}), H(!0),
|
|
205
|
+
}), H(!0), F && F(!1);
|
|
206
206
|
});
|
|
207
207
|
}, 100);
|
|
208
208
|
});
|
|
@@ -214,12 +214,12 @@ const st = (S) => {
|
|
|
214
214
|
}).then(() => {
|
|
215
215
|
p.getDatasetsIdVersionsVid(s, h.id).then((n) => {
|
|
216
216
|
be(n.samplesCount - h.samplesCount);
|
|
217
|
-
}), H(!0),
|
|
217
|
+
}), H(!0), F && F(!1);
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
} else
|
|
221
|
-
|
|
222
|
-
},
|
|
221
|
+
rl(x);
|
|
222
|
+
}, rl = (i) => {
|
|
223
223
|
!s || !h || i.map((t, n) => {
|
|
224
224
|
var y;
|
|
225
225
|
const a = {
|
|
@@ -231,7 +231,7 @@ const st = (S) => {
|
|
|
231
231
|
secretKey: e == null ? void 0 : e.secretKey
|
|
232
232
|
}, r = (e == null ? void 0 : e.prefix) + ((y = i[0]) == null ? void 0 : y.name), g = new FileReader();
|
|
233
233
|
g.readAsArrayBuffer(t), g.onload = (f) => {
|
|
234
|
-
|
|
234
|
+
_e(u), Ze(e == null ? void 0 : e.bucket, r, f.target.result, a, (T, w) => {
|
|
235
235
|
if (T)
|
|
236
236
|
console.log(T);
|
|
237
237
|
else {
|
|
@@ -239,21 +239,21 @@ const st = (S) => {
|
|
|
239
239
|
return;
|
|
240
240
|
q(!0), m === "vlm" ? p == null || p.postVlmUploadPicsZip(s, h.id, {
|
|
241
241
|
zipUrl: (e == null ? void 0 : e.bucket) + "/" + r,
|
|
242
|
-
type:
|
|
242
|
+
type: $ === "labeled" ? 2 : 1
|
|
243
243
|
}).then((E) => {
|
|
244
|
-
|
|
245
|
-
}) : p == null || p.postUploadPicsZip(s, h.id,
|
|
244
|
+
Le(E), ve(E);
|
|
245
|
+
}) : p == null || p.postUploadPicsZip(s, h.id, Pe({
|
|
246
246
|
zipUrls: [(e == null ? void 0 : e.bucket) + "/" + r]
|
|
247
247
|
}, (m === "ocr" || m === "detection") && {
|
|
248
|
-
type:
|
|
248
|
+
type: $ === "labeled" ? 1 : 0
|
|
249
249
|
})).then((E) => {
|
|
250
|
-
|
|
250
|
+
Le(E), ve(E);
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
};
|
|
255
255
|
});
|
|
256
|
-
},
|
|
256
|
+
}, Le = (i) => de(void 0, null, function* () {
|
|
257
257
|
var t;
|
|
258
258
|
if (!(!s || !h || !p))
|
|
259
259
|
try {
|
|
@@ -262,7 +262,7 @@ const st = (S) => {
|
|
|
262
262
|
}, 5e3, m, (a) => {
|
|
263
263
|
Ne(a);
|
|
264
264
|
});
|
|
265
|
-
n &&
|
|
265
|
+
n && el(JSON.parse(n));
|
|
266
266
|
} catch (n) {
|
|
267
267
|
if (((t = n.cause) == null ? void 0 : t.code) === -101) {
|
|
268
268
|
Be(!0);
|
|
@@ -273,28 +273,28 @@ const st = (S) => {
|
|
|
273
273
|
O(() => {
|
|
274
274
|
oe && (Ne(100), ee(!0));
|
|
275
275
|
}, [oe]), O(() => {
|
|
276
|
-
te !== 0 && (H(!1),
|
|
276
|
+
te !== 0 && (H(!1), F && F(!0));
|
|
277
277
|
}, [te]), O(() => {
|
|
278
278
|
ie !== -1 && (ee(!0), le(!1));
|
|
279
279
|
}, [ie]);
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
children: [/* @__PURE__ */ l(
|
|
280
|
+
const cl = () => {
|
|
281
|
+
Re(), ee(!1), fe && fe();
|
|
282
|
+
}, Re = () => {
|
|
283
|
+
v(), q(!1), R(!1), me && me(), I && I();
|
|
284
|
+
}, dl = /* @__PURE__ */ d("div", {
|
|
285
|
+
children: [/* @__PURE__ */ l(vl, {}), /* @__PURE__ */ l("div", {
|
|
286
286
|
style: {
|
|
287
287
|
marginTop: 8
|
|
288
288
|
},
|
|
289
289
|
children: "添加图片"
|
|
290
290
|
})]
|
|
291
|
-
}),
|
|
292
|
-
const t =
|
|
291
|
+
}), pl = (i) => {
|
|
292
|
+
const t = x.filter((n) => n.uid !== i.uid);
|
|
293
293
|
Ee(t);
|
|
294
|
-
}, pl = () => {
|
|
295
|
-
x === "labeled" ? m === "vlm" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : m === "detection" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/detection/%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${he}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : m === "vlm" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/%E6%97%A0%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${he}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
296
294
|
}, ul = () => {
|
|
297
|
-
|
|
295
|
+
$ === "labeled" ? m === "vlm" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : m === "detection" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/detection/%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${he}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : m === "vlm" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/%E6%97%A0%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${he}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
296
|
+
}, ml = () => {
|
|
297
|
+
v(), Be(!1), q(!1), R(!1);
|
|
298
298
|
};
|
|
299
299
|
O(() => {
|
|
300
300
|
$e === "labeled" && J.setFieldsValue({
|
|
@@ -303,18 +303,18 @@ const st = (S) => {
|
|
|
303
303
|
/* Zip */
|
|
304
304
|
});
|
|
305
305
|
}, [$e, b.labelFormat]);
|
|
306
|
-
const
|
|
306
|
+
const fl = (i, t, n, a, u, r, g, y) => {
|
|
307
307
|
if (i === "image") {
|
|
308
|
-
const
|
|
309
|
-
return `数据导入完成,成功${r}个,失败${g}个,去重${
|
|
308
|
+
const W = u.length - r - g;
|
|
309
|
+
return `数据导入完成,成功${r}个,失败${g}个,去重${W}个`;
|
|
310
310
|
}
|
|
311
311
|
if (!t)
|
|
312
312
|
return "";
|
|
313
|
-
const f = t.formatErrorCount || 0, T = t.successCount || 0, w = t.repeatCount || 0, E = t.failedCount || 0;
|
|
313
|
+
const f = t.formatErrorCount || 0, T = t.successCount || 0, w = t.repeatCount || 0, E = t.failedCount || 0, k = t.hasLabelCount || 0;
|
|
314
314
|
let B = `数据导入完成,格式不符合的图片${f}个,成功${T}个,去重${w}个,失败${E}个`;
|
|
315
315
|
if (n === "labeled") {
|
|
316
|
-
const
|
|
317
|
-
y !== "detection" ? B += `(${
|
|
316
|
+
const W = (a.labelFormat || "json").toUpperCase(), Oe = t.labelErrorCount || 0;
|
|
317
|
+
y !== "detection" ? B += `(${W}格式不符合${Oe}个)` : B = `成功导入已标注${k}张,未标注${Oe}张,去重${w}张,失败${E}张,格式不符合${f}张`;
|
|
318
318
|
}
|
|
319
319
|
return B;
|
|
320
320
|
};
|
|
@@ -335,10 +335,10 @@ const st = (S) => {
|
|
|
335
335
|
type: "primary",
|
|
336
336
|
htmlType: "submit",
|
|
337
337
|
form: "importModal",
|
|
338
|
-
disabled: o === "image" && !z.length || o === "zip" && !
|
|
338
|
+
disabled: o === "image" && !z.length || o === "zip" && !x.length || Y && Se == 0 || ll,
|
|
339
339
|
loading: _ == !0,
|
|
340
340
|
onClick: () => {
|
|
341
|
-
|
|
341
|
+
al(), le(!0);
|
|
342
342
|
},
|
|
343
343
|
children: "导入"
|
|
344
344
|
}, "confirm")],
|
|
@@ -365,19 +365,19 @@ const st = (S) => {
|
|
|
365
365
|
required: !0,
|
|
366
366
|
message: "请选择数据标注状态"
|
|
367
367
|
}],
|
|
368
|
-
children: /* @__PURE__ */ d(
|
|
368
|
+
children: /* @__PURE__ */ d(L.Group, {
|
|
369
369
|
disabled: _,
|
|
370
370
|
onChange: (i) => {
|
|
371
|
-
|
|
371
|
+
tl(i.target.value);
|
|
372
372
|
},
|
|
373
|
-
children: [/* @__PURE__ */ l(
|
|
373
|
+
children: [/* @__PURE__ */ l(L, {
|
|
374
374
|
value: "unlabeled",
|
|
375
375
|
children: "无标注信息"
|
|
376
|
-
}), /* @__PURE__ */ d(
|
|
376
|
+
}), /* @__PURE__ */ d(L, {
|
|
377
377
|
value: "labeled",
|
|
378
|
-
children: ["有标注信息", m === "vlm" && /* @__PURE__ */ l(
|
|
378
|
+
children: ["有标注信息", m === "vlm" && /* @__PURE__ */ l(zl, {
|
|
379
379
|
title: "支持上传带OCR标注信息的数据",
|
|
380
|
-
children: /* @__PURE__ */ l(
|
|
380
|
+
children: /* @__PURE__ */ l(Sl, {
|
|
381
381
|
style: {
|
|
382
382
|
cursor: "pointer",
|
|
383
383
|
marginLeft: 4,
|
|
@@ -387,16 +387,16 @@ const st = (S) => {
|
|
|
387
387
|
})]
|
|
388
388
|
})]
|
|
389
389
|
})
|
|
390
|
-
}),
|
|
390
|
+
}), $ === "labeled" && /* @__PURE__ */ l(V.Item, {
|
|
391
391
|
label: "标注格式",
|
|
392
392
|
name: "labelFormat",
|
|
393
393
|
rules: [{
|
|
394
394
|
required: !0,
|
|
395
395
|
message: "请选择标注格式"
|
|
396
396
|
}],
|
|
397
|
-
children: /* @__PURE__ */ l(
|
|
397
|
+
children: /* @__PURE__ */ l(L.Group, {
|
|
398
398
|
disabled: _,
|
|
399
|
-
children: /* @__PURE__ */ l(
|
|
399
|
+
children: /* @__PURE__ */ l(L, {
|
|
400
400
|
value: b.labelFormat || "json",
|
|
401
401
|
children: b.labelFormat || "json"
|
|
402
402
|
})
|
|
@@ -408,19 +408,19 @@ const st = (S) => {
|
|
|
408
408
|
required: !0,
|
|
409
409
|
message: "请选择导入方式"
|
|
410
410
|
}],
|
|
411
|
-
children: /* @__PURE__ */ d(
|
|
411
|
+
children: /* @__PURE__ */ d(L.Group, {
|
|
412
412
|
disabled: _,
|
|
413
|
-
children: [
|
|
413
|
+
children: [$ !== "labeled" && /* @__PURE__ */ l(L.Button, {
|
|
414
414
|
value: "image",
|
|
415
415
|
children: "上传图片"
|
|
416
|
-
}), /* @__PURE__ */ l(
|
|
416
|
+
}), /* @__PURE__ */ l(L.Button, {
|
|
417
417
|
value: "zip",
|
|
418
418
|
children: "上传压缩包"
|
|
419
419
|
})]
|
|
420
420
|
})
|
|
421
421
|
}), /* @__PURE__ */ d("div", {
|
|
422
422
|
className: "file-upload",
|
|
423
|
-
children: [(o === "image" && !z.length || o === "zip") && /* @__PURE__ */ d(
|
|
423
|
+
children: [(o === "image" && !z.length || o === "zip") && /* @__PURE__ */ d(il, {
|
|
424
424
|
name: "file",
|
|
425
425
|
showUploadList: !1,
|
|
426
426
|
multiple: !0,
|
|
@@ -428,18 +428,18 @@ const st = (S) => {
|
|
|
428
428
|
accept: o === "zip" ? ".zip" : xe,
|
|
429
429
|
maxCount: o === "zip" ? 1 : void 0,
|
|
430
430
|
onChange: Te,
|
|
431
|
-
disabled: o === "zip" ?
|
|
431
|
+
disabled: o === "zip" ? x.length === 1 : !1,
|
|
432
432
|
children: [/* @__PURE__ */ l("span", {
|
|
433
433
|
className: "file-upload-icon",
|
|
434
|
-
children: /* @__PURE__ */ l(
|
|
435
|
-
}), /* @__PURE__ */ d(
|
|
434
|
+
children: /* @__PURE__ */ l(Nl, {})
|
|
435
|
+
}), /* @__PURE__ */ d(Me, {
|
|
436
436
|
className: "file-upload-action",
|
|
437
437
|
children: [o === "image" && "拖拽图片至此,或者", o === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ l(j, {
|
|
438
438
|
type: "link",
|
|
439
439
|
style: {
|
|
440
440
|
padding: 0
|
|
441
441
|
},
|
|
442
|
-
disabled: o === "zip" ?
|
|
442
|
+
disabled: o === "zip" ? x.length === 1 : !1,
|
|
443
443
|
children: o === "image" ? "上传图片" : "上传压缩包"
|
|
444
444
|
})]
|
|
445
445
|
}), o === "image" && /* @__PURE__ */ d("div", {
|
|
@@ -449,7 +449,7 @@ const st = (S) => {
|
|
|
449
449
|
},
|
|
450
450
|
children: [/* @__PURE__ */ d("div", {
|
|
451
451
|
className: "item-upload-desc item-upload-desc__1",
|
|
452
|
-
children: ["1. 支持", b.imageFormatsText, "格式,单张图片不超过", b.maxImageSize /
|
|
452
|
+
children: ["1. 支持", b.imageFormatsText, "格式,单张图片不超过", b.maxImageSize / Ge, "M;"]
|
|
453
453
|
}), /* @__PURE__ */ l("div", {
|
|
454
454
|
className: "item-upload-desc",
|
|
455
455
|
children: "2. 单次上传最多可选择100个文件。"
|
|
@@ -462,7 +462,7 @@ const st = (S) => {
|
|
|
462
462
|
children: [/* @__PURE__ */ l("div", {
|
|
463
463
|
className: "item-upload-desc item-upload-desc__1",
|
|
464
464
|
children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
|
|
465
|
-
}),
|
|
465
|
+
}), $ === "labeled" ? /* @__PURE__ */ l(pe, {
|
|
466
466
|
children: b.zipUploadTexts.labeled.description.map((i, t) => /* @__PURE__ */ d("div", {
|
|
467
467
|
className: "item-upload-desc",
|
|
468
468
|
children: [t + 2, ". ", i]
|
|
@@ -472,12 +472,12 @@ const st = (S) => {
|
|
|
472
472
|
children: ["2. ", b.zipUploadTexts.unlabeled.description[0]]
|
|
473
473
|
}), /* @__PURE__ */ d("div", {
|
|
474
474
|
className: "item-upload-desc",
|
|
475
|
-
children: [
|
|
475
|
+
children: [$ === "labeled" ? b.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
|
|
476
476
|
})]
|
|
477
477
|
})]
|
|
478
478
|
}), o === "image" && z.length ? /* @__PURE__ */ l("div", {
|
|
479
479
|
className: "picture-upload",
|
|
480
|
-
children: /* @__PURE__ */ l(
|
|
480
|
+
children: /* @__PURE__ */ l(De, {
|
|
481
481
|
listType: "picture-card",
|
|
482
482
|
fileList: z,
|
|
483
483
|
multiple: !0,
|
|
@@ -487,16 +487,16 @@ const st = (S) => {
|
|
|
487
487
|
beforeUpload: ke,
|
|
488
488
|
accept: xe,
|
|
489
489
|
onChange: Te,
|
|
490
|
-
children: z.length < 100 ?
|
|
490
|
+
children: z.length < 100 ? dl : null
|
|
491
491
|
})
|
|
492
492
|
}) : /* @__PURE__ */ l(pe, {}), o === "zip" && /* @__PURE__ */ d("div", {
|
|
493
493
|
className: "upload-wrapper",
|
|
494
|
-
children: [
|
|
494
|
+
children: [x != null && x.length ? /* @__PURE__ */ l("div", {
|
|
495
495
|
className: "upload-main",
|
|
496
496
|
children: /* @__PURE__ */ l(ue, {
|
|
497
497
|
gutter: [24, 8],
|
|
498
498
|
className: "upload-pannel",
|
|
499
|
-
children:
|
|
499
|
+
children: x.map((i) => /* @__PURE__ */ l(wl, {
|
|
500
500
|
span: 24,
|
|
501
501
|
className: "upload-item",
|
|
502
502
|
children: /* @__PURE__ */ d(ue, {
|
|
@@ -506,7 +506,7 @@ const st = (S) => {
|
|
|
506
506
|
align: "middle",
|
|
507
507
|
children: [/* @__PURE__ */ l("span", {
|
|
508
508
|
className: "upload-item-file-icon",
|
|
509
|
-
children: /* @__PURE__ */ l(
|
|
509
|
+
children: /* @__PURE__ */ l(Al, {})
|
|
510
510
|
}), /* @__PURE__ */ l("span", {
|
|
511
511
|
className: "upload-item-name",
|
|
512
512
|
children: i.name
|
|
@@ -515,8 +515,8 @@ const st = (S) => {
|
|
|
515
515
|
className: "upload-item-upload-delete",
|
|
516
516
|
type: "link",
|
|
517
517
|
disabled: _,
|
|
518
|
-
onClick: () =>
|
|
519
|
-
children: /* @__PURE__ */ l(
|
|
518
|
+
onClick: () => pl(i),
|
|
519
|
+
children: /* @__PURE__ */ l(Bl, {})
|
|
520
520
|
})]
|
|
521
521
|
})
|
|
522
522
|
}, i.uid))
|
|
@@ -525,7 +525,7 @@ const st = (S) => {
|
|
|
525
525
|
className: "upload-example",
|
|
526
526
|
children: [/* @__PURE__ */ l("div", {
|
|
527
527
|
className: "upload-example-header",
|
|
528
|
-
children: /* @__PURE__ */ d(
|
|
528
|
+
children: /* @__PURE__ */ d(Me, {
|
|
529
529
|
children: [/* @__PURE__ */ l("span", {
|
|
530
530
|
children: "数据示例:"
|
|
531
531
|
}), /* @__PURE__ */ l(j, {
|
|
@@ -535,7 +535,7 @@ const st = (S) => {
|
|
|
535
535
|
padding: 0
|
|
536
536
|
},
|
|
537
537
|
onClick: (i) => {
|
|
538
|
-
i.stopPropagation(),
|
|
538
|
+
i.stopPropagation(), ul();
|
|
539
539
|
},
|
|
540
540
|
children: "下载示例 >"
|
|
541
541
|
})]
|
|
@@ -543,7 +543,7 @@ const st = (S) => {
|
|
|
543
543
|
}), /* @__PURE__ */ l("div", {
|
|
544
544
|
className: "upload-example-main",
|
|
545
545
|
children: /* @__PURE__ */ l("img", {
|
|
546
|
-
src:
|
|
546
|
+
src: $ === "labeled" ? m === "vlm" ? kl : xl : m === "vlm" ? Tl : $l
|
|
547
547
|
})
|
|
548
548
|
})]
|
|
549
549
|
})]
|
|
@@ -558,12 +558,12 @@ const st = (S) => {
|
|
|
558
558
|
maskClosable: !1,
|
|
559
559
|
closable: o !== "image",
|
|
560
560
|
onCancel: () => {
|
|
561
|
-
|
|
561
|
+
Re();
|
|
562
562
|
},
|
|
563
563
|
footer: null,
|
|
564
564
|
children: /* @__PURE__ */ l("div", {
|
|
565
565
|
className: "upload-spin",
|
|
566
|
-
children: /* @__PURE__ */ l(
|
|
566
|
+
children: /* @__PURE__ */ l(El, {
|
|
567
567
|
tip: o === "image" ? `数据导入中(${te}/${z.length}),请耐心等待` : `处理中(${Se}/100%),请耐心等待`,
|
|
568
568
|
size: "large",
|
|
569
569
|
children: /* @__PURE__ */ l("div", {
|
|
@@ -580,11 +580,11 @@ const st = (S) => {
|
|
|
580
580
|
footer: null,
|
|
581
581
|
children: /* @__PURE__ */ l("div", {
|
|
582
582
|
className: "upload-result",
|
|
583
|
-
children: /* @__PURE__ */ l(
|
|
583
|
+
children: /* @__PURE__ */ l(Ke, {
|
|
584
584
|
status: "success",
|
|
585
|
-
title:
|
|
585
|
+
title: fl(o, oe, $, b, z, ie, He, m),
|
|
586
586
|
extra: [/* @__PURE__ */ l(j, {
|
|
587
|
-
onClick:
|
|
587
|
+
onClick: cl,
|
|
588
588
|
children: "关闭"
|
|
589
589
|
}, "close")]
|
|
590
590
|
})
|
|
@@ -598,11 +598,11 @@ const st = (S) => {
|
|
|
598
598
|
footer: null,
|
|
599
599
|
children: /* @__PURE__ */ l("div", {
|
|
600
600
|
className: "upload-result",
|
|
601
|
-
children: /* @__PURE__ */ l(
|
|
601
|
+
children: /* @__PURE__ */ l(Ke, {
|
|
602
602
|
status: "error",
|
|
603
603
|
title: "文件处理失败",
|
|
604
604
|
extra: [/* @__PURE__ */ l(j, {
|
|
605
|
-
onClick:
|
|
605
|
+
onClick: ml,
|
|
606
606
|
children: "关闭"
|
|
607
607
|
}, "close")]
|
|
608
608
|
})
|
|
@@ -611,5 +611,5 @@ const st = (S) => {
|
|
|
611
611
|
});
|
|
612
612
|
};
|
|
613
613
|
export {
|
|
614
|
-
|
|
614
|
+
nt as default
|
|
615
615
|
};
|