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