@glodon-aiot/dataset-annotation 3.24.0-alpha.6 → 3.25.0-alpha.7
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/ClassificationAnnotation/index.mjs +374 -325
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +82 -78
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +28 -26
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +173 -166
- package/dist/es/components/DetectionAnnotation/index.mjs +478 -473
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +249 -230
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +103 -98
- package/dist/es/components/OcrAnnotation/index.mjs +281 -248
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +277 -272
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +42 -40
- package/dist/es/components/VLMAnnotationDetail/index.mjs +331 -278
- package/dist/es/index.mjs +1 -1
- package/dist/es/utils/checkVlmSampleLabeled.mjs +7 -0
- package/dist/es/utils/scrollSampleIntoView.mjs +16 -0
- package/dist/lib/index.js +4 -4
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +2 -0
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +2 -0
- package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +2 -0
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +6 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +5 -0
- package/dist/src/utils/checkVlmSampleLabeled.d.ts +8 -0
- package/dist/src/utils/scrollSampleIntoView.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1,150 +1,154 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var a in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var a of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
import { jsxs as m, jsx as
|
|
14
|
-
import { useRef as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { useKeyPress as
|
|
1
|
+
var V = Object.defineProperty, S = Object.defineProperties;
|
|
2
|
+
var ee = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var A = Object.getOwnPropertySymbols;
|
|
4
|
+
var ie = Object.prototype.hasOwnProperty, se = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var B = (n, t, a) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[t] = a, b = (n, t) => {
|
|
6
|
+
for (var a in t || (t = {}))
|
|
7
|
+
ie.call(t, a) && B(n, a, t[a]);
|
|
8
|
+
if (A)
|
|
9
|
+
for (var a of A(t))
|
|
10
|
+
se.call(t, a) && B(n, a, t[a]);
|
|
11
|
+
return n;
|
|
12
|
+
}, x = (n, t) => S(n, ee(t));
|
|
13
|
+
import { jsxs as m, jsx as d } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as H, useState as h, useEffect as U } from "react";
|
|
15
|
+
import { Button as K, Spin as le } from "antd";
|
|
16
|
+
import { useKeyPress as O } from "ahooks";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
const
|
|
23
|
-
var
|
|
18
|
+
import te from "../Labels/index.mjs";
|
|
19
|
+
import oe from "../LabelMaker/index.mjs";
|
|
20
|
+
import q from "../../../Iconfont/index.mjs";
|
|
21
|
+
import ae from "../../../DetectionStatus/index.mjs";
|
|
22
|
+
const Le = (n) => {
|
|
23
|
+
var z, F, M;
|
|
24
24
|
const {
|
|
25
|
-
datasetId:
|
|
25
|
+
datasetId: t,
|
|
26
26
|
isImageDetailVisible: a = !0,
|
|
27
27
|
currentSample: e,
|
|
28
28
|
onNextClick: g,
|
|
29
29
|
onPrevClick: v,
|
|
30
30
|
labels: r = [],
|
|
31
|
-
editing:
|
|
31
|
+
editing: G,
|
|
32
32
|
onRefresh: L,
|
|
33
|
-
onChange:
|
|
34
|
-
isPreLabel:
|
|
33
|
+
onChange: j,
|
|
34
|
+
isPreLabel: C,
|
|
35
35
|
settingHide: D,
|
|
36
36
|
imgCount: f,
|
|
37
|
-
readonly:
|
|
37
|
+
readonly: J,
|
|
38
38
|
showLabelList: E = !0,
|
|
39
|
-
renderLabelItem:
|
|
40
|
-
onLoadingChange: I
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
renderLabelItem: Q,
|
|
40
|
+
onLoadingChange: I,
|
|
41
|
+
switchingSample: P
|
|
42
|
+
} = n, T = H(null), W = H({}), [u, X] = h({}), [y, N] = h(), [o, p] = h(), [Y, Z] = h(!1), [_, k] = h(), w = !!P || !!(e != null && e.fileUrl) && _ !== e.fileUrl;
|
|
43
|
+
O("rightarrow", () => {
|
|
43
44
|
g && g();
|
|
44
|
-
}),
|
|
45
|
+
}), O("leftarrow", () => {
|
|
45
46
|
v && v();
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
}, []),
|
|
47
|
+
}), U(() => () => {
|
|
48
|
+
Y && L && L();
|
|
49
|
+
}, []), U(() => {
|
|
49
50
|
var s, l;
|
|
50
|
-
if (N(void 0), (e == null ? void 0 : e.id) !== (
|
|
51
|
+
if (N(void 0), (e == null ? void 0 : e.id) !== (o == null ? void 0 : o.id) && p(void 0), !a || !((s = e == null ? void 0 : e.labels) != null && s.length))
|
|
51
52
|
return;
|
|
52
|
-
const i = (l =
|
|
53
|
-
|
|
54
|
-
}, [a, e,
|
|
55
|
-
I && I(
|
|
56
|
-
}, [
|
|
57
|
-
if (
|
|
53
|
+
const i = (l = o || e) == null ? void 0 : l.labels.reduce((c, R) => (c[R.id] ? ++c[R.id] : c[R.id] = 1, c), {});
|
|
54
|
+
X(i || {});
|
|
55
|
+
}, [a, e, o]), U(() => {
|
|
56
|
+
I && I(w, e == null ? void 0 : e.fileUrl);
|
|
57
|
+
}, [w, e == null ? void 0 : e.fileUrl, I]), U(() => {
|
|
58
|
+
if (o != null && o.labels) {
|
|
58
59
|
const i = [];
|
|
59
|
-
|
|
60
|
+
o.labels.forEach((s) => {
|
|
60
61
|
const l = r.find((c) => c.id === s.id);
|
|
61
|
-
l && i.push(
|
|
62
|
+
l && i.push(x(b({}, s), {
|
|
62
63
|
label: l.label
|
|
63
64
|
}));
|
|
64
|
-
}),
|
|
65
|
+
}), o.labels = i, p(b({}, o));
|
|
65
66
|
}
|
|
66
67
|
}, [r]);
|
|
67
|
-
const
|
|
68
|
-
|
|
68
|
+
const $ = () => {
|
|
69
|
+
T.current && k(e == null ? void 0 : e.fileUrl);
|
|
69
70
|
};
|
|
70
|
-
return window.onresize =
|
|
71
|
+
return window.onresize = $, /* @__PURE__ */ m("div", {
|
|
71
72
|
className: "detection-image-detail",
|
|
72
73
|
children: [/* @__PURE__ */ m("div", {
|
|
73
74
|
className: "detail-image",
|
|
74
75
|
children: [D ? /* @__PURE__ */ m("div", {
|
|
75
76
|
className: "img-detail-info",
|
|
76
77
|
children: ["第 ", f == null ? void 0 : f.index, " 张 / 共 ", f == null ? void 0 : f.total, " 张"]
|
|
77
|
-
}) : /* @__PURE__ */
|
|
78
|
+
}) : /* @__PURE__ */ d("div", {
|
|
78
79
|
className: "img-detail-info",
|
|
79
80
|
children: f == null ? void 0 : f.index
|
|
80
81
|
}), /* @__PURE__ */ m("div", {
|
|
81
82
|
className: "detail-content",
|
|
82
|
-
children: [v && /* @__PURE__ */
|
|
83
|
+
children: [v && /* @__PURE__ */ d(K, {
|
|
83
84
|
className: "select-prev",
|
|
84
|
-
icon: /* @__PURE__ */
|
|
85
|
+
icon: /* @__PURE__ */ d(q, {
|
|
85
86
|
type: "icon-zuojiantou"
|
|
86
87
|
}),
|
|
87
88
|
type: "text",
|
|
88
|
-
disabled:
|
|
89
|
+
disabled: w,
|
|
89
90
|
onClick: () => v(),
|
|
90
91
|
tabIndex: 0
|
|
91
92
|
}), /* @__PURE__ */ m("div", {
|
|
92
93
|
className: "select-main",
|
|
93
|
-
ref:
|
|
94
|
-
children: [((
|
|
94
|
+
ref: W,
|
|
95
|
+
children: [((z = e == null ? void 0 : e.sampleFileName) == null ? void 0 : z.name) && /* @__PURE__ */ d("div", {
|
|
95
96
|
className: "img-detail-name-overlay",
|
|
96
97
|
children: e.sampleFileName.name
|
|
97
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ d("div", {
|
|
98
99
|
className: "detection-status-wrapper",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ d(ae, {
|
|
100
101
|
sample: e
|
|
101
102
|
})
|
|
102
|
-
}), /* @__PURE__ */
|
|
103
|
-
disabled:
|
|
103
|
+
}), /* @__PURE__ */ d(oe, {
|
|
104
|
+
disabled: J,
|
|
104
105
|
imageUrl: (e == null ? void 0 : e.fileUrl) || "",
|
|
105
106
|
pen: y,
|
|
106
|
-
labels: ((
|
|
107
|
+
labels: ((F = o ? o.labels : e == null ? void 0 : e.labels) == null ? void 0 : F.map((i) => {
|
|
107
108
|
var s;
|
|
108
|
-
return
|
|
109
|
+
return x(b({}, i), {
|
|
109
110
|
color: ((s = r.find((l) => l.id === i.id)) == null ? void 0 : s.color) || ""
|
|
110
111
|
});
|
|
111
112
|
})) || [],
|
|
112
|
-
onImageLoad: () =>
|
|
113
|
-
onImageError: () =>
|
|
113
|
+
onImageLoad: () => k(e == null ? void 0 : e.fileUrl),
|
|
114
|
+
onImageError: () => k(e == null ? void 0 : e.fileUrl),
|
|
114
115
|
onChange: (i) => {
|
|
115
116
|
if (N(void 0), !e)
|
|
116
117
|
return;
|
|
117
|
-
const s =
|
|
118
|
+
const s = x(b({}, e), {
|
|
118
119
|
labels: i.map((l) => ({
|
|
119
120
|
id: l.id,
|
|
120
121
|
label: l.label,
|
|
121
122
|
box: l.box
|
|
122
123
|
}))
|
|
123
124
|
});
|
|
124
|
-
|
|
125
|
+
p(s), j && j(s);
|
|
125
126
|
},
|
|
126
|
-
isPreLabel:
|
|
127
|
-
renderLabelItem:
|
|
128
|
-
}, E ? "with-slide" : "no-slide")
|
|
129
|
-
|
|
127
|
+
isPreLabel: C,
|
|
128
|
+
renderLabelItem: Q
|
|
129
|
+
}, E ? "with-slide" : "no-slide"), P && /* @__PURE__ */ d("div", {
|
|
130
|
+
className: "sample-switching-mask",
|
|
131
|
+
children: /* @__PURE__ */ d(le, {})
|
|
132
|
+
})]
|
|
133
|
+
}), g && /* @__PURE__ */ d(K, {
|
|
130
134
|
className: "select-next",
|
|
131
|
-
icon: /* @__PURE__ */
|
|
135
|
+
icon: /* @__PURE__ */ d(q, {
|
|
132
136
|
type: "icon-youjiantou"
|
|
133
137
|
}),
|
|
134
138
|
type: "text",
|
|
135
|
-
disabled:
|
|
139
|
+
disabled: w,
|
|
136
140
|
onClick: () => g()
|
|
137
141
|
})]
|
|
138
142
|
})]
|
|
139
|
-
}), (!!(r != null && r.length) ||
|
|
143
|
+
}), (!!(r != null && r.length) || G) && E && /* @__PURE__ */ d("div", {
|
|
140
144
|
className: "detail-slide",
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
-
datasetId:
|
|
145
|
+
children: /* @__PURE__ */ d(te, {
|
|
146
|
+
datasetId: t,
|
|
143
147
|
selectMode: "single",
|
|
144
|
-
data: ((
|
|
148
|
+
data: ((M = Object.keys(u)) == null ? void 0 : M.map((i) => {
|
|
145
149
|
const s = r.find((l) => l.id === i);
|
|
146
150
|
if (s)
|
|
147
|
-
return s.count =
|
|
151
|
+
return s.count = u[i], s;
|
|
148
152
|
}).filter((i) => !!i)) || [],
|
|
149
153
|
shortcut: !0,
|
|
150
154
|
selected: y ? [y] : [],
|
|
@@ -161,14 +165,14 @@ const ge = (d) => {
|
|
|
161
165
|
N(s);
|
|
162
166
|
},
|
|
163
167
|
onListChange: () => {
|
|
164
|
-
|
|
168
|
+
Z(!0), L && L();
|
|
165
169
|
},
|
|
166
|
-
isPreLabel:
|
|
170
|
+
isPreLabel: C,
|
|
167
171
|
settingHide: D
|
|
168
172
|
})
|
|
169
173
|
})]
|
|
170
174
|
});
|
|
171
175
|
};
|
|
172
176
|
export {
|
|
173
|
-
|
|
177
|
+
Le as default
|
|
174
178
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { useKeyPress as
|
|
2
|
+
import { useState as z, useCallback as F } from "react";
|
|
3
|
+
import { Modal as L, Button as l, Tabs as H, Space as R, Tooltip as S } from "antd";
|
|
4
|
+
import { useKeyPress as N } from "ahooks";
|
|
5
5
|
import q from "../ImageDetail/index.mjs";
|
|
6
6
|
import "./style.less.mjs";
|
|
7
7
|
import G from "../../../DataEmpty/index.mjs";
|
|
8
8
|
import { ISampleActionType as h } from "../../index.mjs";
|
|
9
|
-
const
|
|
9
|
+
const $ = (k) => {
|
|
10
10
|
const {
|
|
11
11
|
datasetId: D,
|
|
12
|
-
setIsImageDetailVisible:
|
|
13
|
-
isImageDetailVisible:
|
|
12
|
+
setIsImageDetailVisible: p,
|
|
13
|
+
isImageDetailVisible: b = !0,
|
|
14
14
|
currentSample: e,
|
|
15
15
|
onNextClick: o,
|
|
16
16
|
onPrevClick: s,
|
|
@@ -27,20 +27,21 @@ const _ = (w) => {
|
|
|
27
27
|
onEnterEdit: y,
|
|
28
28
|
onBackToDetail: C,
|
|
29
29
|
onLoadingChange: c,
|
|
30
|
+
switchingSample: B,
|
|
30
31
|
filterItems: u,
|
|
31
|
-
filterMode:
|
|
32
|
+
filterMode: K,
|
|
32
33
|
onFilterChange: I,
|
|
33
34
|
previewMode: t = !0,
|
|
34
35
|
canLabel: r = !1,
|
|
35
|
-
canDelete:
|
|
36
|
-
} =
|
|
37
|
-
|
|
36
|
+
canDelete: w = !1
|
|
37
|
+
} = k, [f, O] = z(!1), V = F((m, x) => {
|
|
38
|
+
O(m), c == null || c(m, x);
|
|
38
39
|
}, [c]);
|
|
39
|
-
return
|
|
40
|
+
return N("rightarrow", () => {
|
|
40
41
|
t || o && o(e == null ? void 0 : e.confirmStatus);
|
|
41
|
-
}),
|
|
42
|
+
}), N("leftarrow", () => {
|
|
42
43
|
t || s && s(e == null ? void 0 : e.confirmStatus);
|
|
43
|
-
}), /* @__PURE__ */ d(
|
|
44
|
+
}), /* @__PURE__ */ d(L, {
|
|
44
45
|
title: /* @__PURE__ */ d("div", {
|
|
45
46
|
className: "detection-sample-detail-title",
|
|
46
47
|
children: [/* @__PURE__ */ i("span", {
|
|
@@ -53,8 +54,8 @@ const _ = (w) => {
|
|
|
53
54
|
})]
|
|
54
55
|
}),
|
|
55
56
|
width: "100%",
|
|
56
|
-
open:
|
|
57
|
-
onCancel: () =>
|
|
57
|
+
open: b,
|
|
58
|
+
onCancel: () => p(!1),
|
|
58
59
|
footer: null,
|
|
59
60
|
centered: !0,
|
|
60
61
|
wrapClassName: "detection-modal-wrap",
|
|
@@ -65,15 +66,15 @@ const _ = (w) => {
|
|
|
65
66
|
destroyOnClose: !1,
|
|
66
67
|
children: [/* @__PURE__ */ i("div", {
|
|
67
68
|
className: "detail-tabs",
|
|
68
|
-
children: !t && u && /* @__PURE__ */ i(
|
|
69
|
-
activeKey:
|
|
69
|
+
children: !t && u && /* @__PURE__ */ i(H, {
|
|
70
|
+
activeKey: K,
|
|
70
71
|
items: u,
|
|
71
72
|
onChange: (m) => I && I(m)
|
|
72
73
|
})
|
|
73
74
|
}), e ? /* @__PURE__ */ i(q, {
|
|
74
75
|
datasetId: D,
|
|
75
|
-
isImageDetailVisible:
|
|
76
|
-
setIsImageDetailVisible:
|
|
76
|
+
isImageDetailVisible: b,
|
|
77
|
+
setIsImageDetailVisible: p,
|
|
77
78
|
currentSample: e,
|
|
78
79
|
onNextClick: t ? () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
79
80
|
onPrevClick: t ? () => s == null ? void 0 : s(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
@@ -86,10 +87,11 @@ const _ = (w) => {
|
|
|
86
87
|
readonly: t || !r,
|
|
87
88
|
showLabelList: t ? !1 : j,
|
|
88
89
|
renderLabelItem: A,
|
|
89
|
-
onLoadingChange:
|
|
90
|
+
onLoadingChange: V,
|
|
91
|
+
switchingSample: B
|
|
90
92
|
}) : /* @__PURE__ */ i(G, {}), e && /* @__PURE__ */ i("div", {
|
|
91
93
|
className: "detail-footer",
|
|
92
|
-
children: t ? /* @__PURE__ */ d(
|
|
94
|
+
children: t ? /* @__PURE__ */ d(R, {
|
|
93
95
|
children: [y && r && /* @__PURE__ */ i("div", {
|
|
94
96
|
className: "detail-actions",
|
|
95
97
|
children: /* @__PURE__ */ i(l, {
|
|
@@ -97,7 +99,7 @@ const _ = (w) => {
|
|
|
97
99
|
onClick: y,
|
|
98
100
|
children: "标注"
|
|
99
101
|
})
|
|
100
|
-
}),
|
|
102
|
+
}), w && /* @__PURE__ */ i(l, {
|
|
101
103
|
danger: !0,
|
|
102
104
|
onClick: g,
|
|
103
105
|
children: "删除数据"
|
|
@@ -119,7 +121,7 @@ const _ = (w) => {
|
|
|
119
121
|
})]
|
|
120
122
|
}), /* @__PURE__ */ d("div", {
|
|
121
123
|
className: "footer-right",
|
|
122
|
-
children: [r && e.confirmStatus === 1 && /* @__PURE__ */ i(
|
|
124
|
+
children: [r && e.confirmStatus === 1 && /* @__PURE__ */ i(S, {
|
|
123
125
|
title: /* @__PURE__ */ i("span", {
|
|
124
126
|
style: {
|
|
125
127
|
color: "#ff9800"
|
|
@@ -130,7 +132,7 @@ const _ = (w) => {
|
|
|
130
132
|
children: /* @__PURE__ */ i(l, {
|
|
131
133
|
type: "primary",
|
|
132
134
|
onClick: () => {
|
|
133
|
-
|
|
135
|
+
L.confirm({
|
|
134
136
|
title: "确认",
|
|
135
137
|
content: "是否确认当前标注?",
|
|
136
138
|
onOk: () => {
|
|
@@ -154,7 +156,7 @@ const _ = (w) => {
|
|
|
154
156
|
},
|
|
155
157
|
disabled: n,
|
|
156
158
|
children: "保存标注"
|
|
157
|
-
}),
|
|
159
|
+
}), w && /* @__PURE__ */ i(l, {
|
|
158
160
|
onClick: g,
|
|
159
161
|
disabled: n,
|
|
160
162
|
children: "删除数据"
|
|
@@ -165,5 +167,5 @@ const _ = (w) => {
|
|
|
165
167
|
});
|
|
166
168
|
};
|
|
167
169
|
export {
|
|
168
|
-
|
|
170
|
+
$ as default
|
|
169
171
|
};
|