@glodon-aiot/dataset-annotation 3.19.1 → 3.19.2-alpha.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/config.mjs +17 -7
- package/dist/es/components/PicZipImportModal/index.mjs +142 -142
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +93 -91
- package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +17 -16
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +341 -318
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +199 -184
- package/dist/es/components/VLMAnnotationDetail/index.mjs +67 -66
- package/dist/es/components/VQAAnnotation/VQAAnnotationPanel.mjs +69 -0
- package/dist/es/components/VQAAnnotation/index.mjs +80 -0
- package/dist/es/components/VQAAnnotation/style.less.mjs +4 -0
- package/dist/es/index.mjs +9 -7
- package/dist/lib/index.js +4 -4
- package/dist/src/components/PicZipImportModal/config.d.ts +2 -1
- package/dist/src/components/VLMAnnotation/types.d.ts +2 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +1 -0
- package/dist/src/components/VQAAnnotation/VQAAnnotationPanel.d.ts +12 -0
- package/dist/src/components/VQAAnnotation/index.d.ts +38 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
var zl = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var Ze = (A, l, s) => l in A ? zl(A, l, { enumerable: !0, configurable: !0, writable: !0, value: s }) : A[l] = s,
|
|
2
|
+
var Pe = Object.getOwnPropertySymbols;
|
|
3
|
+
var Bl = Object.prototype.hasOwnProperty, yl = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var Ze = (A, l, s) => l in A ? zl(A, l, { enumerable: !0, configurable: !0, writable: !0, value: s }) : A[l] = s, _e = (A, l) => {
|
|
5
5
|
for (var s in l || (l = {}))
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
for (var s of
|
|
9
|
-
|
|
6
|
+
Bl.call(l, s) && Ze(A, s, l[s]);
|
|
7
|
+
if (Pe)
|
|
8
|
+
for (var s of Pe(l))
|
|
9
|
+
yl.call(l, s) && Ze(A, s, l[s]);
|
|
10
10
|
return A;
|
|
11
11
|
};
|
|
12
|
-
var ge = (A, l, s) => new Promise((g,
|
|
13
|
-
var
|
|
12
|
+
var ge = (A, l, s) => new Promise((g, Z) => {
|
|
13
|
+
var _ = (S) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
U(s.next(S));
|
|
16
|
+
} catch (D) {
|
|
17
|
+
Z(D);
|
|
18
18
|
}
|
|
19
19
|
}, c = (S) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
U(s.throw(S));
|
|
22
|
+
} catch (D) {
|
|
23
|
+
Z(D);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, U = (S) => S.done ? g(S.value) : Promise.resolve(S.value).then(_, c);
|
|
26
|
+
U((s = s.apply(A, l)).next());
|
|
27
27
|
});
|
|
28
|
-
import { jsxs as d, Fragment as
|
|
29
|
-
import { useContext as Al, useState as p, useRef as Sl, useEffect as
|
|
30
|
-
import { Form as L, message as T, Modal as
|
|
28
|
+
import { jsxs as d, Fragment as Q, jsx as e } from "react/jsx-runtime";
|
|
29
|
+
import { useContext as Al, useState as p, useRef as Sl, useEffect as V } from "react";
|
|
30
|
+
import { Form as L, message as T, Modal as H, Button as R, Radio as N, Tooltip as vl, Space as Ke, Upload as Ie, Row as be, Col as Fl, Spin as Nl, Result as Ge } from "antd";
|
|
31
31
|
import "./style.less.mjs";
|
|
32
32
|
import { InfoCircleOutlined as $l, CloudUploadOutlined as xl, PaperClipOutlined as jl, DeleteOutlined as kl, PlusOutlined as Ll } from "@ant-design/icons";
|
|
33
33
|
import Tl from "browser-md5-file";
|
|
34
34
|
import { initMinio as qe, putObjectBuffer as We } from "@glodon-aiot/minio";
|
|
35
35
|
import Ul from "./pic_zip.svg.mjs";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
36
|
+
import Vl from "./pic_zip_json.svg.mjs";
|
|
37
|
+
import Rl from "./pic_vlm_json_zip.svg.mjs";
|
|
38
38
|
import Ol from "./pic_vlm_zip.svg.mjs";
|
|
39
|
-
import
|
|
39
|
+
import Dl from "./pic_vlm_dwg_zip.svg.mjs";
|
|
40
40
|
import { MB as Je, GB as Xe } from "../../constant.mjs";
|
|
41
|
-
import { fileSuffixToLowerCase as
|
|
42
|
-
import
|
|
41
|
+
import { fileSuffixToLowerCase as Ml } from "../../utils/index.mjs";
|
|
42
|
+
import Pl from "../../DatasetContext/index.mjs";
|
|
43
43
|
import { EXAMPLE_SRC_ROOT as Zl } from "../../featuresConfig.mjs";
|
|
44
|
-
import { getImportConfig as
|
|
45
|
-
let C = 0, G = 0,
|
|
46
|
-
const
|
|
44
|
+
import { getImportConfig as _l } from "./config.mjs";
|
|
45
|
+
let C = 0, G = 0, O = 0, q = 0;
|
|
46
|
+
const mt = (A) => {
|
|
47
47
|
const {
|
|
48
48
|
datasetIam: l,
|
|
49
49
|
datasetId: s,
|
|
50
50
|
currentVersion: g,
|
|
51
|
-
tenCode:
|
|
52
|
-
isVisible:
|
|
51
|
+
tenCode: Z,
|
|
52
|
+
isVisible: _,
|
|
53
53
|
markType: c,
|
|
54
|
-
vlmMarkTmpl:
|
|
54
|
+
vlmMarkTmpl: U,
|
|
55
55
|
setIsVisible: S,
|
|
56
|
-
getVersionListRequest:
|
|
57
|
-
onUploadStatusChange:
|
|
56
|
+
getVersionListRequest: D,
|
|
57
|
+
onUploadStatusChange: M,
|
|
58
58
|
setIsConfirm: Y,
|
|
59
59
|
tableReload: Ce,
|
|
60
60
|
loadVersionData: W,
|
|
61
61
|
actionAfterFinish: Ee,
|
|
62
|
-
vlmDwgImport:
|
|
62
|
+
vlmDwgImport: Qe = !1
|
|
63
63
|
} = A, {
|
|
64
64
|
services: {
|
|
65
|
-
cvforceDatahub:
|
|
65
|
+
cvforceDatahub: m
|
|
66
66
|
},
|
|
67
67
|
featuresConfig: {
|
|
68
68
|
exampleSrcRoot: we
|
|
69
69
|
} = {
|
|
70
70
|
exampleSrcRoot: Zl
|
|
71
71
|
}
|
|
72
|
-
} = Al(
|
|
72
|
+
} = Al(Pl), [v, He] = p(0), [F, Ye] = p(0), [ee, el] = p([]), [P, ll] = p(), [ze, Kl] = p([]), [le, J] = p(!1), [Be, te] = p(!1), [K, ie] = p(!1), [se, tl] = p(0), [il, sl] = p(0), [ne, ye] = p(-1), [ae, Il] = p([]), [Ae, Gl] = p([]), [Se, oe] = p(!1), nl = new Tl(), [I] = L.useForm(), r = L.useWatch("acceptType", I), $ = L.useWatch("labelState", I), re = L.useWatch("labelFormat", I), [B, ce] = p([]), [x, de] = p([]), [pe, al] = p(), [ve, Fe] = p(0), [Ne, $e] = p(!1), [ql, xe] = p(""), [ol, je] = p(!1), [ke, rl] = p(
|
|
73
73
|
"unlabeled"
|
|
74
74
|
/* Unlabeled */
|
|
75
|
-
),
|
|
75
|
+
), me = Sl(!0), {
|
|
76
76
|
Dragger: cl
|
|
77
|
-
} = Ie,
|
|
78
|
-
|
|
79
|
-
C = 0, G = 0,
|
|
80
|
-
}, [
|
|
77
|
+
} = Ie, u = _l(c, re, U), ue = u.imageMimeTypes, Le = u.imageAccept, fe = u.maxImageSize;
|
|
78
|
+
V(() => {
|
|
79
|
+
C = 0, G = 0, O = 0, q = 0, ie(!1), _ && (me.current = !1, W && W());
|
|
80
|
+
}, [_]);
|
|
81
81
|
const Te = (i, t) => {
|
|
82
82
|
var a;
|
|
83
83
|
if (r === "image") {
|
|
@@ -95,17 +95,17 @@ const ut = (A) => {
|
|
|
95
95
|
height: E.height
|
|
96
96
|
}), el(ee);
|
|
97
97
|
}, t.map((w) => {
|
|
98
|
-
const z =
|
|
99
|
-
z ? k || (o = o + 1, n.splice(n.findIndex((
|
|
100
|
-
}), n.length > 100 && n.splice(100, n.length),
|
|
101
|
-
const h =
|
|
98
|
+
const z = ue.some((y) => y === w.type), k = w.size <= fe;
|
|
99
|
+
z ? k || (o = o + 1, n.splice(n.findIndex((y) => y.name === w.name), 1)) : (f = f + 1, n.splice(n.findIndex((y) => y.name === w.name), 1));
|
|
100
|
+
}), n.length > 100 && n.splice(100, n.length), He(f), Ye(o), G === t.length && (oe(!0), G = 0);
|
|
101
|
+
const h = ue.some((w) => w === i.type), j = i.size <= fe;
|
|
102
102
|
if (h) {
|
|
103
103
|
if (!j)
|
|
104
104
|
return !1;
|
|
105
105
|
} else
|
|
106
106
|
return !1;
|
|
107
107
|
} else {
|
|
108
|
-
const o =
|
|
108
|
+
const o = u.maxZipSize;
|
|
109
109
|
if (i.size > o)
|
|
110
110
|
return T.error(`${i.name}文件总大小不能超过${o / Xe}G`), !1;
|
|
111
111
|
const f = (a = i.name) == null ? void 0 : a.substring(i.name.lastIndexOf("."));
|
|
@@ -115,32 +115,32 @@ const ut = (A) => {
|
|
|
115
115
|
}
|
|
116
116
|
return !1;
|
|
117
117
|
};
|
|
118
|
-
|
|
119
|
-
Se !== !1 && (!v && !F && !C || (C = C - q - v - F, C < 101 ? v > 0 && F > 0 ? (T.error(`${v + F}个文件添加失败,格式、大小或数量不符合要求`), C = C - v - F) : v > 0 && F === 0 ? T.error(`${v}个文件添加失败,格式不符合要求`) : v === 0 && F > 0 ? T.error(`${F}个文件添加失败,单张图片超过${
|
|
118
|
+
V(() => {
|
|
119
|
+
Se !== !1 && (!v && !F && !C || (C = C - q - v - F, C < 101 ? v > 0 && F > 0 ? (T.error(`${v + F}个文件添加失败,格式、大小或数量不符合要求`), C = C - v - F) : v > 0 && F === 0 ? T.error(`${v}个文件添加失败,格式不符合要求`) : v === 0 && F > 0 ? T.error(`${F}个文件添加失败,单张图片超过${u.maxImageSize / Je}M`) : v === 0 && F === 0 && T.success("校验成功") : v + F === 0 ? (T.error(`${C - 100}个文件添加失败,超过数量限制`), C = 100) : (T.error(`${C - 100 + v + F}个文件添加失败,格式、大小或数量不符合要求`), C = C < 101 ? C : 100), oe(!1)));
|
|
120
120
|
}, [Se]);
|
|
121
121
|
const dl = (i) => {
|
|
122
122
|
const t = i.originFileObj;
|
|
123
123
|
return new Promise((a, o) => {
|
|
124
124
|
nl.md5(t, (f, n) => {
|
|
125
|
-
f && o(f),
|
|
125
|
+
f && o(f), ml(n, t), a(n);
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
}, pl = () => ge(void 0, null, function* () {
|
|
129
|
-
if (!
|
|
129
|
+
if (!B)
|
|
130
130
|
return;
|
|
131
131
|
const i = [];
|
|
132
|
-
for (let t = 0; t <
|
|
133
|
-
const a =
|
|
132
|
+
for (let t = 0; t < B.length; t++) {
|
|
133
|
+
const a = B[t], o = yield dl(a);
|
|
134
134
|
i.push(o);
|
|
135
135
|
}
|
|
136
|
-
!s || i.length === 0 ||
|
|
136
|
+
!s || i.length === 0 || m == null || m.getDeduplication(i, s).then((t) => {
|
|
137
137
|
ll(t), je(!1);
|
|
138
138
|
});
|
|
139
139
|
});
|
|
140
|
-
|
|
140
|
+
V(() => {
|
|
141
141
|
pl();
|
|
142
|
-
}, [
|
|
143
|
-
const
|
|
142
|
+
}, [B]);
|
|
143
|
+
const ml = (i, t) => {
|
|
144
144
|
t.md5 = i, ze.push(t);
|
|
145
145
|
}, Ue = ({
|
|
146
146
|
fileList: i
|
|
@@ -148,18 +148,18 @@ const ut = (A) => {
|
|
|
148
148
|
if (r === "zip")
|
|
149
149
|
return;
|
|
150
150
|
je(!0);
|
|
151
|
-
const t = i.filter((a) => a.size && a.size <= fe ?
|
|
152
|
-
t.splice(100, t.length), t.length <
|
|
153
|
-
},
|
|
154
|
-
r === "zip" && (
|
|
155
|
-
},
|
|
151
|
+
const t = i.filter((a) => a.size && a.size <= fe ? ue.some((o) => a.type === o) : !1);
|
|
152
|
+
t.splice(100, t.length), t.length < B.length ? (ce(t), q++) : (O = O - q, q = 0, O++, O == t.length && ce(t), O > t.length && (O = t.length));
|
|
153
|
+
}, Ve = () => {
|
|
154
|
+
r === "zip" && (me.current = !0), S(!1);
|
|
155
|
+
}, ul = () => {
|
|
156
156
|
if (r === "image") {
|
|
157
|
-
if (!
|
|
157
|
+
if (!P)
|
|
158
158
|
return;
|
|
159
159
|
let i = 0, t = 0;
|
|
160
|
-
if (
|
|
160
|
+
if (P.duplicated.length !== 0 && P.duplicated.map((a, o) => {
|
|
161
161
|
var b;
|
|
162
|
-
const f =
|
|
162
|
+
const f = P.duplicatedMd5[o], n = ((b = B.find((E) => {
|
|
163
163
|
var h;
|
|
164
164
|
return ((h = E.originFileObj) == null ? void 0 : h.md5) === f;
|
|
165
165
|
})) == null ? void 0 : b.name) || "";
|
|
@@ -170,8 +170,8 @@ const ut = (A) => {
|
|
|
170
170
|
name: n
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
|
-
}),
|
|
174
|
-
const a =
|
|
173
|
+
}), P.unduplicated.length !== 0) {
|
|
174
|
+
const a = P.unduplicated.map((o) => new Promise((f) => {
|
|
175
175
|
const n = ze.find((k) => k.md5 === o);
|
|
176
176
|
if (!n)
|
|
177
177
|
return f();
|
|
@@ -179,7 +179,7 @@ const ut = (A) => {
|
|
|
179
179
|
"Content-Type": "application/octet-stream",
|
|
180
180
|
"X-Amz-Meta-Width": h == null ? void 0 : h.width,
|
|
181
181
|
"X-Amz-Meta-Height": h == null ? void 0 : h.height
|
|
182
|
-
}, w = `dataset/${s}/sample/${o}${
|
|
182
|
+
}, w = `dataset/${s}/sample/${o}${Ml(E)}`;
|
|
183
183
|
delete n.md5;
|
|
184
184
|
const z = new FileReader();
|
|
185
185
|
z.readAsArrayBuffer(n), z.onload = (k) => {
|
|
@@ -188,10 +188,10 @@ const ut = (A) => {
|
|
|
188
188
|
useSSL: l == null ? void 0 : l.useSSL,
|
|
189
189
|
accessKey: l == null ? void 0 : l.accessKey,
|
|
190
190
|
secretKey: l == null ? void 0 : l.secretKey
|
|
191
|
-
}), We(
|
|
192
|
-
J(!0), t += 1,
|
|
191
|
+
}), We(Z, w, k.target.result, j, (y, X) => {
|
|
192
|
+
J(!0), t += 1, y && (i += 1, sl(i)), tl(t), Ae.push({
|
|
193
193
|
labels: [],
|
|
194
|
-
fileKey: `${
|
|
194
|
+
fileKey: `${Z}/${w}`,
|
|
195
195
|
sampleFileName: {
|
|
196
196
|
name: b
|
|
197
197
|
}
|
|
@@ -201,24 +201,24 @@ const ut = (A) => {
|
|
|
201
201
|
}));
|
|
202
202
|
Promise.all(a).then(() => {
|
|
203
203
|
!s || !g || setTimeout(() => {
|
|
204
|
-
|
|
204
|
+
m == null || m.postDatasetsIdVersionsVidSamples(s, g.id, {
|
|
205
205
|
samples: Ae.concat(ae)
|
|
206
206
|
}).then(() => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}), Y(!0),
|
|
207
|
+
m.getDatasetsIdVersionsVid(s, g.id).then((o) => {
|
|
208
|
+
ye(o.samplesCount - g.samplesCount);
|
|
209
|
+
}), Y(!0), M && M(!1);
|
|
210
210
|
});
|
|
211
211
|
}, 100);
|
|
212
212
|
});
|
|
213
213
|
} else {
|
|
214
214
|
if (!s || !g)
|
|
215
215
|
return;
|
|
216
|
-
|
|
216
|
+
m == null || m.postDatasetsIdVersionsVidSamples(s, g.id, {
|
|
217
217
|
samples: ae
|
|
218
218
|
}).then(() => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}), Y(!0),
|
|
219
|
+
m.getDatasetsIdVersionsVid(s, g.id).then((a) => {
|
|
220
|
+
ye(a.samplesCount - g.samplesCount);
|
|
221
|
+
}), Y(!0), M && M(!1);
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
} else
|
|
@@ -239,29 +239,29 @@ const ut = (A) => {
|
|
|
239
239
|
if (j)
|
|
240
240
|
console.log(j);
|
|
241
241
|
else {
|
|
242
|
-
if (
|
|
242
|
+
if (me.current)
|
|
243
243
|
return;
|
|
244
|
-
J(!0), c === "vlm" ?
|
|
244
|
+
J(!0), c === "vlm" ? m == null || m.postVlmUploadPicsZip(s, g.id, {
|
|
245
245
|
zipUrl: (l == null ? void 0 : l.bucket) + "/" + n,
|
|
246
246
|
type: $ === "labeled" ? 2 : 1
|
|
247
247
|
}).then((z) => {
|
|
248
|
-
|
|
249
|
-
}) :
|
|
248
|
+
Re(z), xe(z);
|
|
249
|
+
}) : m == null || m.postUploadPicsZip(s, g.id, _e({
|
|
250
250
|
zipUrls: [(l == null ? void 0 : l.bucket) + "/" + n]
|
|
251
251
|
}, (c === "ocr" || c === "detection" || c === "classification") && {
|
|
252
252
|
type: $ === "labeled" ? 1 : 0
|
|
253
253
|
})).then((z) => {
|
|
254
|
-
|
|
254
|
+
Re(z), xe(z);
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
};
|
|
259
259
|
});
|
|
260
|
-
},
|
|
260
|
+
}, Re = (i) => ge(void 0, null, function* () {
|
|
261
261
|
var t;
|
|
262
|
-
if (!(!s || !g || !
|
|
262
|
+
if (!(!s || !g || !m))
|
|
263
263
|
try {
|
|
264
|
-
const a = yield
|
|
264
|
+
const a = yield m.checkFileResult(s, g.id, {
|
|
265
265
|
taskId: i
|
|
266
266
|
}, 5e3, c, (o) => {
|
|
267
267
|
Fe(o);
|
|
@@ -274,17 +274,17 @@ const ut = (A) => {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
|
-
|
|
277
|
+
V(() => {
|
|
278
278
|
pe && (Fe(100), te(!0));
|
|
279
|
-
}, [pe]),
|
|
280
|
-
se !== 0 && (Y(!1),
|
|
281
|
-
}, [se]),
|
|
279
|
+
}, [pe]), V(() => {
|
|
280
|
+
se !== 0 && (Y(!1), M && M(!0));
|
|
281
|
+
}, [se]), V(() => {
|
|
282
282
|
ne !== -1 && (te(!0), ie(!1));
|
|
283
283
|
}, [ne]);
|
|
284
284
|
const hl = () => {
|
|
285
285
|
Oe(), te(!1), Ee && Ee();
|
|
286
286
|
}, Oe = () => {
|
|
287
|
-
|
|
287
|
+
D(), J(!1), S(!1), Ce && Ce(), W && W();
|
|
288
288
|
}, gl = /* @__PURE__ */ d("div", {
|
|
289
289
|
children: [/* @__PURE__ */ e(Ll, {}), /* @__PURE__ */ e("div", {
|
|
290
290
|
style: {
|
|
@@ -298,17 +298,17 @@ const ut = (A) => {
|
|
|
298
298
|
const t = x.filter((a) => a.uid !== i.uid);
|
|
299
299
|
de(t);
|
|
300
300
|
}, Cl = () => {
|
|
301
|
-
$ === "labeled" ? c === "vlm" ? re === "dwg-json" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com/dataset_data/%E5%B7%A5%E7%A8%8B%E5%8C%96%E5%9B%BE%E7%BA%B8%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B%E6%95%B0%E6%8D%AE.zip" : 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" : c === "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" : c === "classification" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/classification/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${we}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : c === "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 = `${we}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
301
|
+
$ === "labeled" ? c === "vlm" ? re === "dwg-json" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com/dataset_data/%E5%B7%A5%E7%A8%8B%E5%8C%96%E5%9B%BE%E7%BA%B8%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B%E6%95%B0%E6%8D%AE.zip" : U === "VQA" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com/dataset_data/VLM-VQA%E6%A0%87%E6%B3%A8%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B.zip" : 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" : c === "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" : c === "classification" ? window.location.href = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data/classification/%E6%9C%89%E6%A0%87%E6%B3%A8%E7%A4%BA%E4%BE%8B.zip" : window.location.href = `${we}/%E6%A0%87%E6%B3%A8%E6%A0%BC%E5%BC%8F%E7%A4%BA%E4%BE%8B.zip` : c === "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 = `${we}/%E7%A4%BA%E4%BE%8B%E5%8E%8B%E7%BC%A9%E5%8C%85.zip`;
|
|
302
302
|
}, El = () => {
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
|
|
303
|
+
D(), $e(!1), J(!1), S(!1);
|
|
304
|
+
}, De = c === "vlm" ? "jsonl" : u.labelFormat || "json";
|
|
305
|
+
V(() => {
|
|
306
306
|
ke === "labeled" && I.setFieldsValue({
|
|
307
|
-
labelFormat:
|
|
307
|
+
labelFormat: De,
|
|
308
308
|
acceptType: "zip"
|
|
309
309
|
/* Zip */
|
|
310
310
|
});
|
|
311
|
-
}, [ke,
|
|
311
|
+
}, [ke, De]);
|
|
312
312
|
const wl = (i, t, a, o, f, n, b, E) => {
|
|
313
313
|
if (i === "image") {
|
|
314
314
|
const X = f.length - n - b;
|
|
@@ -317,34 +317,34 @@ const ut = (A) => {
|
|
|
317
317
|
if (!t)
|
|
318
318
|
return "";
|
|
319
319
|
const h = t.formatErrorCount || 0, j = t.successCount || 0, w = t.repeatCount || 0, z = t.failedCount || 0, k = t.hasLabelCount || 0;
|
|
320
|
-
let
|
|
320
|
+
let y = `数据导入完成,格式不符合的图片${h}个,成功${j}个,去重${w}个,失败${z}个`;
|
|
321
321
|
if (a === "labeled") {
|
|
322
|
-
const X = (o.labelFormat || "json").toUpperCase(),
|
|
323
|
-
E === "detection" ?
|
|
322
|
+
const X = (o.labelFormat || "json").toUpperCase(), Me = t.labelErrorCount || 0;
|
|
323
|
+
E === "detection" ? y = `成功导入已标注${k}张,未标注${Me}张,去重${w}张,失败${z}张,格式不符合${h}张` : o.labelFormat === "dwg-json" ? y = `数据导入完成,成功${j}个,去重${w}个,失败${z}个` : y += `(${X}格式不符合${Me}个)`;
|
|
324
324
|
}
|
|
325
|
-
return
|
|
325
|
+
return y;
|
|
326
326
|
};
|
|
327
|
-
return /* @__PURE__ */ d(
|
|
328
|
-
children: [/* @__PURE__ */ e(
|
|
327
|
+
return /* @__PURE__ */ d(Q, {
|
|
328
|
+
children: [/* @__PURE__ */ e(H, {
|
|
329
329
|
className: "upload-pics",
|
|
330
330
|
width: 600,
|
|
331
331
|
title: "导入数据",
|
|
332
|
-
open:
|
|
332
|
+
open: _,
|
|
333
333
|
destroyOnClose: !0,
|
|
334
|
-
onCancel: () =>
|
|
334
|
+
onCancel: () => Ve(),
|
|
335
335
|
maskClosable: !1,
|
|
336
336
|
centered: !0,
|
|
337
337
|
footer: [/* @__PURE__ */ e(R, {
|
|
338
|
-
onClick:
|
|
338
|
+
onClick: Ve,
|
|
339
339
|
children: "取消"
|
|
340
340
|
}, "cancel"), /* @__PURE__ */ e(R, {
|
|
341
341
|
type: "primary",
|
|
342
342
|
htmlType: "submit",
|
|
343
343
|
form: "importModal",
|
|
344
|
-
disabled: r === "image" && !
|
|
345
|
-
loading:
|
|
344
|
+
disabled: r === "image" && !B.length || r === "zip" && !x.length || le && ve == 0 || ol,
|
|
345
|
+
loading: K == !0,
|
|
346
346
|
onClick: () => {
|
|
347
|
-
|
|
347
|
+
ul(), ie(!0);
|
|
348
348
|
},
|
|
349
349
|
children: "导入"
|
|
350
350
|
}, "confirm")],
|
|
@@ -372,7 +372,7 @@ const ut = (A) => {
|
|
|
372
372
|
message: "请选择数据标注状态"
|
|
373
373
|
}],
|
|
374
374
|
children: /* @__PURE__ */ d(N.Group, {
|
|
375
|
-
disabled:
|
|
375
|
+
disabled: K,
|
|
376
376
|
onChange: (i) => {
|
|
377
377
|
rl(i.target.value), he();
|
|
378
378
|
},
|
|
@@ -401,22 +401,22 @@ const ut = (A) => {
|
|
|
401
401
|
message: "请选择标注格式"
|
|
402
402
|
}],
|
|
403
403
|
children: /* @__PURE__ */ e(N.Group, {
|
|
404
|
-
disabled:
|
|
404
|
+
disabled: K,
|
|
405
405
|
onChange: he,
|
|
406
|
-
children: c === "vlm" ? /* @__PURE__ */ d(
|
|
406
|
+
children: c === "vlm" ? /* @__PURE__ */ d(Q, {
|
|
407
407
|
children: [/* @__PURE__ */ e(N, {
|
|
408
408
|
value: "jsonl",
|
|
409
409
|
children: "jsonl"
|
|
410
|
-
}),
|
|
410
|
+
}), Qe && U === "KIE" && /* @__PURE__ */ e(N, {
|
|
411
411
|
value: "dwg-json",
|
|
412
412
|
children: "图纸json"
|
|
413
413
|
})]
|
|
414
|
-
}) :
|
|
415
|
-
value:
|
|
416
|
-
children:
|
|
414
|
+
}) : u.labelFormatLabel ? /* @__PURE__ */ e(N, {
|
|
415
|
+
value: u.labelFormat || "folder",
|
|
416
|
+
children: u.labelFormatLabel
|
|
417
417
|
}) : /* @__PURE__ */ e(N, {
|
|
418
|
-
value:
|
|
419
|
-
children:
|
|
418
|
+
value: u.labelFormat || "json",
|
|
419
|
+
children: u.labelFormat || "json"
|
|
420
420
|
})
|
|
421
421
|
})
|
|
422
422
|
}), /* @__PURE__ */ e(L.Item, {
|
|
@@ -427,7 +427,7 @@ const ut = (A) => {
|
|
|
427
427
|
message: "请选择导入方式"
|
|
428
428
|
}],
|
|
429
429
|
children: /* @__PURE__ */ d(N.Group, {
|
|
430
|
-
disabled:
|
|
430
|
+
disabled: K,
|
|
431
431
|
onChange: he,
|
|
432
432
|
children: [$ !== "labeled" && /* @__PURE__ */ e(N.Button, {
|
|
433
433
|
value: "image",
|
|
@@ -439,7 +439,7 @@ const ut = (A) => {
|
|
|
439
439
|
})
|
|
440
440
|
}), /* @__PURE__ */ d("div", {
|
|
441
441
|
className: "file-upload",
|
|
442
|
-
children: [(r === "image" && !
|
|
442
|
+
children: [(r === "image" && !B.length || r === "zip") && /* @__PURE__ */ d(cl, {
|
|
443
443
|
name: "file",
|
|
444
444
|
showUploadList: !1,
|
|
445
445
|
multiple: !0,
|
|
@@ -451,7 +451,7 @@ const ut = (A) => {
|
|
|
451
451
|
children: [/* @__PURE__ */ e("span", {
|
|
452
452
|
className: "file-upload-icon",
|
|
453
453
|
children: /* @__PURE__ */ e(xl, {})
|
|
454
|
-
}), /* @__PURE__ */ d(
|
|
454
|
+
}), /* @__PURE__ */ d(Ke, {
|
|
455
455
|
className: "file-upload-action",
|
|
456
456
|
children: [r === "image" && "拖拽图片至此,或者", r === "zip" && "拖拽包含“图片”的压缩包至此,或者", /* @__PURE__ */ e(R, {
|
|
457
457
|
type: "link",
|
|
@@ -468,7 +468,7 @@ const ut = (A) => {
|
|
|
468
468
|
},
|
|
469
469
|
children: [/* @__PURE__ */ d("div", {
|
|
470
470
|
className: "item-upload-desc item-upload-desc__1",
|
|
471
|
-
children: ["1. 支持",
|
|
471
|
+
children: ["1. 支持", u.imageFormatsText, "格式,单张图片不超过", u.maxImageSize / Je, "M;"]
|
|
472
472
|
}), /* @__PURE__ */ e("div", {
|
|
473
473
|
className: "item-upload-desc",
|
|
474
474
|
children: "2. 单次上传最多可选择100个文件。"
|
|
@@ -480,25 +480,25 @@ const ut = (A) => {
|
|
|
480
480
|
},
|
|
481
481
|
children: [/* @__PURE__ */ d("div", {
|
|
482
482
|
className: "item-upload-desc item-upload-desc__1",
|
|
483
|
-
children: ["1. 仅支持.zip格式,单个压缩包不超过",
|
|
484
|
-
}), $ === "labeled" ? /* @__PURE__ */ e(
|
|
485
|
-
children:
|
|
483
|
+
children: ["1. 仅支持.zip格式,单个压缩包不超过", u.maxZipSize / Xe, "G;"]
|
|
484
|
+
}), $ === "labeled" ? /* @__PURE__ */ e(Q, {
|
|
485
|
+
children: u.zipUploadTexts.labeled.description.map((i, t) => /* @__PURE__ */ d("div", {
|
|
486
486
|
className: "item-upload-desc",
|
|
487
487
|
children: [t + 2, ". ", i]
|
|
488
488
|
}, t))
|
|
489
489
|
}) : /* @__PURE__ */ d("div", {
|
|
490
490
|
className: "item-upload-desc",
|
|
491
|
-
children: ["2. ",
|
|
491
|
+
children: ["2. ", u.zipUploadTexts.unlabeled.description[0]]
|
|
492
492
|
}), /* @__PURE__ */ d("div", {
|
|
493
493
|
className: "item-upload-desc",
|
|
494
|
-
children: [$ === "labeled" ?
|
|
494
|
+
children: [$ === "labeled" ? u.zipUploadTexts.labeled.description.length + 2 : 3, ". 单次仅可上传1个文件。"]
|
|
495
495
|
})]
|
|
496
496
|
})]
|
|
497
|
-
}), r === "image" &&
|
|
497
|
+
}), r === "image" && B.length ? /* @__PURE__ */ e("div", {
|
|
498
498
|
className: "picture-upload",
|
|
499
499
|
children: /* @__PURE__ */ e(Ie, {
|
|
500
500
|
listType: "picture-card",
|
|
501
|
-
fileList:
|
|
501
|
+
fileList: B,
|
|
502
502
|
multiple: !0,
|
|
503
503
|
showUploadList: {
|
|
504
504
|
showPreviewIcon: !1
|
|
@@ -506,9 +506,9 @@ const ut = (A) => {
|
|
|
506
506
|
beforeUpload: Te,
|
|
507
507
|
accept: Le,
|
|
508
508
|
onChange: Ue,
|
|
509
|
-
children:
|
|
509
|
+
children: B.length < 100 ? gl : null
|
|
510
510
|
})
|
|
511
|
-
}) : /* @__PURE__ */ e(
|
|
511
|
+
}) : /* @__PURE__ */ e(Q, {}), r === "zip" && /* @__PURE__ */ d("div", {
|
|
512
512
|
className: "upload-wrapper",
|
|
513
513
|
children: [x != null && x.length ? /* @__PURE__ */ e("div", {
|
|
514
514
|
className: "upload-main",
|
|
@@ -533,7 +533,7 @@ const ut = (A) => {
|
|
|
533
533
|
}), /* @__PURE__ */ e(R, {
|
|
534
534
|
className: "upload-item-upload-delete",
|
|
535
535
|
type: "link",
|
|
536
|
-
disabled:
|
|
536
|
+
disabled: K,
|
|
537
537
|
onClick: () => bl(i),
|
|
538
538
|
children: /* @__PURE__ */ e(kl, {})
|
|
539
539
|
})]
|
|
@@ -544,7 +544,7 @@ const ut = (A) => {
|
|
|
544
544
|
className: "upload-example",
|
|
545
545
|
children: [/* @__PURE__ */ e("div", {
|
|
546
546
|
className: "upload-example-header",
|
|
547
|
-
children: /* @__PURE__ */ d(
|
|
547
|
+
children: /* @__PURE__ */ d(Ke, {
|
|
548
548
|
children: [/* @__PURE__ */ e("span", {
|
|
549
549
|
children: "数据示例:"
|
|
550
550
|
}), /* @__PURE__ */ e(R, {
|
|
@@ -559,17 +559,17 @@ const ut = (A) => {
|
|
|
559
559
|
children: "下载示例 >"
|
|
560
560
|
})]
|
|
561
561
|
})
|
|
562
|
-
}), c !== "classification" && /* @__PURE__ */ e("div", {
|
|
562
|
+
}), c !== "classification" && !($ === "labeled" && u.showExampleImage === !1) && /* @__PURE__ */ e("div", {
|
|
563
563
|
className: "upload-example-main",
|
|
564
564
|
children: /* @__PURE__ */ e("img", {
|
|
565
|
-
src: $ === "labeled" ? c === "vlm" ? re === "dwg-json" ?
|
|
565
|
+
src: $ === "labeled" ? c === "vlm" ? re === "dwg-json" ? Dl : Rl : Vl : c === "vlm" ? Ol : Ul
|
|
566
566
|
})
|
|
567
567
|
})]
|
|
568
568
|
})]
|
|
569
569
|
})]
|
|
570
570
|
})]
|
|
571
571
|
})
|
|
572
|
-
}), le && /* @__PURE__ */ e(
|
|
572
|
+
}), le && /* @__PURE__ */ e(H, {
|
|
573
573
|
className: "uploading-modal",
|
|
574
574
|
width: 404,
|
|
575
575
|
title: null,
|
|
@@ -583,32 +583,32 @@ const ut = (A) => {
|
|
|
583
583
|
children: /* @__PURE__ */ e("div", {
|
|
584
584
|
className: "upload-spin",
|
|
585
585
|
children: /* @__PURE__ */ e(Nl, {
|
|
586
|
-
tip: r === "image" ? `数据导入中(${se}/${
|
|
586
|
+
tip: r === "image" ? `数据导入中(${se}/${B.length}),请耐心等待` : `处理中(${ve}/100%),请耐心等待`,
|
|
587
587
|
size: "large",
|
|
588
588
|
children: /* @__PURE__ */ e("div", {
|
|
589
589
|
className: "content"
|
|
590
590
|
})
|
|
591
591
|
})
|
|
592
592
|
})
|
|
593
|
-
}),
|
|
593
|
+
}), Be && /* @__PURE__ */ e(H, {
|
|
594
594
|
className: "result",
|
|
595
595
|
width: 424,
|
|
596
596
|
title: null,
|
|
597
|
-
open:
|
|
597
|
+
open: Be,
|
|
598
598
|
closable: !1,
|
|
599
599
|
footer: null,
|
|
600
600
|
children: /* @__PURE__ */ e("div", {
|
|
601
601
|
className: "upload-result",
|
|
602
602
|
children: /* @__PURE__ */ e(Ge, {
|
|
603
603
|
status: "success",
|
|
604
|
-
title: wl(r, pe, $,
|
|
604
|
+
title: wl(r, pe, $, u, B, ne, il, c),
|
|
605
605
|
extra: [/* @__PURE__ */ e(R, {
|
|
606
606
|
onClick: hl,
|
|
607
607
|
children: "关闭"
|
|
608
608
|
}, "close")]
|
|
609
609
|
})
|
|
610
610
|
})
|
|
611
|
-
}), Ne && /* @__PURE__ */ e(
|
|
611
|
+
}), Ne && /* @__PURE__ */ e(H, {
|
|
612
612
|
className: "result",
|
|
613
613
|
width: 424,
|
|
614
614
|
title: null,
|
|
@@ -630,5 +630,5 @@ const ut = (A) => {
|
|
|
630
630
|
});
|
|
631
631
|
};
|
|
632
632
|
export {
|
|
633
|
-
|
|
633
|
+
mt as default
|
|
634
634
|
};
|