@glodon-aiot/dataset-annotation 3.16.0-alpha.40 → 3.16.0-alpha.41
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.
|
@@ -2,27 +2,27 @@ var z = Object.defineProperty, A = Object.defineProperties;
|
|
|
2
2
|
var B = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var w = Object.getOwnPropertySymbols;
|
|
4
4
|
var K = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
K.call(e,
|
|
5
|
+
var k = (o, e, s) => e in o ? z(o, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[e] = s, d = (o, e) => {
|
|
6
|
+
for (var s in e || (e = {}))
|
|
7
|
+
K.call(e, s) && k(o, s, e[s]);
|
|
8
8
|
if (w)
|
|
9
|
-
for (var
|
|
10
|
-
O.call(e,
|
|
11
|
-
return
|
|
12
|
-
}, c = (
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { useRef as g, useState as
|
|
15
|
-
import { Row as
|
|
16
|
-
import { useKeyPress as
|
|
9
|
+
for (var s of w(e))
|
|
10
|
+
O.call(e, s) && k(o, s, e[s]);
|
|
11
|
+
return o;
|
|
12
|
+
}, c = (o, e) => A(o, B(e));
|
|
13
|
+
import { jsx as n, jsxs as q } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as g, useState as t, useEffect as h } from "react";
|
|
15
|
+
import { Row as G, Col as H } from "antd";
|
|
16
|
+
import { useKeyPress as I } from "ahooks";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
const
|
|
20
|
-
var C;
|
|
18
|
+
import J from "../OCRBoxMaker/index.mjs";
|
|
19
|
+
const se = (o) => {
|
|
20
|
+
var p, C;
|
|
21
21
|
const {
|
|
22
22
|
// datasetId,
|
|
23
23
|
currentSample: e,
|
|
24
|
-
onNextClick:
|
|
25
|
-
onPrevClick:
|
|
24
|
+
onNextClick: s,
|
|
25
|
+
onPrevClick: b,
|
|
26
26
|
// labels = [],
|
|
27
27
|
// editing,
|
|
28
28
|
onRefresh: x,
|
|
@@ -30,61 +30,64 @@ const ee = (s) => {
|
|
|
30
30
|
// isPreLabel,
|
|
31
31
|
// settingHide,
|
|
32
32
|
// imgCount,
|
|
33
|
-
readonly:
|
|
33
|
+
readonly: L,
|
|
34
34
|
// showLabelList = true,
|
|
35
|
-
categories:
|
|
36
|
-
renderLabelItem:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
}),
|
|
35
|
+
categories: y,
|
|
36
|
+
renderLabelItem: U
|
|
37
|
+
} = o, N = g(null), u = g(null), j = g({}), [Q, D] = t({}), [T, E] = t(), [m, F] = t(), [M, W] = t(!1), [X, R] = t(!1);
|
|
38
|
+
I("rightarrow", () => {
|
|
39
|
+
s && s();
|
|
40
|
+
}), I("leftarrow", () => {
|
|
41
|
+
b && b();
|
|
42
|
+
}), h(() => () => {
|
|
43
43
|
M && x && x();
|
|
44
|
-
}, []),
|
|
45
|
-
var l,
|
|
46
|
-
if (
|
|
44
|
+
}, []), h(() => {
|
|
45
|
+
var l, i;
|
|
46
|
+
if (E(void 0), F(void 0), !((l = e == null ? void 0 : e.labels) != null && l.length))
|
|
47
47
|
return;
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
}, [e,
|
|
51
|
-
e != null && e.fileUrl &&
|
|
48
|
+
const a = (i = m || e) == null ? void 0 : i.labels.reduce((r, f) => (r[f.id] ? ++r[f.id] : r[f.id] = 1, r), {});
|
|
49
|
+
D(a || {});
|
|
50
|
+
}, [e, m]), h(() => {
|
|
51
|
+
e != null && e.fileUrl && R(!0);
|
|
52
52
|
}, [e == null ? void 0 : e.fileUrl]);
|
|
53
53
|
const P = () => {
|
|
54
|
-
|
|
54
|
+
u.current && R(!1);
|
|
55
55
|
};
|
|
56
|
-
return window.onresize = P, /* @__PURE__ */
|
|
56
|
+
return window.onresize = P, /* @__PURE__ */ n("div", {
|
|
57
57
|
className: "ocr-mark",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ n(G, {
|
|
59
59
|
className: "ocr-detail",
|
|
60
|
-
children: /* @__PURE__ */ q(
|
|
60
|
+
children: /* @__PURE__ */ q(H, {
|
|
61
61
|
className: "detail-content",
|
|
62
|
-
children: [e && /* @__PURE__ */
|
|
63
|
-
|
|
62
|
+
children: [((p = e == null ? void 0 : e.sampleFileName) == null ? void 0 : p.name) && /* @__PURE__ */ n("div", {
|
|
63
|
+
className: "ocr-img-detail-name-overlay",
|
|
64
|
+
children: e.sampleFileName.name
|
|
65
|
+
}), e && /* @__PURE__ */ n(J, {
|
|
66
|
+
disabled: L,
|
|
64
67
|
id: e.id,
|
|
65
|
-
canvasElement:
|
|
68
|
+
canvasElement: N.current,
|
|
66
69
|
imageUrl: e == null ? void 0 : e.fileUrl,
|
|
67
|
-
categories:
|
|
68
|
-
labels: (C = e.labels) == null ? void 0 : C.map((
|
|
69
|
-
box:
|
|
70
|
+
categories: y,
|
|
71
|
+
labels: (C = e.labels) == null ? void 0 : C.map((a) => c(d({}, a), {
|
|
72
|
+
box: a.box.length < 5 ? [...a.box, a.box[0]] : a.box || []
|
|
70
73
|
})),
|
|
71
|
-
onChange: (
|
|
74
|
+
onChange: (a) => {
|
|
72
75
|
const l = c(d({}, e), {
|
|
73
|
-
labels:
|
|
74
|
-
box:
|
|
76
|
+
labels: a.map((i) => c(d({}, i), {
|
|
77
|
+
box: i.box.length > 4 ? i.box.splice(0, 4) : i.box
|
|
75
78
|
}))
|
|
76
79
|
});
|
|
77
80
|
v && v(l);
|
|
78
81
|
},
|
|
79
|
-
renderLabelItem:
|
|
80
|
-
}), /* @__PURE__ */
|
|
82
|
+
renderLabelItem: U
|
|
83
|
+
}), /* @__PURE__ */ n("div", {
|
|
81
84
|
className: "select-main",
|
|
82
|
-
ref:
|
|
83
|
-
onContextMenu: (
|
|
84
|
-
|
|
85
|
+
ref: j,
|
|
86
|
+
onContextMenu: (a) => {
|
|
87
|
+
a.preventDefault();
|
|
85
88
|
},
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
ref:
|
|
89
|
+
children: /* @__PURE__ */ n("canvas", {
|
|
90
|
+
ref: N,
|
|
88
91
|
id: "marking-canvas",
|
|
89
92
|
style: {
|
|
90
93
|
width: "100%",
|
|
@@ -97,5 +100,5 @@ const ee = (s) => {
|
|
|
97
100
|
});
|
|
98
101
|
};
|
|
99
102
|
export {
|
|
100
|
-
|
|
103
|
+
se as default
|
|
101
104
|
};
|
|
@@ -108,7 +108,7 @@ const me = T.default || T, {
|
|
|
108
108
|
className: "select-main",
|
|
109
109
|
ref: H,
|
|
110
110
|
children: [((M = e == null ? void 0 : e.sampleFileName) == null ? void 0 : M.name) && /* @__PURE__ */ t("div", {
|
|
111
|
-
className: "img-detail-name-overlay",
|
|
111
|
+
className: "ocr-img-detail-name-overlay",
|
|
112
112
|
children: e.sampleFileName.name
|
|
113
113
|
}), /* @__PURE__ */ t(re, {
|
|
114
114
|
zoomMin: 0.1,
|