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