@glodon-aiot/dataset-annotation 3.10.0-alpha.17 → 3.10.0-alpha.18
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 +201 -203
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +43 -43
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +197 -188
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/package.json +2 -2
|
@@ -1,193 +1,191 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var ul = Object.defineProperty;
|
|
2
|
+
var Oe = Object.getOwnPropertySymbols;
|
|
3
|
+
var ml = Object.prototype.hasOwnProperty, fl = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Ve = (w, e, i) => e in w ? ul(w, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : w[e] = i, je = (w, e) => {
|
|
5
5
|
for (var i in e || (e = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var i of
|
|
9
|
-
|
|
10
|
-
return
|
|
6
|
+
ml.call(e, i) && Ve(w, i, e[i]);
|
|
7
|
+
if (Oe)
|
|
8
|
+
for (var i of Oe(e))
|
|
9
|
+
fl.call(e, i) && Ve(w, i, e[i]);
|
|
10
|
+
return w;
|
|
11
11
|
};
|
|
12
|
-
var ce = (
|
|
13
|
-
var
|
|
12
|
+
var ce = (w, e, i) => new Promise((m, K) => {
|
|
13
|
+
var Z = (E) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
15
|
+
U(i.next(E));
|
|
16
16
|
} catch (v) {
|
|
17
17
|
K(v);
|
|
18
18
|
}
|
|
19
|
-
}, h = (
|
|
19
|
+
}, h = (E) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
21
|
+
U(i.throw(E));
|
|
22
22
|
} catch (v) {
|
|
23
23
|
K(v);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, U = (E) => E.done ? m(E.value) : Promise.resolve(E.value).then(Z, h);
|
|
26
|
+
U((i = i.apply(w, e)).next());
|
|
27
27
|
});
|
|
28
28
|
import { jsxs as d, Fragment as de, jsx as l } from "react/jsx-runtime";
|
|
29
|
-
import { useContext as
|
|
30
|
-
import { Form as V, message as
|
|
29
|
+
import { useContext as hl, useState as r, useRef as gl, useEffect as O } from "react";
|
|
30
|
+
import { Form as V, message as R, Modal as H, Button as j, Radio as $, Tooltip as Cl, Space as Pe, Upload as Me, Row as pe, Col as bl, Spin as yl, Result as De } from "antd";
|
|
31
31
|
import "./style.less.mjs";
|
|
32
|
-
import { InfoCircleOutlined as zl, CloudUploadOutlined as wl, PaperClipOutlined as
|
|
33
|
-
import
|
|
34
|
-
import { initMinio as
|
|
35
|
-
import
|
|
32
|
+
import { InfoCircleOutlined as zl, CloudUploadOutlined as wl, PaperClipOutlined as Sl, DeleteOutlined as Nl, PlusOutlined as El } from "@ant-design/icons";
|
|
33
|
+
import vl from "browser-md5-file";
|
|
34
|
+
import { initMinio as Ke, putObjectBuffer as Ze } from "@glodon-aiot/minio";
|
|
35
|
+
import xl from "./pic_zip.svg.mjs";
|
|
36
36
|
import Fl from "./pic_zip_json.svg.mjs";
|
|
37
|
-
import
|
|
37
|
+
import Al from "./pic_vlm_json_zip.svg.mjs";
|
|
38
38
|
import Bl from "./pic_vlm_zip.svg.mjs";
|
|
39
|
-
import { MB as
|
|
40
|
-
import { fileSuffixToLowerCase as
|
|
41
|
-
import
|
|
42
|
-
import { EXAMPLE_SRC_ROOT as Ul
|
|
43
|
-
import { getImportConfig as
|
|
44
|
-
let f = 0, G = 0,
|
|
45
|
-
const
|
|
39
|
+
import { MB as _e, GB as kl } from "../../constant.mjs";
|
|
40
|
+
import { fileSuffixToLowerCase as Rl } from "../../utils/index.mjs";
|
|
41
|
+
import $l from "../../DatasetContext/index.mjs";
|
|
42
|
+
import { EXAMPLE_SRC_ROOT as Ul } from "../../featuresConfig.mjs";
|
|
43
|
+
import { getImportConfig as Tl } from "./config.mjs";
|
|
44
|
+
let f = 0, G = 0, P = 0, I = 0;
|
|
45
|
+
const st = (w) => {
|
|
46
46
|
const {
|
|
47
47
|
datasetIam: e,
|
|
48
48
|
datasetId: i,
|
|
49
49
|
currentVersion: m,
|
|
50
50
|
tenCode: K,
|
|
51
|
-
isVisible:
|
|
51
|
+
isVisible: Z,
|
|
52
52
|
markType: h,
|
|
53
|
-
setIsVisible:
|
|
54
|
-
getVersionListRequest:
|
|
53
|
+
setIsVisible: U,
|
|
54
|
+
getVersionListRequest: E,
|
|
55
55
|
onUploadStatusChange: v,
|
|
56
56
|
setIsConfirm: Q,
|
|
57
57
|
tableReload: ue,
|
|
58
58
|
loadVersionData: q,
|
|
59
59
|
actionAfterFinish: me
|
|
60
|
-
} =
|
|
60
|
+
} = w, {
|
|
61
61
|
services: {
|
|
62
62
|
cvforceDatahub: p
|
|
63
63
|
},
|
|
64
64
|
featuresConfig: {
|
|
65
|
-
exampleSrcRoot: fe
|
|
66
|
-
vlmExampleSrcRoot: he
|
|
65
|
+
exampleSrcRoot: fe
|
|
67
66
|
} = {
|
|
68
|
-
exampleSrcRoot: Ul
|
|
69
|
-
vlmExampleSrcRoot: Ll
|
|
67
|
+
exampleSrcRoot: Ul
|
|
70
68
|
}
|
|
71
|
-
} =
|
|
69
|
+
} = hl($l), [S, Ge] = r(0), [N, Ie] = r(0), [Y, qe] = r([]), [M, Je] = r(), [he, Ll] = r([]), [ee, J] = r(!1), [ge, le] = r(!1), [_, te] = r(!1), [se, We] = r(0), [Ce, Xe] = r(0), [W, be] = r(-1), [ie, Ol] = r([]), [ye, Vl] = r([]), [ze, ne] = r(!1), He = new vl(), [X] = V.useForm(), n = V.useWatch("acceptType", X), A = V.useWatch("labelState", X), [C, we] = r([]), [B, Se] = r([]), [k, Qe] = r(), [Ne, Ee] = r(0), [ve, xe] = r(!1), [jl, Fe] = r(""), [Ye, Ae] = r(!1), [Be, el] = r(
|
|
72
70
|
"unlabeled"
|
|
73
71
|
/* Unlabeled */
|
|
74
|
-
),
|
|
75
|
-
Dragger:
|
|
76
|
-
} =
|
|
72
|
+
), ae = gl(!0), {
|
|
73
|
+
Dragger: ll
|
|
74
|
+
} = Me, g = Tl(h), oe = g.imageMimeTypes, ke = g.imageAccept, re = g.maxImageSize;
|
|
77
75
|
O(() => {
|
|
78
|
-
f = 0, G = 0,
|
|
79
|
-
}, [
|
|
80
|
-
const
|
|
81
|
-
var
|
|
76
|
+
f = 0, G = 0, P = 0, I = 0, te(!1), Z && (ae.current = !1, q && q());
|
|
77
|
+
}, [Z]);
|
|
78
|
+
const Re = (t, s) => {
|
|
79
|
+
var a;
|
|
82
80
|
if (n === "image") {
|
|
83
81
|
ne(!0);
|
|
84
|
-
let
|
|
82
|
+
let o = 0;
|
|
85
83
|
if (f = f + 1, G = G + 1, s.length === 0)
|
|
86
84
|
return;
|
|
87
85
|
let u = 0;
|
|
88
|
-
const [...c] = s, y = window.URL || window.webkitURL,
|
|
89
|
-
|
|
86
|
+
const [...c] = s, y = window.URL || window.webkitURL, z = new Image();
|
|
87
|
+
z.src = y.createObjectURL(t), z.onload = () => {
|
|
90
88
|
Y.push({
|
|
91
89
|
name: t.name,
|
|
92
|
-
src:
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
95
|
-
}),
|
|
90
|
+
src: z.src,
|
|
91
|
+
width: z.width,
|
|
92
|
+
height: z.height
|
|
93
|
+
}), qe(Y);
|
|
96
94
|
}, s.map((x) => {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
}), c.length > 100 && c.splice(100, c.length),
|
|
100
|
-
const b =
|
|
95
|
+
const F = oe.some((L) => L === x.type), T = x.size <= re;
|
|
96
|
+
F ? T || (o = o + 1, c.splice(c.findIndex((L) => L.name === x.name), 1)) : (u = u + 1, c.splice(c.findIndex((L) => L.name === x.name), 1));
|
|
97
|
+
}), c.length > 100 && c.splice(100, c.length), Ge(u), Ie(o), G === s.length && (ne(!0), G = 0);
|
|
98
|
+
const b = oe.some((x) => x === t.type), D = t.size <= re;
|
|
101
99
|
if (b) {
|
|
102
100
|
if (!D)
|
|
103
101
|
return !1;
|
|
104
102
|
} else
|
|
105
103
|
return !1;
|
|
106
104
|
} else {
|
|
107
|
-
if (t.size > 2 *
|
|
108
|
-
return
|
|
109
|
-
const
|
|
110
|
-
if (n === "zip" &&
|
|
111
|
-
return
|
|
112
|
-
|
|
105
|
+
if (t.size > 2 * kl)
|
|
106
|
+
return R.error(`${t.name}文件总大小不能超过2G`), !1;
|
|
107
|
+
const o = (a = t.name) == null ? void 0 : a.substring(t.name.lastIndexOf("."));
|
|
108
|
+
if (n === "zip" && o !== ".zip")
|
|
109
|
+
return R.error("存在格式不正确的文件,已自动去除"), !1;
|
|
110
|
+
Se((u) => u.length >= 1 ? u : [...u, t]);
|
|
113
111
|
}
|
|
114
112
|
return !1;
|
|
115
113
|
};
|
|
116
114
|
O(() => {
|
|
117
|
-
ze !== !1 && (!
|
|
115
|
+
ze !== !1 && (!S && !N && !f || (f = f - I - S - N, f < 101 ? S > 0 && N > 0 ? (R.error(`${S + N}个文件添加失败,格式、大小或数量不符合要求`), f = f - S - N) : S > 0 && N === 0 ? R.error(`${S}个文件添加失败,格式不符合要求`) : S === 0 && N > 0 ? R.error(`${N}个文件添加失败,单张图片超过${g.maxImageSize / _e}M`) : S === 0 && N === 0 && R.success("校验成功") : S + N === 0 ? (R.error(`${f - 100}个文件添加失败,超过数量限制`), f = 100) : (R.error(`${f - 100 + S + N}个文件添加失败,格式、大小或数量不符合要求`), f = f < 101 ? f : 100), ne(!1)));
|
|
118
116
|
}, [ze]);
|
|
119
|
-
const
|
|
117
|
+
const tl = (t) => {
|
|
120
118
|
const s = t.originFileObj;
|
|
121
|
-
return new Promise((
|
|
122
|
-
|
|
123
|
-
u &&
|
|
119
|
+
return new Promise((a, o) => {
|
|
120
|
+
He.md5(s, (u, c) => {
|
|
121
|
+
u && o(u), il(c, s), a(c);
|
|
124
122
|
});
|
|
125
123
|
});
|
|
126
|
-
},
|
|
124
|
+
}, sl = () => ce(void 0, null, function* () {
|
|
127
125
|
if (!C)
|
|
128
126
|
return;
|
|
129
127
|
const t = [];
|
|
130
128
|
for (let s = 0; s < C.length; s++) {
|
|
131
|
-
const
|
|
132
|
-
t.push(
|
|
129
|
+
const a = C[s], o = yield tl(a);
|
|
130
|
+
t.push(o);
|
|
133
131
|
}
|
|
134
132
|
!i || t.length === 0 || p == null || p.getDeduplication(t, i).then((s) => {
|
|
135
|
-
Je(s),
|
|
133
|
+
Je(s), Ae(!1);
|
|
136
134
|
});
|
|
137
135
|
});
|
|
138
136
|
O(() => {
|
|
139
|
-
|
|
137
|
+
sl();
|
|
140
138
|
}, [C]);
|
|
141
|
-
const
|
|
142
|
-
s.md5 = t,
|
|
143
|
-
},
|
|
139
|
+
const il = (t, s) => {
|
|
140
|
+
s.md5 = t, he.push(s);
|
|
141
|
+
}, $e = ({
|
|
144
142
|
fileList: t
|
|
145
143
|
}) => {
|
|
146
144
|
if (n === "zip")
|
|
147
145
|
return;
|
|
148
|
-
|
|
149
|
-
const s = t.filter((
|
|
150
|
-
s.splice(100, s.length), s.length < C.length ? (we(s), I++) : (
|
|
146
|
+
Ae(!0);
|
|
147
|
+
const s = t.filter((a) => a.size && a.size <= re ? oe.some((o) => a.type === o) : !1);
|
|
148
|
+
s.splice(100, s.length), s.length < C.length ? (we(s), I++) : (P = P - I, I = 0, P++, P == s.length && we(s), P > s.length && (P = s.length));
|
|
151
149
|
}, Ue = () => {
|
|
152
|
-
n === "zip" && (
|
|
153
|
-
},
|
|
150
|
+
n === "zip" && (ae.current = !0), U(!1);
|
|
151
|
+
}, nl = () => {
|
|
154
152
|
if (n === "image") {
|
|
155
|
-
if (!
|
|
153
|
+
if (!M)
|
|
156
154
|
return;
|
|
157
155
|
let t = 0, s = 0;
|
|
158
|
-
if (
|
|
156
|
+
if (M.duplicated.length !== 0 && M.duplicated.map((a, o) => {
|
|
159
157
|
var y;
|
|
160
|
-
const u =
|
|
158
|
+
const u = M.duplicatedMd5[o], c = ((y = C.find((z) => {
|
|
161
159
|
var b;
|
|
162
|
-
return ((b =
|
|
160
|
+
return ((b = z.originFileObj) == null ? void 0 : b.md5) === u;
|
|
163
161
|
})) == null ? void 0 : y.name) || "";
|
|
164
162
|
ie.push({
|
|
165
163
|
labels: [],
|
|
166
|
-
fileKey:
|
|
164
|
+
fileKey: a,
|
|
167
165
|
sampleFileName: {
|
|
168
166
|
name: c
|
|
169
167
|
}
|
|
170
168
|
});
|
|
171
|
-
}),
|
|
172
|
-
const
|
|
173
|
-
const c =
|
|
169
|
+
}), M.unduplicated.length !== 0) {
|
|
170
|
+
const a = M.unduplicated.map((o) => new Promise((u) => {
|
|
171
|
+
const c = he.find((T) => T.md5 === o);
|
|
174
172
|
if (!c)
|
|
175
173
|
return u();
|
|
176
|
-
const y = c.name,
|
|
174
|
+
const y = c.name, z = y.substring(y.indexOf(".")), b = Y.find((T) => T.name === y), D = {
|
|
177
175
|
"Content-Type": "application/octet-stream",
|
|
178
176
|
"X-Amz-Meta-Width": b == null ? void 0 : b.width,
|
|
179
177
|
"X-Amz-Meta-Height": b == null ? void 0 : b.height
|
|
180
|
-
}, x = `dataset/${i}/sample/${
|
|
178
|
+
}, x = `dataset/${i}/sample/${o}${Rl(z)}`;
|
|
181
179
|
delete c.md5;
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
const F = new FileReader();
|
|
181
|
+
F.readAsArrayBuffer(c), F.onload = (T) => {
|
|
182
|
+
Ke({
|
|
185
183
|
endPoint: e == null ? void 0 : e.endpoints[0],
|
|
186
184
|
useSSL: e == null ? void 0 : e.useSSL,
|
|
187
185
|
accessKey: e == null ? void 0 : e.accessKey,
|
|
188
186
|
secretKey: e == null ? void 0 : e.secretKey
|
|
189
|
-
}), Ze(K, x,
|
|
190
|
-
|
|
187
|
+
}), Ze(K, x, T.target.result, D, (L, Pl) => {
|
|
188
|
+
J(!0), s += 1, L && (t += 1, Xe(t)), We(s), ye.push({
|
|
191
189
|
labels: [],
|
|
192
190
|
fileKey: `${K}/${x}`,
|
|
193
191
|
sampleFileName: {
|
|
@@ -197,13 +195,13 @@ const nt = (z) => {
|
|
|
197
195
|
});
|
|
198
196
|
};
|
|
199
197
|
}));
|
|
200
|
-
Promise.all(
|
|
198
|
+
Promise.all(a).then(() => {
|
|
201
199
|
!i || !m || setTimeout(() => {
|
|
202
200
|
p == null || p.postDatasetsIdVersionsVidSamples(i, m.id, {
|
|
203
|
-
samples:
|
|
201
|
+
samples: ye.concat(ie)
|
|
204
202
|
}).then(() => {
|
|
205
|
-
p.getDatasetsIdVersionsVid(i, m.id).then((
|
|
206
|
-
|
|
203
|
+
p.getDatasetsIdVersionsVid(i, m.id).then((o) => {
|
|
204
|
+
be(o.samplesCount - m.samplesCount);
|
|
207
205
|
}), Q(!0), v && v(!1);
|
|
208
206
|
});
|
|
209
207
|
}, 100);
|
|
@@ -214,92 +212,92 @@ const nt = (z) => {
|
|
|
214
212
|
p == null || p.postDatasetsIdVersionsVidSamples(i, m.id, {
|
|
215
213
|
samples: ie
|
|
216
214
|
}).then(() => {
|
|
217
|
-
p.getDatasetsIdVersionsVid(i, m.id).then((
|
|
218
|
-
|
|
215
|
+
p.getDatasetsIdVersionsVid(i, m.id).then((a) => {
|
|
216
|
+
be(a.samplesCount - m.samplesCount);
|
|
219
217
|
}), Q(!0), v && v(!1);
|
|
220
218
|
});
|
|
221
219
|
}
|
|
222
220
|
} else
|
|
223
|
-
al(
|
|
221
|
+
al(B);
|
|
224
222
|
}, al = (t) => {
|
|
225
|
-
!i || !m || t.map((s,
|
|
226
|
-
var
|
|
227
|
-
const
|
|
223
|
+
!i || !m || t.map((s, a) => {
|
|
224
|
+
var z;
|
|
225
|
+
const o = {
|
|
228
226
|
"Content-Type": "application/octet-stream"
|
|
229
227
|
}, u = {
|
|
230
228
|
endPoint: e == null ? void 0 : e.endpoints[0],
|
|
231
229
|
useSSL: e == null ? void 0 : e.useSSL,
|
|
232
230
|
accessKey: e == null ? void 0 : e.accessKey,
|
|
233
231
|
secretKey: e == null ? void 0 : e.secretKey
|
|
234
|
-
}, c = (e == null ? void 0 : e.prefix) + ((
|
|
232
|
+
}, c = (e == null ? void 0 : e.prefix) + ((z = t[0]) == null ? void 0 : z.name), y = new FileReader();
|
|
235
233
|
y.readAsArrayBuffer(s), y.onload = (b) => {
|
|
236
|
-
|
|
234
|
+
Ke(u), Ze(e == null ? void 0 : e.bucket, c, b.target.result, o, (D, x) => {
|
|
237
235
|
if (D)
|
|
238
236
|
console.log(D);
|
|
239
237
|
else {
|
|
240
|
-
if (
|
|
238
|
+
if (ae.current)
|
|
241
239
|
return;
|
|
242
|
-
|
|
240
|
+
J(!0), h === "vlm" ? p == null || p.postVlmUploadPicsZip(i, m.id, {
|
|
243
241
|
zipUrl: (e == null ? void 0 : e.bucket) + "/" + c,
|
|
244
|
-
type:
|
|
245
|
-
}).then((
|
|
246
|
-
|
|
247
|
-
}) : p == null || p.postUploadPicsZip(i, m.id,
|
|
242
|
+
type: A === "labeled" ? 2 : 1
|
|
243
|
+
}).then((F) => {
|
|
244
|
+
Te(F), Fe(F);
|
|
245
|
+
}) : p == null || p.postUploadPicsZip(i, m.id, je({
|
|
248
246
|
zipUrls: [(e == null ? void 0 : e.bucket) + "/" + c]
|
|
249
247
|
}, (h === "ocr" || h === "vlm") && {
|
|
250
|
-
type:
|
|
251
|
-
})).then((
|
|
252
|
-
|
|
248
|
+
type: A === "labeled" ? 1 : 0
|
|
249
|
+
})).then((F) => {
|
|
250
|
+
Te(F), Fe(F);
|
|
253
251
|
});
|
|
254
252
|
}
|
|
255
253
|
});
|
|
256
254
|
};
|
|
257
255
|
});
|
|
258
|
-
},
|
|
256
|
+
}, Te = (t) => ce(void 0, null, function* () {
|
|
259
257
|
var s;
|
|
260
258
|
if (!(!i || !m || !p))
|
|
261
259
|
try {
|
|
262
|
-
const
|
|
260
|
+
const a = yield p.checkFileResult(i, m.id, {
|
|
263
261
|
taskId: t
|
|
264
|
-
}, 5e3, h, (
|
|
265
|
-
|
|
262
|
+
}, 5e3, h, (o) => {
|
|
263
|
+
Ee(o);
|
|
266
264
|
});
|
|
267
|
-
|
|
268
|
-
} catch (
|
|
269
|
-
if (((s =
|
|
270
|
-
|
|
265
|
+
a && Qe(JSON.parse(a));
|
|
266
|
+
} catch (a) {
|
|
267
|
+
if (((s = a.cause) == null ? void 0 : s.code) === -101) {
|
|
268
|
+
xe(!0);
|
|
271
269
|
return;
|
|
272
270
|
}
|
|
273
271
|
}
|
|
274
272
|
});
|
|
275
273
|
O(() => {
|
|
276
|
-
|
|
277
|
-
}, [
|
|
274
|
+
k && (Ee(100), le(!0));
|
|
275
|
+
}, [k]), O(() => {
|
|
278
276
|
se !== 0 && (Q(!1), v && v(!0));
|
|
279
277
|
}, [se]), O(() => {
|
|
280
|
-
|
|
281
|
-
}, [
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
},
|
|
285
|
-
|
|
286
|
-
},
|
|
287
|
-
children: [/* @__PURE__ */ l(
|
|
278
|
+
W !== -1 && (le(!0), te(!1));
|
|
279
|
+
}, [W]);
|
|
280
|
+
const ol = () => {
|
|
281
|
+
Le(), le(!1), me && me();
|
|
282
|
+
}, Le = () => {
|
|
283
|
+
E(), J(!1), U(!1), ue && ue(), q && q();
|
|
284
|
+
}, rl = /* @__PURE__ */ d("div", {
|
|
285
|
+
children: [/* @__PURE__ */ l(El, {}), /* @__PURE__ */ l("div", {
|
|
288
286
|
style: {
|
|
289
287
|
marginTop: 8
|
|
290
288
|
},
|
|
291
289
|
children: "添加图片"
|
|
292
290
|
})]
|
|
293
|
-
}),
|
|
294
|
-
const s =
|
|
295
|
-
|
|
291
|
+
}), cl = (t) => {
|
|
292
|
+
const s = B.filter((a) => a.uid !== t.uid);
|
|
293
|
+
Se(s);
|
|
294
|
+
}, dl = () => {
|
|
295
|
+
A === "labeled" ? h === "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" : window.location.href = `${fe}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : h === "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 = `${fe}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
296
296
|
}, pl = () => {
|
|
297
|
-
|
|
298
|
-
}, ul = () => {
|
|
299
|
-
N(), Ae(!1), X(!1), T(!1);
|
|
297
|
+
E(), xe(!1), J(!1), U(!1);
|
|
300
298
|
};
|
|
301
299
|
return O(() => {
|
|
302
|
-
Be === "labeled" &&
|
|
300
|
+
Be === "labeled" && X.setFieldsValue({
|
|
303
301
|
labelFormat: g.labelFormat || "json",
|
|
304
302
|
acceptType: "zip"
|
|
305
303
|
/* Zip */
|
|
@@ -309,29 +307,29 @@ const nt = (z) => {
|
|
|
309
307
|
className: "upload-pics",
|
|
310
308
|
width: 600,
|
|
311
309
|
title: "导入数据",
|
|
312
|
-
open:
|
|
310
|
+
open: Z,
|
|
313
311
|
destroyOnClose: !0,
|
|
314
312
|
onCancel: () => Ue(),
|
|
315
313
|
maskClosable: !1,
|
|
316
314
|
centered: !0,
|
|
317
|
-
footer: [/* @__PURE__ */ l(
|
|
315
|
+
footer: [/* @__PURE__ */ l(j, {
|
|
318
316
|
onClick: Ue,
|
|
319
317
|
children: "取消"
|
|
320
|
-
}, "cancel"), /* @__PURE__ */ l(
|
|
318
|
+
}, "cancel"), /* @__PURE__ */ l(j, {
|
|
321
319
|
type: "primary",
|
|
322
320
|
htmlType: "submit",
|
|
323
321
|
form: "importModal",
|
|
324
|
-
disabled: n === "image" && !C.length || n === "zip" && !
|
|
325
|
-
loading:
|
|
322
|
+
disabled: n === "image" && !C.length || n === "zip" && !B.length || ee && Ne == 0 || Ye,
|
|
323
|
+
loading: _ == !0,
|
|
326
324
|
onClick: () => {
|
|
327
|
-
|
|
325
|
+
nl(), te(!0);
|
|
328
326
|
},
|
|
329
327
|
children: "导入"
|
|
330
328
|
}, "confirm")],
|
|
331
329
|
children: /* @__PURE__ */ d(V, {
|
|
332
330
|
className: "file-form",
|
|
333
331
|
preserve: !1,
|
|
334
|
-
form:
|
|
332
|
+
form: X,
|
|
335
333
|
initialValues: {
|
|
336
334
|
acceptType: "image",
|
|
337
335
|
labelState: "unlabeled"
|
|
@@ -351,17 +349,17 @@ const nt = (z) => {
|
|
|
351
349
|
required: !0,
|
|
352
350
|
message: "请选择数据标注状态"
|
|
353
351
|
}],
|
|
354
|
-
children: /* @__PURE__ */ d(
|
|
355
|
-
disabled:
|
|
352
|
+
children: /* @__PURE__ */ d($.Group, {
|
|
353
|
+
disabled: _,
|
|
356
354
|
onChange: (t) => {
|
|
357
|
-
|
|
355
|
+
el(t.target.value);
|
|
358
356
|
},
|
|
359
|
-
children: [/* @__PURE__ */ l(
|
|
357
|
+
children: [/* @__PURE__ */ l($, {
|
|
360
358
|
value: "unlabeled",
|
|
361
359
|
children: "无标注信息"
|
|
362
|
-
}), /* @__PURE__ */ d(
|
|
360
|
+
}), /* @__PURE__ */ d($, {
|
|
363
361
|
value: "labeled",
|
|
364
|
-
children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(
|
|
362
|
+
children: ["有标注信息", h === "vlm" && /* @__PURE__ */ l(Cl, {
|
|
365
363
|
title: "支持上传带OCR标注信息的数据",
|
|
366
364
|
children: /* @__PURE__ */ l(zl, {
|
|
367
365
|
style: {
|
|
@@ -373,16 +371,16 @@ const nt = (z) => {
|
|
|
373
371
|
})]
|
|
374
372
|
})]
|
|
375
373
|
})
|
|
376
|
-
}),
|
|
374
|
+
}), A === "labeled" && /* @__PURE__ */ l(V.Item, {
|
|
377
375
|
label: "标注格式",
|
|
378
376
|
name: "labelFormat",
|
|
379
377
|
rules: [{
|
|
380
378
|
required: !0,
|
|
381
379
|
message: "请选择标注格式"
|
|
382
380
|
}],
|
|
383
|
-
children: /* @__PURE__ */ l(
|
|
384
|
-
disabled:
|
|
385
|
-
children: /* @__PURE__ */ l(
|
|
381
|
+
children: /* @__PURE__ */ l($.Group, {
|
|
382
|
+
disabled: _,
|
|
383
|
+
children: /* @__PURE__ */ l($, {
|
|
386
384
|
value: g.labelFormat || "json",
|
|
387
385
|
children: g.labelFormat || "json"
|
|
388
386
|
})
|
|
@@ -394,38 +392,38 @@ const nt = (z) => {
|
|
|
394
392
|
required: !0,
|
|
395
393
|
message: "请选择导入方式"
|
|
396
394
|
}],
|
|
397
|
-
children: /* @__PURE__ */ d(
|
|
398
|
-
disabled:
|
|
399
|
-
children: [
|
|
395
|
+
children: /* @__PURE__ */ d($.Group, {
|
|
396
|
+
disabled: _,
|
|
397
|
+
children: [A !== "labeled" && /* @__PURE__ */ l($.Button, {
|
|
400
398
|
value: "image",
|
|
401
399
|
children: "上传图片"
|
|
402
|
-
}), /* @__PURE__ */ l(
|
|
400
|
+
}), /* @__PURE__ */ l($.Button, {
|
|
403
401
|
value: "zip",
|
|
404
402
|
children: "上传压缩包"
|
|
405
403
|
})]
|
|
406
404
|
})
|
|
407
405
|
}), /* @__PURE__ */ d("div", {
|
|
408
406
|
className: "file-upload",
|
|
409
|
-
children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(
|
|
407
|
+
children: [(n === "image" && !C.length || n === "zip") && /* @__PURE__ */ d(ll, {
|
|
410
408
|
name: "file",
|
|
411
409
|
showUploadList: !1,
|
|
412
410
|
multiple: !0,
|
|
413
|
-
beforeUpload:
|
|
414
|
-
accept: n === "zip" ? ".zip" :
|
|
411
|
+
beforeUpload: Re,
|
|
412
|
+
accept: n === "zip" ? ".zip" : ke,
|
|
415
413
|
maxCount: n === "zip" ? 1 : void 0,
|
|
416
|
-
onChange:
|
|
417
|
-
disabled: n === "zip" ?
|
|
414
|
+
onChange: $e,
|
|
415
|
+
disabled: n === "zip" ? B.length === 1 : !1,
|
|
418
416
|
children: [/* @__PURE__ */ l("span", {
|
|
419
417
|
className: "file-upload-icon",
|
|
420
418
|
children: /* @__PURE__ */ l(wl, {})
|
|
421
|
-
}), /* @__PURE__ */ d(
|
|
419
|
+
}), /* @__PURE__ */ d(Pe, {
|
|
422
420
|
className: "file-upload-action",
|
|
423
|
-
children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ l(
|
|
421
|
+
children: [n === "image" && "拖拽图片至此,或者", n === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ l(j, {
|
|
424
422
|
type: "link",
|
|
425
423
|
style: {
|
|
426
424
|
padding: 0
|
|
427
425
|
},
|
|
428
|
-
disabled: n === "zip" ?
|
|
426
|
+
disabled: n === "zip" ? B.length === 1 : !1,
|
|
429
427
|
children: n === "image" ? "上传图片" : "上传压缩包"
|
|
430
428
|
})]
|
|
431
429
|
}), n === "image" && /* @__PURE__ */ d("div", {
|
|
@@ -435,7 +433,7 @@ const nt = (z) => {
|
|
|
435
433
|
},
|
|
436
434
|
children: [/* @__PURE__ */ d("div", {
|
|
437
435
|
className: "item-upload-desc item-upload-desc__1",
|
|
438
|
-
children: ["1. 支持", g.imageFormatsText, "格式,单张图片不超过", g.maxImageSize /
|
|
436
|
+
children: ["1. 支持", g.imageFormatsText, "格式,单张图片不超过", g.maxImageSize / _e, "M;"]
|
|
439
437
|
}), /* @__PURE__ */ l("div", {
|
|
440
438
|
className: "item-upload-desc",
|
|
441
439
|
children: "2. 单次上传最多可选择100个文件。"
|
|
@@ -448,7 +446,7 @@ const nt = (z) => {
|
|
|
448
446
|
children: [/* @__PURE__ */ l("div", {
|
|
449
447
|
className: "item-upload-desc item-upload-desc__1",
|
|
450
448
|
children: "1. 仅支持.zip格式,单个压缩包不超过2G;"
|
|
451
|
-
}),
|
|
449
|
+
}), A === "labeled" ? /* @__PURE__ */ l(de, {
|
|
452
450
|
children: g.zipUploadTexts.labeled.description.map((t, s) => /* @__PURE__ */ d("div", {
|
|
453
451
|
className: "item-upload-desc",
|
|
454
452
|
children: [s + 2, ". ", t]
|
|
@@ -458,31 +456,31 @@ const nt = (z) => {
|
|
|
458
456
|
children: ["2. ", g.zipUploadTexts.unlabeled.description[0]]
|
|
459
457
|
}), /* @__PURE__ */ d("div", {
|
|
460
458
|
className: "item-upload-desc",
|
|
461
|
-
children: [
|
|
459
|
+
children: [A === "labeled" ? g.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
|
|
462
460
|
})]
|
|
463
461
|
})]
|
|
464
462
|
}), n === "image" && C.length ? /* @__PURE__ */ l("div", {
|
|
465
463
|
className: "picture-upload",
|
|
466
|
-
children: /* @__PURE__ */ l(
|
|
464
|
+
children: /* @__PURE__ */ l(Me, {
|
|
467
465
|
listType: "picture-card",
|
|
468
466
|
fileList: C,
|
|
469
467
|
multiple: !0,
|
|
470
468
|
showUploadList: {
|
|
471
469
|
showPreviewIcon: !1
|
|
472
470
|
},
|
|
473
|
-
beforeUpload:
|
|
474
|
-
accept:
|
|
475
|
-
onChange:
|
|
476
|
-
children: C.length < 100 ?
|
|
471
|
+
beforeUpload: Re,
|
|
472
|
+
accept: ke,
|
|
473
|
+
onChange: $e,
|
|
474
|
+
children: C.length < 100 ? rl : null
|
|
477
475
|
})
|
|
478
476
|
}) : /* @__PURE__ */ l(de, {}), n === "zip" && /* @__PURE__ */ d("div", {
|
|
479
477
|
className: "upload-wrapper",
|
|
480
|
-
children: [
|
|
478
|
+
children: [B != null && B.length ? /* @__PURE__ */ l("div", {
|
|
481
479
|
className: "upload-main",
|
|
482
480
|
children: /* @__PURE__ */ l(pe, {
|
|
483
481
|
gutter: [24, 8],
|
|
484
482
|
className: "upload-pannel",
|
|
485
|
-
children:
|
|
483
|
+
children: B.map((t) => /* @__PURE__ */ l(bl, {
|
|
486
484
|
span: 24,
|
|
487
485
|
className: "upload-item",
|
|
488
486
|
children: /* @__PURE__ */ d(pe, {
|
|
@@ -492,16 +490,16 @@ const nt = (z) => {
|
|
|
492
490
|
align: "middle",
|
|
493
491
|
children: [/* @__PURE__ */ l("span", {
|
|
494
492
|
className: "upload-item-file-icon",
|
|
495
|
-
children: /* @__PURE__ */ l(
|
|
493
|
+
children: /* @__PURE__ */ l(Sl, {})
|
|
496
494
|
}), /* @__PURE__ */ l("span", {
|
|
497
495
|
className: "upload-item-name",
|
|
498
496
|
children: t.name
|
|
499
497
|
})]
|
|
500
|
-
}), /* @__PURE__ */ l(
|
|
498
|
+
}), /* @__PURE__ */ l(j, {
|
|
501
499
|
className: "upload-item-upload-delete",
|
|
502
500
|
type: "link",
|
|
503
|
-
disabled:
|
|
504
|
-
onClick: () =>
|
|
501
|
+
disabled: _,
|
|
502
|
+
onClick: () => cl(t),
|
|
505
503
|
children: /* @__PURE__ */ l(Nl, {})
|
|
506
504
|
})]
|
|
507
505
|
})
|
|
@@ -511,17 +509,17 @@ const nt = (z) => {
|
|
|
511
509
|
className: "upload-example",
|
|
512
510
|
children: [/* @__PURE__ */ l("div", {
|
|
513
511
|
className: "upload-example-header",
|
|
514
|
-
children: /* @__PURE__ */ d(
|
|
512
|
+
children: /* @__PURE__ */ d(Pe, {
|
|
515
513
|
children: [/* @__PURE__ */ l("span", {
|
|
516
514
|
children: "数据示例:"
|
|
517
|
-
}), /* @__PURE__ */ l(
|
|
515
|
+
}), /* @__PURE__ */ l(j, {
|
|
518
516
|
size: "small",
|
|
519
517
|
type: "link",
|
|
520
518
|
style: {
|
|
521
519
|
padding: 0
|
|
522
520
|
},
|
|
523
521
|
onClick: (t) => {
|
|
524
|
-
t.stopPropagation(),
|
|
522
|
+
t.stopPropagation(), dl();
|
|
525
523
|
},
|
|
526
524
|
children: "下载示例 >"
|
|
527
525
|
})]
|
|
@@ -529,7 +527,7 @@ const nt = (z) => {
|
|
|
529
527
|
}), /* @__PURE__ */ l("div", {
|
|
530
528
|
className: "upload-example-main",
|
|
531
529
|
children: /* @__PURE__ */ l("img", {
|
|
532
|
-
src:
|
|
530
|
+
src: A === "labeled" ? h === "vlm" ? Al : Fl : h === "vlm" ? Bl : xl
|
|
533
531
|
})
|
|
534
532
|
})]
|
|
535
533
|
})]
|
|
@@ -544,12 +542,12 @@ const nt = (z) => {
|
|
|
544
542
|
maskClosable: !1,
|
|
545
543
|
closable: n !== "image",
|
|
546
544
|
onCancel: () => {
|
|
547
|
-
|
|
545
|
+
Le();
|
|
548
546
|
},
|
|
549
547
|
footer: null,
|
|
550
548
|
children: /* @__PURE__ */ l("div", {
|
|
551
549
|
className: "upload-spin",
|
|
552
|
-
children: /* @__PURE__ */ l(
|
|
550
|
+
children: /* @__PURE__ */ l(yl, {
|
|
553
551
|
tip: n === "image" ? `数据导入中(${se}/${C.length}),请耐心等待` : `处理中(${Ne}/100%),请耐心等待`,
|
|
554
552
|
size: "large",
|
|
555
553
|
children: /* @__PURE__ */ l("div", {
|
|
@@ -557,38 +555,38 @@ const nt = (z) => {
|
|
|
557
555
|
})
|
|
558
556
|
})
|
|
559
557
|
})
|
|
560
|
-
}),
|
|
558
|
+
}), ge && /* @__PURE__ */ l(H, {
|
|
561
559
|
className: "result",
|
|
562
560
|
width: 424,
|
|
563
561
|
title: null,
|
|
564
|
-
open:
|
|
562
|
+
open: ge,
|
|
565
563
|
closable: !1,
|
|
566
564
|
footer: null,
|
|
567
565
|
children: /* @__PURE__ */ l("div", {
|
|
568
566
|
className: "upload-result",
|
|
569
|
-
children: /* @__PURE__ */ l(
|
|
567
|
+
children: /* @__PURE__ */ l(De, {
|
|
570
568
|
status: "success",
|
|
571
|
-
title: n === "image" ? `数据导入完成,成功${
|
|
572
|
-
extra: [/* @__PURE__ */ l(
|
|
573
|
-
onClick:
|
|
569
|
+
title: n === "image" ? `数据导入完成,成功${W}个,失败${Ce}个,去重${C.length - W - Ce}个` : k && `数据导入完成,格式不符合的图片${k.formatErrorCount || 0}个,成功${k.successCount || 0}个,去重${k.repeatCount || 0}个,失败${k.failedCount || 0}个` + (A === "labeled" ? `(${(g.labelFormat || "json").toUpperCase()}格式不符合${k.labelErrorCount}个)` : ""),
|
|
570
|
+
extra: [/* @__PURE__ */ l(j, {
|
|
571
|
+
onClick: ol,
|
|
574
572
|
children: "关闭"
|
|
575
573
|
}, "close")]
|
|
576
574
|
})
|
|
577
575
|
})
|
|
578
|
-
}),
|
|
576
|
+
}), ve && /* @__PURE__ */ l(H, {
|
|
579
577
|
className: "result",
|
|
580
578
|
width: 424,
|
|
581
579
|
title: null,
|
|
582
|
-
open:
|
|
580
|
+
open: ve,
|
|
583
581
|
closable: !1,
|
|
584
582
|
footer: null,
|
|
585
583
|
children: /* @__PURE__ */ l("div", {
|
|
586
584
|
className: "upload-result",
|
|
587
|
-
children: /* @__PURE__ */ l(
|
|
585
|
+
children: /* @__PURE__ */ l(De, {
|
|
588
586
|
status: "error",
|
|
589
587
|
title: "文件处理失败",
|
|
590
|
-
extra: [/* @__PURE__ */ l(
|
|
591
|
-
onClick:
|
|
588
|
+
extra: [/* @__PURE__ */ l(j, {
|
|
589
|
+
onClick: pl,
|
|
592
590
|
children: "关闭"
|
|
593
591
|
}, "close")]
|
|
594
592
|
})
|
|
@@ -597,5 +595,5 @@ const nt = (z) => {
|
|
|
597
595
|
});
|
|
598
596
|
};
|
|
599
597
|
export {
|
|
600
|
-
|
|
598
|
+
st as default
|
|
601
599
|
};
|