@glodon-aiot/dataset-annotation 3.16.0-alpha.36 → 3.16.0-alpha.38
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/DetectionAnnotation/components/LabelMaker/index.mjs +61 -53
- package/dist/es/components/DetectionAnnotation/components/Labels/index.mjs +23 -23
- package/dist/es/components/DetectionAnnotation/index.mjs +2 -1
- package/dist/es/components/PicZipImportModal/config.mjs +28 -13
- package/dist/es/components/PicZipImportModal/index.mjs +286 -270
- package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +60 -60
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/src/components/PicZipImportModal/config.d.ts +0 -2
- package/package.json +2 -2
|
@@ -2,15 +2,15 @@ var $ = Math.pow;
|
|
|
2
2
|
import { jsx as f, jsxs as V } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as ee, useState as D, useEffect as h } from "react";
|
|
4
4
|
import { fabric as X } from "fabric";
|
|
5
|
-
import { useKeyPress as
|
|
5
|
+
import { useKeyPress as R } from "ahooks";
|
|
6
6
|
import "./style.less.mjs";
|
|
7
7
|
import le from "react-dom";
|
|
8
|
-
import { Spin as fe, Space as de, Tooltip as
|
|
8
|
+
import { Spin as fe, Space as de, Tooltip as A, Button as L } from "antd";
|
|
9
9
|
import te from "./RectLabel.mjs";
|
|
10
10
|
import { drawable as ue } from "./Drawable.mjs";
|
|
11
11
|
import { ZoomInOutlined as me, ZoomOutOutlined as ge, DragOutlined as he, ClearOutlined as pe } from "@ant-design/icons";
|
|
12
12
|
import be from "classnames";
|
|
13
|
-
import { approxeq as
|
|
13
|
+
import { approxeq as S } from "../../../../utils/index.mjs";
|
|
14
14
|
const oe = (a) => {
|
|
15
15
|
a.off("mouse:down"), a.off("mouse:up");
|
|
16
16
|
}, O = (a) => {
|
|
@@ -28,9 +28,9 @@ const oe = (a) => {
|
|
|
28
28
|
id: a.config.id,
|
|
29
29
|
label: a.config.name,
|
|
30
30
|
color: a.config.color,
|
|
31
|
-
box: (d == null ? void 0 : d.map((y) => [
|
|
31
|
+
box: (d == null ? void 0 : d.map((y) => [S(y.x - m.x, 0) ? 0 : S(y.x - m.x, p.width) ? p.width : y.x - m.x, S(y.y - m.y, 0) ? 0 : S(y.y - m.y, p.height) ? p.height : y.y - m.y])) || []
|
|
32
32
|
};
|
|
33
|
-
},
|
|
33
|
+
}, Ae = (a) => {
|
|
34
34
|
const d = ee(null), {
|
|
35
35
|
labels: m,
|
|
36
36
|
imageUrl: p,
|
|
@@ -38,12 +38,12 @@ const oe = (a) => {
|
|
|
38
38
|
onImageLoad: E,
|
|
39
39
|
onChange: l,
|
|
40
40
|
isPreLabel: y,
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: k,
|
|
42
42
|
renderLabelItem: N
|
|
43
|
-
} = a, [z, B] = D(!0), [e, Z] = D(), [ye, ne] = D({}), [
|
|
43
|
+
} = a, [z, B] = D(!0), [e, Z] = D(), [ye, ne] = D({}), [j, K] = D(), [W, re] = D({
|
|
44
44
|
left: 0,
|
|
45
45
|
top: 0
|
|
46
|
-
}), [ie, U] = D([1, 1]), [
|
|
46
|
+
}), [ie, U] = D([1, 1]), [M, H] = D(), [x, v] = D([]), w = ee(/* @__PURE__ */ new Set()), [b, P] = D(k || !1), Y = (o, t) => {
|
|
47
47
|
if (!e)
|
|
48
48
|
return;
|
|
49
49
|
t || (t = {
|
|
@@ -74,8 +74,8 @@ const oe = (a) => {
|
|
|
74
74
|
return i && i === t;
|
|
75
75
|
})), u >= 0 && r[u]) {
|
|
76
76
|
const s = r[u];
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
w.current.add(s.config.id), s.destroy(), r.splice(u, 1), l && l(r.map(O)), setTimeout(() => {
|
|
78
|
+
w.current.delete(s.config.id);
|
|
79
79
|
}, 100);
|
|
80
80
|
} else if (t && e) {
|
|
81
81
|
const s = r.findIndex((i) => {
|
|
@@ -84,8 +84,8 @@ const oe = (a) => {
|
|
|
84
84
|
});
|
|
85
85
|
if (s >= 0 && r[s]) {
|
|
86
86
|
const i = r[s];
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
w.current.add(i.config.id), i.destroy(), r.splice(s, 1), l && l(r.map(O)), setTimeout(() => {
|
|
88
|
+
w.current.delete(i.config.id);
|
|
89
89
|
}, 100);
|
|
90
90
|
} else
|
|
91
91
|
e.remove(t), e.discardActiveObject(), e.renderAll();
|
|
@@ -93,21 +93,21 @@ const oe = (a) => {
|
|
|
93
93
|
return [...r];
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
R("Delete", q), R("Backspace", q), R("ctrl", () => {
|
|
97
|
+
P(!0);
|
|
98
98
|
}, {
|
|
99
99
|
events: ["keydown"]
|
|
100
|
-
}),
|
|
101
|
-
|
|
100
|
+
}), R("ctrl", () => {
|
|
101
|
+
k || P(!1);
|
|
102
102
|
}, {
|
|
103
103
|
events: ["keyup"]
|
|
104
104
|
}), h(() => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
105
|
+
P(k || !1);
|
|
106
|
+
}, [k]);
|
|
107
107
|
const F = (o) => {
|
|
108
108
|
e && oe(e), v((t) => {
|
|
109
109
|
const n = t.findIndex((r) => r === o);
|
|
110
|
-
return n > -1 && (t.splice(n, 1), l && l(t.map(O)),
|
|
110
|
+
return n > -1 && (t.splice(n, 1), l && l(t.map(O)), T()), [...t];
|
|
111
111
|
});
|
|
112
112
|
}, G = (o) => {
|
|
113
113
|
v((t) => {
|
|
@@ -139,7 +139,7 @@ const oe = (a) => {
|
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
141
|
}, [e, p]);
|
|
142
|
-
const
|
|
142
|
+
const T = () => {
|
|
143
143
|
e && ue(e, (o) => {
|
|
144
144
|
const t = new te({
|
|
145
145
|
id: (c == null ? void 0 : c.id) || o.id,
|
|
@@ -154,7 +154,7 @@ const oe = (a) => {
|
|
|
154
154
|
t.active = !0, v((n) => {
|
|
155
155
|
const r = [...n, t];
|
|
156
156
|
return l && l(r.map(O)), setTimeout(() => {
|
|
157
|
-
e && !b &&
|
|
157
|
+
e && !b && T();
|
|
158
158
|
}, 0), r;
|
|
159
159
|
});
|
|
160
160
|
}, y);
|
|
@@ -188,8 +188,8 @@ const oe = (a) => {
|
|
|
188
188
|
return;
|
|
189
189
|
const I = e.getPointer(t.e);
|
|
190
190
|
if (I.x < i.tl.x || I.x > i.br.x || I.y < i.tl.y || I.y > i.br.y) {
|
|
191
|
-
const
|
|
192
|
-
typeof
|
|
191
|
+
const C = n == null ? void 0 : n._onMouseUp;
|
|
192
|
+
typeof C == "function" && C(t.e);
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
return e.on("mouse:move", o), () => {
|
|
@@ -220,7 +220,7 @@ const oe = (a) => {
|
|
|
220
220
|
}), o))) : (e.defaultCursor = "default", e.off("mouse:down:before"), e.off("mouse:up"), e.setCursor("default"), v((o) => (o.forEach((t) => {
|
|
221
221
|
var n;
|
|
222
222
|
return (n = t.object) == null ? void 0 : n.set("evented", !0);
|
|
223
|
-
}), o)),
|
|
223
|
+
}), o)), T()), () => {
|
|
224
224
|
ae();
|
|
225
225
|
};
|
|
226
226
|
}, [e, b]), h(() => {
|
|
@@ -233,7 +233,7 @@ const oe = (a) => {
|
|
|
233
233
|
n.renderLabel();
|
|
234
234
|
});
|
|
235
235
|
}), !b)
|
|
236
|
-
return
|
|
236
|
+
return T(), () => {
|
|
237
237
|
e && (oe(e), e.off("mouse:wheel"));
|
|
238
238
|
};
|
|
239
239
|
}, [e, c, x, b]);
|
|
@@ -250,7 +250,7 @@ const oe = (a) => {
|
|
|
250
250
|
crossOrigin: "anonymous"
|
|
251
251
|
});
|
|
252
252
|
}, [p]), h(() => {
|
|
253
|
-
if (!
|
|
253
|
+
if (!j && e) {
|
|
254
254
|
try {
|
|
255
255
|
e.clear();
|
|
256
256
|
} catch (_) {
|
|
@@ -259,23 +259,23 @@ const oe = (a) => {
|
|
|
259
259
|
}
|
|
260
260
|
if (!d.current || !d.current.parentElement)
|
|
261
261
|
return;
|
|
262
|
-
const o =
|
|
262
|
+
const o = j == null ? void 0 : j.getElement();
|
|
263
263
|
if (!(o != null && o.width) || !(o != null && o.height))
|
|
264
264
|
return;
|
|
265
265
|
const t = o.width / o.height, n = d.current.parentElement.offsetWidth, r = d.current.parentElement.offsetHeight, u = n / o.width, s = r / o.height;
|
|
266
266
|
let i = [n, r];
|
|
267
267
|
u > s ? i = [r * t, r] : i = [n, n / t];
|
|
268
|
-
const I = i[0] / o.width, J = i[1] / o.height,
|
|
269
|
-
U([
|
|
268
|
+
const I = i[0] / o.width, J = i[1] / o.height, C = Math.min(I, J);
|
|
269
|
+
U([C, C]);
|
|
270
270
|
const g = new X.Canvas(d.current, {
|
|
271
271
|
containerClass: "marking-canvas",
|
|
272
272
|
width: n,
|
|
273
273
|
height: r
|
|
274
274
|
});
|
|
275
|
-
if (g.uniScaleKey = "", g.uniformScaling = !1, g == null || g.setZoom(
|
|
276
|
-
const _ = (n - i[0]) /
|
|
275
|
+
if (g.uniScaleKey = "", g.uniformScaling = !1, g == null || g.setZoom(C), g == null || g.renderAll(), g && j) {
|
|
276
|
+
const _ = (n - i[0]) / C / 2, Q = (r - i[1]) / C / 2;
|
|
277
277
|
g.setBackgroundImage(
|
|
278
|
-
|
|
278
|
+
j,
|
|
279
279
|
() => {
|
|
280
280
|
g.renderAll(), re({
|
|
281
281
|
left: _,
|
|
@@ -291,12 +291,12 @@ const oe = (a) => {
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
}, [
|
|
294
|
+
}, [j]), h(() => {
|
|
295
295
|
if (x.length > m.length) {
|
|
296
|
-
if (
|
|
296
|
+
if (w.current.size > 0)
|
|
297
297
|
return;
|
|
298
298
|
x.forEach((t) => {
|
|
299
|
-
const n =
|
|
299
|
+
const n = w.current.has(t.config.id), r = t._isDestroying;
|
|
300
300
|
!m.find((s) => s.id === t.config.id) && !r && !n && t.destroy();
|
|
301
301
|
});
|
|
302
302
|
}
|
|
@@ -311,12 +311,12 @@ const oe = (a) => {
|
|
|
311
311
|
}));
|
|
312
312
|
}, [c, e, b]), h(() => {
|
|
313
313
|
var o;
|
|
314
|
-
if (z && d.current && !
|
|
314
|
+
if (z && d.current && !M) {
|
|
315
315
|
const t = document.createElement("div");
|
|
316
316
|
t.setAttribute("style", "width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: absolute;top: 0;"), (o = d.current.parentElement) == null || o.appendChild(t), le.render(/* @__PURE__ */ f(fe, {}), t), H(t);
|
|
317
317
|
} else
|
|
318
|
-
!z &&
|
|
319
|
-
}, [z, d.current,
|
|
318
|
+
!z && M && (M.remove(), H(null));
|
|
319
|
+
}, [z, d.current, M]), /* @__PURE__ */ V("div", {
|
|
320
320
|
style: {
|
|
321
321
|
width: "100%",
|
|
322
322
|
height: "100%",
|
|
@@ -329,46 +329,54 @@ const oe = (a) => {
|
|
|
329
329
|
children: /* @__PURE__ */ V(de, {
|
|
330
330
|
direction: "vertical",
|
|
331
331
|
size: 16,
|
|
332
|
-
children: [/* @__PURE__ */ f(
|
|
332
|
+
children: [/* @__PURE__ */ f(A, {
|
|
333
333
|
title: "放大-鼠标滚轮前滑",
|
|
334
334
|
placement: "right",
|
|
335
|
-
children: /* @__PURE__ */ f(
|
|
335
|
+
children: /* @__PURE__ */ f(L, {
|
|
336
336
|
icon: /* @__PURE__ */ f(me, {}),
|
|
337
337
|
onClick: () => {
|
|
338
338
|
Y(-100);
|
|
339
339
|
}
|
|
340
340
|
})
|
|
341
|
-
}), /* @__PURE__ */ f(
|
|
341
|
+
}), /* @__PURE__ */ f(A, {
|
|
342
342
|
title: "缩小-鼠标滚轮后滑",
|
|
343
343
|
placement: "right",
|
|
344
|
-
children: /* @__PURE__ */ f(
|
|
344
|
+
children: /* @__PURE__ */ f(L, {
|
|
345
345
|
icon: /* @__PURE__ */ f(ge, {}),
|
|
346
346
|
onClick: () => {
|
|
347
347
|
Y(100);
|
|
348
348
|
}
|
|
349
349
|
})
|
|
350
|
-
}), !
|
|
350
|
+
}), !k && /* @__PURE__ */ f(A, {
|
|
351
351
|
title: "拖动-按住ctrl",
|
|
352
352
|
placement: "right",
|
|
353
|
-
children: /* @__PURE__ */ f(
|
|
354
|
-
disabled:
|
|
353
|
+
children: /* @__PURE__ */ f(L, {
|
|
354
|
+
disabled: k,
|
|
355
355
|
icon: /* @__PURE__ */ f(he, {}),
|
|
356
356
|
className: b ? "active" : "",
|
|
357
357
|
onClick: () => {
|
|
358
|
-
|
|
358
|
+
P(!b);
|
|
359
359
|
}
|
|
360
360
|
})
|
|
361
|
-
}), !
|
|
361
|
+
}), !k && /* @__PURE__ */ f(A, {
|
|
362
362
|
title: "一键清空全部标注",
|
|
363
363
|
placement: "right",
|
|
364
|
-
children: /* @__PURE__ */ f(
|
|
364
|
+
children: /* @__PURE__ */ f(L, {
|
|
365
365
|
icon: /* @__PURE__ */ f(pe, {}),
|
|
366
366
|
disabled: !(x != null && x.length),
|
|
367
367
|
onClick: () => {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
if (!e)
|
|
369
|
+
return;
|
|
370
|
+
v((t) => (t.forEach((n) => {
|
|
371
|
+
w.current.add(n.config.id);
|
|
372
|
+
}), t.forEach((n) => {
|
|
373
|
+
n.destroy();
|
|
374
|
+
}), setTimeout(() => {
|
|
375
|
+
w.current.clear();
|
|
376
|
+
}, 100), [])), e.discardActiveObject(), e.getObjects().forEach((t) => {
|
|
377
|
+
t !== e.backgroundImage && e.remove(t);
|
|
378
|
+
}), e.renderAll(), l && l([]), setTimeout(() => {
|
|
379
|
+
e && !b && T();
|
|
372
380
|
}, 0);
|
|
373
381
|
}
|
|
374
382
|
})
|
|
@@ -391,5 +399,5 @@ const oe = (a) => {
|
|
|
391
399
|
});
|
|
392
400
|
};
|
|
393
401
|
export {
|
|
394
|
-
|
|
402
|
+
Ae as default
|
|
395
403
|
};
|
|
@@ -2,14 +2,14 @@ var _ = Object.defineProperty, $ = Object.defineProperties;
|
|
|
2
2
|
var H = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var P = Object.getOwnPropertySymbols;
|
|
4
4
|
var I = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var R = (i,
|
|
6
|
-
for (var s in
|
|
7
|
-
I.call(
|
|
5
|
+
var R = (i, r, s) => r in i ? _(i, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[r] = s, g = (i, r) => {
|
|
6
|
+
for (var s in r || (r = {}))
|
|
7
|
+
I.call(r, s) && R(i, s, r[s]);
|
|
8
8
|
if (P)
|
|
9
|
-
for (var s of P(
|
|
10
|
-
L.call(
|
|
9
|
+
for (var s of P(r))
|
|
10
|
+
L.call(r, s) && R(i, s, r[s]);
|
|
11
11
|
return i;
|
|
12
|
-
}, N = (i,
|
|
12
|
+
}, N = (i, r) => $(i, H(r));
|
|
13
13
|
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
14
14
|
import { Row as B, Button as U, Input as ee, Space as te, Empty as ie, Modal as le } from "antd";
|
|
15
15
|
import { useState as m, useContext as re, useEffect as w } from "react";
|
|
@@ -22,7 +22,7 @@ import { tagColors as k } from "../../../../utils/index.mjs";
|
|
|
22
22
|
import se from "../../../Iconfont/index.mjs";
|
|
23
23
|
const Ae = ({
|
|
24
24
|
datasetId: i,
|
|
25
|
-
data:
|
|
25
|
+
data: r,
|
|
26
26
|
selected: s = [],
|
|
27
27
|
showZero: ce = !0,
|
|
28
28
|
shortcut: F = !1,
|
|
@@ -33,7 +33,7 @@ const Ae = ({
|
|
|
33
33
|
isPreLabel: v = !1,
|
|
34
34
|
settingHide: C = !1
|
|
35
35
|
}) => {
|
|
36
|
-
const [n, A] = m([]), [ae, T] = m(!1), [
|
|
36
|
+
const [n, A] = m([]), [ae, T] = m(!1), [o, p] = m([]), [j, z] = m(""), [x, S] = m(null), [D, J] = m(!1), {
|
|
37
37
|
services: {
|
|
38
38
|
cvforceDatahub: d
|
|
39
39
|
},
|
|
@@ -44,15 +44,15 @@ const Ae = ({
|
|
|
44
44
|
}
|
|
45
45
|
} = re(ne);
|
|
46
46
|
w(() => {
|
|
47
|
-
|
|
48
|
-
}, [s,
|
|
47
|
+
o.length && A(s.map((e) => o.find((t) => t.id === e.id)));
|
|
48
|
+
}, [s, o]), w(() => {
|
|
49
49
|
i && E();
|
|
50
|
-
}, [i]), w(() => {
|
|
51
|
-
!i &&
|
|
50
|
+
}, [i, r]), w(() => {
|
|
51
|
+
!i && r && p(r.map((e) => N(g({}, e), {
|
|
52
52
|
createdAt: 0,
|
|
53
53
|
updatedAt: 0
|
|
54
54
|
})));
|
|
55
|
-
}, [i,
|
|
55
|
+
}, [i, r]);
|
|
56
56
|
const E = () => {
|
|
57
57
|
!i || !d || (T(!0), d.listLabels(i, {
|
|
58
58
|
pageNo: 1,
|
|
@@ -67,13 +67,13 @@ const Ae = ({
|
|
|
67
67
|
label: e
|
|
68
68
|
}]
|
|
69
69
|
}).then((t) => {
|
|
70
|
-
p([...
|
|
70
|
+
p([...o, {
|
|
71
71
|
label: e,
|
|
72
72
|
id: t[0],
|
|
73
|
-
color: k[
|
|
73
|
+
color: k[o.length % 40],
|
|
74
74
|
createdAt: Date.now(),
|
|
75
75
|
updatedAt: Date.now()
|
|
76
|
-
}]), S(null), u && u([...
|
|
76
|
+
}]), S(null), u && u([...o]);
|
|
77
77
|
}).then(() => !0).catch(() => !1), Q = (e) => {
|
|
78
78
|
let t = [];
|
|
79
79
|
G === "multiple" ? n != null && n.some((l) => l.id === e.id) ? t = n == null ? void 0 : n.filter((l) => l.id !== e.id) : t = [...n, e] : n != null && n.some((l) => l.id === e.id) ? t = [] : t = [e], A(t), M && M(t);
|
|
@@ -82,8 +82,8 @@ const Ae = ({
|
|
|
82
82
|
}, W = (e) => {
|
|
83
83
|
if (!i || !d)
|
|
84
84
|
return Promise.resolve(!1);
|
|
85
|
-
const t =
|
|
86
|
-
return d.patchLabel(i, e.id, e).then(() => (t < 0 || (
|
|
85
|
+
const t = o.findIndex((l) => l.id === e.id);
|
|
86
|
+
return d.patchLabel(i, e.id, e).then(() => (t < 0 || (o[t] = e, p([...o]), u && u([...o])), !0)).catch(() => !1);
|
|
87
87
|
}, X = (e) => {
|
|
88
88
|
le.confirm({
|
|
89
89
|
title: "确认要删除当前标签吗?",
|
|
@@ -91,13 +91,13 @@ const Ae = ({
|
|
|
91
91
|
onOk: () => {
|
|
92
92
|
if (!i || !d)
|
|
93
93
|
return;
|
|
94
|
-
const t =
|
|
94
|
+
const t = o.findIndex((c) => c.id === e), l = n.findIndex((c) => c.id === e);
|
|
95
95
|
return d.deleteLabel(i, e).then(() => {
|
|
96
|
-
l > -1 && (n.splice(l, 1), A([...n])),
|
|
96
|
+
l > -1 && (n.splice(l, 1), A([...n])), o.splice(t, 1), p([...o]), u && u([...o]), E();
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
}, b = (
|
|
100
|
+
}, b = (o == null ? void 0 : o.filter((e) => !j || e.label.includes(j))) || [];
|
|
101
101
|
return /* @__PURE__ */ h("div", {
|
|
102
102
|
className: "label-list-wrap",
|
|
103
103
|
children: [/* @__PURE__ */ h(B, {
|
|
@@ -133,7 +133,7 @@ const Ae = ({
|
|
|
133
133
|
disabled: x !== null || v,
|
|
134
134
|
onClick: () => {
|
|
135
135
|
S({
|
|
136
|
-
color: k[
|
|
136
|
+
color: k[o.length % 40],
|
|
137
137
|
label: ""
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -173,7 +173,7 @@ const Ae = ({
|
|
|
173
173
|
extra: F ? t < 10 ? /* @__PURE__ */ h("span", {
|
|
174
174
|
className: "shortcut",
|
|
175
175
|
children: ["快捷键", t]
|
|
176
|
-
}) : null : ((l =
|
|
176
|
+
}) : null : ((l = r.find((c) => c.label === e.label)) == null ? void 0 : l.count) || 0,
|
|
177
177
|
label: e.label,
|
|
178
178
|
color: e.color,
|
|
179
179
|
onClick: () => {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var j = Object.defineProperty, l = Object.defineProperties;
|
|
2
|
+
var s = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var i = Object.getOwnPropertySymbols;
|
|
4
|
+
var r = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var n = (e, g, p) => g in e ? j(e, g, { enumerable: !0, configurable: !0, writable: !0, value: p }) : e[g] = p, m = (e, g) => {
|
|
6
|
+
for (var p in g || (g = {}))
|
|
7
|
+
r.call(g, p) && n(e, p, g[p]);
|
|
8
|
+
if (i)
|
|
9
|
+
for (var p of i(g))
|
|
10
|
+
d.call(g, p) && n(e, p, g[p]);
|
|
11
|
+
return e;
|
|
12
|
+
}, a = (e, g) => l(e, s(g));
|
|
13
|
+
import { MB as o } from "../../constant.mjs";
|
|
14
|
+
const t = {
|
|
15
|
+
maxImageSize: 14 * o,
|
|
4
16
|
imageMimeTypes: ["image/jpeg", "image/jpg", "image/png", "image/bmp"],
|
|
5
17
|
imageAccept: "image/png, image/jpeg, image/jpg, image/bmp",
|
|
6
18
|
imageFormatsText: "jpg、png 、jpeg 、bmp",
|
|
7
|
-
labeledExampleKey: "FileImportType.Pro.LabelType.Unlabeled",
|
|
8
|
-
unlabeledExampleKey: "FileImportType.Pro.LabelType.Labeled",
|
|
9
19
|
labelFormat: "json",
|
|
10
20
|
zipUploadTexts: {
|
|
11
21
|
labeled: {
|
|
@@ -15,16 +25,12 @@ const g = {
|
|
|
15
25
|
description: ["压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"]
|
|
16
26
|
}
|
|
17
27
|
}
|
|
18
|
-
},
|
|
19
|
-
maxImageSize: 10 *
|
|
28
|
+
}, c = {
|
|
29
|
+
maxImageSize: 10 * o,
|
|
20
30
|
// VLM 可能是 10M(可根据实际需求调整)
|
|
21
31
|
imageMimeTypes: ["image/jpeg", "image/jpg", "image/png"],
|
|
22
32
|
imageAccept: "image/png, image/jpeg, image/jpg",
|
|
23
33
|
imageFormatsText: "jpg、png 、jpeg",
|
|
24
|
-
labeledExampleKey: "FileImportType.Pro.LabelType.Unlabeled",
|
|
25
|
-
// 暂时使用默认,如果不同可后续修改
|
|
26
|
-
unlabeledExampleKey: "FileImportType.Pro.LabelType.Labeled",
|
|
27
|
-
// 暂时使用默认,如果不同可后续修改
|
|
28
34
|
labelFormat: "jsonl",
|
|
29
35
|
// VLM 使用 jsonl 格式
|
|
30
36
|
zipUploadTexts: {
|
|
@@ -41,7 +47,16 @@ const g = {
|
|
|
41
47
|
]
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
},
|
|
50
|
+
}, b = a(m({}, t), {
|
|
51
|
+
zipUploadTexts: {
|
|
52
|
+
labeled: {
|
|
53
|
+
description: ["压缩包内每张图片(jpg、png 、jpeg 、bmp格式)需要对应一个json文件,名称需一致,位置处在一级目录下;", "json文件须符合labelme标注规范,仅支持矩形框,必须包含标签、标签类型和两点坐标,格式可参考样例。"]
|
|
54
|
+
},
|
|
55
|
+
unlabeled: {
|
|
56
|
+
description: ["压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), u = (e) => e === "vlm" ? c : e === "detection" ? b : t;
|
|
45
60
|
export {
|
|
46
|
-
|
|
61
|
+
u as getImportConfig
|
|
47
62
|
};
|