@glodon-aiot/dataset-annotation 3.25.1-alpha.6 → 3.26.0-alpha.4
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/OCRImageViewer/index.mjs +117 -130
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +92 -94
- package/dist/es/index.mjs +15 -21
- 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 +4 -37
- package/dist/src/components/OCRImageViewer/index.d.ts +0 -1
- 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/index.d.ts +0 -6
- package/dist/src/utils/reactCompatibility.d.ts +5 -0
- package/package.json +2 -2
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -8
- package/dist/es/_virtual/dayjs.min.mjs +0 -4
- package/dist/es/components/VersionCompare/VersionCompareSelectModal/index.mjs +0 -122
- package/dist/es/components/VersionCompare/adapter.mjs +0 -215
- package/dist/es/components/VersionCompare/components/DataChangeStatsCard.mjs +0 -68
- package/dist/es/components/VersionCompare/components/DiffValue.mjs +0 -31
- package/dist/es/components/VersionCompare/components/LabelComparisonCard.mjs +0 -130
- package/dist/es/components/VersionCompare/components/ModifiedSampleCompareModal.mjs +0 -207
- package/dist/es/components/VersionCompare/components/SampleChangeDetailsCard.mjs +0 -160
- package/dist/es/components/VersionCompare/components/SingleSampleDetailModal.mjs +0 -165
- package/dist/es/components/VersionCompare/components/VersionCompareHeader.mjs +0 -106
- package/dist/es/components/VersionCompare/components/VersionOverviewCard.mjs +0 -70
- package/dist/es/components/VersionCompare/index.mjs +0 -416
- package/dist/es/components/VersionCompare/mock.mjs +0 -571
- package/dist/es/components/VersionCompare/style.less.mjs +0 -4
- package/dist/es/components/VersionCompare/utils/labelColors.mjs +0 -45
- package/dist/es/createDatasetVersionCompare/index.mjs +0 -124
- package/dist/es/node_modules/dayjs/dayjs.min.mjs +0 -324
- package/dist/src/components/VersionCompare/VersionCompareSelectModal/index.d.ts +0 -16
- package/dist/src/components/VersionCompare/adapter.d.ts +0 -50
- package/dist/src/components/VersionCompare/components/DataChangeStatsCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/components/DiffValue.d.ts +0 -23
- package/dist/src/components/VersionCompare/components/LabelComparisonCard.d.ts +0 -12
- package/dist/src/components/VersionCompare/components/ModifiedSampleCompareModal.d.ts +0 -48
- package/dist/src/components/VersionCompare/components/SampleChangeDetailsCard.d.ts +0 -21
- package/dist/src/components/VersionCompare/components/SingleSampleDetailModal.d.ts +0 -46
- package/dist/src/components/VersionCompare/components/VersionCompareHeader.d.ts +0 -13
- package/dist/src/components/VersionCompare/components/VersionOverviewCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/index.d.ts +0 -34
- package/dist/src/components/VersionCompare/mock.d.ts +0 -25
- package/dist/src/components/VersionCompare/types.d.ts +0 -75
- package/dist/src/components/VersionCompare/utils/labelColors.d.ts +0 -13
- package/dist/src/createDatasetVersionCompare/index.d.ts +0 -26
|
@@ -1,186 +1,177 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as E, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as pt, useRef as _, useState as i, useEffect as vt, useImperativeHandle as It } from "react";
|
|
3
3
|
import "./style.less.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { Space as
|
|
6
|
-
import { ZoomInOutlined as
|
|
7
|
-
import { useKeyPress as
|
|
8
|
-
const
|
|
9
|
-
var
|
|
4
|
+
import Mt from "classnames";
|
|
5
|
+
import { Space as wt, Tooltip as k, Button as L } from "antd";
|
|
6
|
+
import { ZoomInOutlined as xt, ZoomOutOutlined as yt, DragOutlined as St } from "@ant-design/icons";
|
|
7
|
+
import { useKeyPress as tt } from "ahooks";
|
|
8
|
+
const Dt = pt((O, et) => {
|
|
9
|
+
var Q;
|
|
10
10
|
const {
|
|
11
|
-
url:
|
|
12
|
-
offsetEdge:
|
|
13
|
-
zoomable:
|
|
14
|
-
zoomStep:
|
|
15
|
-
zoomMax:
|
|
11
|
+
url: R,
|
|
12
|
+
offsetEdge: ot = [50, 50, 50, 50],
|
|
13
|
+
zoomable: b = !0,
|
|
14
|
+
zoomStep: p = 0.02,
|
|
15
|
+
zoomMax: v = 2,
|
|
16
16
|
zoomMin: I = 0,
|
|
17
|
-
onImageLoad:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = B, h = k({}), y = k({}), [Z, ce] = i(0), [$, ae] = i(0), [l, N] = i(1), [u, g] = i(0), [m, f] = i(0), [r, P] = i(0), [c, D] = i(0), [le, ue] = i(""), q = !!v && le === v, [K, W] = i(!1), [V, me] = i(), [x, C] = i({
|
|
17
|
+
onImageLoad: X,
|
|
18
|
+
labels: N
|
|
19
|
+
} = O, M = _({}), w = _({}), [j, nt] = i(0), [B, st] = i(0), [l, P] = i(1), [u, f] = i(0), [g, d] = i(0), [r, z] = i(0), [c, D] = i(0), [it, U] = i(!1), [Z, x] = i(!1), [$, rt] = i(), [y, S] = i({
|
|
21
20
|
x: 0,
|
|
22
21
|
y: 0
|
|
23
|
-
}), [
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
}), [q, K, V, A] = ot, [a, T] = i((Q = O.draggable) != null ? Q : !0);
|
|
23
|
+
tt("ctrl", () => {
|
|
24
|
+
T(!0);
|
|
26
25
|
}, {
|
|
27
26
|
events: ["keydown"]
|
|
28
|
-
}),
|
|
29
|
-
|
|
27
|
+
}), tt("ctrl", () => {
|
|
28
|
+
T(!1);
|
|
30
29
|
}, {
|
|
31
30
|
events: ["keyup"]
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
}), vt(() => {
|
|
32
|
+
U(!1);
|
|
33
|
+
}, [R]);
|
|
34
|
+
const F = () => {
|
|
35
|
+
if (!w.current)
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
const H = () => {
|
|
42
|
-
if (!j || l >= M)
|
|
37
|
+
const t = w.current.clientWidth, e = w.current.clientHeight, o = M.current.naturalWidth, n = M.current.naturalHeight, m = t / o, H = e / n, h = m < H ? m : H, mt = (t - o * h) / 2, ft = (e - n * h) / 2, dt = o * h, ht = n * h;
|
|
38
|
+
nt(t), st(e), P(h), f(mt), d(ft), z(dt), D(ht), U(!0), X && X(M.current);
|
|
39
|
+
}, C = () => {
|
|
40
|
+
if (!b || l >= v)
|
|
43
41
|
return;
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
42
|
+
let t = l * (1 + p), e = p;
|
|
43
|
+
t >= v && (t = v, e = v / l - 1), f(u - r * (e / 2)), d(g - c * (e / 2)), z(r + r * e), D(c + c * e), P(t), Y();
|
|
44
|
+
}, W = () => {
|
|
45
|
+
if (!b || l <= I)
|
|
48
46
|
return;
|
|
49
|
-
let
|
|
50
|
-
|
|
47
|
+
let t = l * (1 - p), e = p;
|
|
48
|
+
t <= I && (t = I, e = 1 - I / l), f(u - r * (-e / 2)), d(g - c * (-e / 2)), z(r + r * -e), D(c + c * -e), P(t), Y();
|
|
51
49
|
};
|
|
52
|
-
|
|
53
|
-
zoomIn:
|
|
54
|
-
zoomOut:
|
|
55
|
-
onImageLoad:
|
|
50
|
+
It(et, () => ({
|
|
51
|
+
zoomIn: C,
|
|
52
|
+
zoomOut: W,
|
|
53
|
+
onImageLoad: X
|
|
56
54
|
}));
|
|
57
|
-
const
|
|
58
|
-
|
|
55
|
+
const ct = (t) => (t.deltaY < 0 ? C() : W(), !1), at = (t) => {
|
|
56
|
+
x(!0);
|
|
59
57
|
const {
|
|
60
|
-
pageX:
|
|
58
|
+
pageX: e,
|
|
61
59
|
pageY: o
|
|
62
|
-
} =
|
|
63
|
-
|
|
64
|
-
x:
|
|
60
|
+
} = t;
|
|
61
|
+
S({
|
|
62
|
+
x: e,
|
|
65
63
|
y: o
|
|
66
64
|
});
|
|
67
|
-
},
|
|
68
|
-
if (!
|
|
65
|
+
}, lt = (t) => {
|
|
66
|
+
if (!Z)
|
|
69
67
|
return !1;
|
|
70
68
|
const {
|
|
71
|
-
pageX:
|
|
69
|
+
pageX: e,
|
|
72
70
|
pageY: o
|
|
73
|
-
} =
|
|
74
|
-
|
|
75
|
-
x:
|
|
71
|
+
} = t, n = e - y.x, m = o - y.y;
|
|
72
|
+
S({
|
|
73
|
+
x: e,
|
|
76
74
|
y: o
|
|
77
|
-
}),
|
|
78
|
-
},
|
|
79
|
-
|
|
75
|
+
}), f(u + n), d(g + m), Y();
|
|
76
|
+
}, G = () => {
|
|
77
|
+
x(!1);
|
|
80
78
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, t = () => {
|
|
85
|
-
Q.current();
|
|
86
|
-
};
|
|
87
|
-
return window.addEventListener("mouseup", e), window.addEventListener("resize", t), () => {
|
|
88
|
-
window.removeEventListener("mouseup", e), window.removeEventListener("resize", t);
|
|
89
|
-
};
|
|
90
|
-
}, []);
|
|
79
|
+
window.onmouseup = () => {
|
|
80
|
+
x(!1);
|
|
81
|
+
}, window.onresize = F;
|
|
91
82
|
const Y = () => {
|
|
92
|
-
u < -r +
|
|
93
|
-
},
|
|
83
|
+
u < -r + A && f(-r + A), g < -c + q && d(-c + q), u > j - K && f(j - K), g > B - V && d(B - V);
|
|
84
|
+
}, ut = (t) => {
|
|
94
85
|
const {
|
|
95
|
-
touches:
|
|
96
|
-
} =
|
|
97
|
-
if (
|
|
86
|
+
touches: e
|
|
87
|
+
} = t;
|
|
88
|
+
if (x(!0), e.length < 2) {
|
|
98
89
|
const {
|
|
99
90
|
clientX: o,
|
|
100
91
|
clientY: n
|
|
101
|
-
} =
|
|
102
|
-
|
|
92
|
+
} = e[0];
|
|
93
|
+
S({
|
|
103
94
|
x: o,
|
|
104
95
|
y: n
|
|
105
96
|
});
|
|
106
97
|
} else
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
if (!
|
|
98
|
+
rt(e);
|
|
99
|
+
}, gt = (t) => {
|
|
100
|
+
if (!Z || !t.touches)
|
|
110
101
|
return !1;
|
|
111
102
|
const {
|
|
112
|
-
clientX:
|
|
103
|
+
clientX: e,
|
|
113
104
|
clientY: o
|
|
114
|
-
} =
|
|
115
|
-
if (
|
|
116
|
-
const n =
|
|
117
|
-
|
|
118
|
-
x:
|
|
105
|
+
} = t.touches[0];
|
|
106
|
+
if (t.touches.length < 2) {
|
|
107
|
+
const n = e - y.x, m = o - y.y;
|
|
108
|
+
S({
|
|
109
|
+
x: e,
|
|
119
110
|
y: o
|
|
120
|
-
}),
|
|
111
|
+
}), f(u + n), d(g + m), Y();
|
|
121
112
|
} else {
|
|
122
|
-
const n =
|
|
123
|
-
|
|
113
|
+
const n = t.touches, m = J(n[0], n[1]), H = J($[0], $[1]);
|
|
114
|
+
m > H ? C() : W();
|
|
124
115
|
}
|
|
125
|
-
},
|
|
126
|
-
const o =
|
|
116
|
+
}, J = (t, e) => {
|
|
117
|
+
const o = e.pageX - t.pageX, n = e.pageY - t.pageY;
|
|
127
118
|
return Math.sqrt(o * o + n * n);
|
|
128
119
|
};
|
|
129
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ E("div", {
|
|
130
121
|
className: "ocr-image-viewer",
|
|
131
122
|
children: [/* @__PURE__ */ s("div", {
|
|
132
123
|
className: "marker-toolbar",
|
|
133
124
|
children: /* @__PURE__ */ s("div", {
|
|
134
125
|
className: "create-mode-select",
|
|
135
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ E(wt, {
|
|
136
127
|
direction: "vertical",
|
|
137
128
|
size: 16,
|
|
138
|
-
children: [/* @__PURE__ */ s(
|
|
129
|
+
children: [/* @__PURE__ */ s(k, {
|
|
139
130
|
title: "放大-鼠标滚轮前滑",
|
|
140
131
|
placement: "right",
|
|
141
|
-
children: /* @__PURE__ */ s(
|
|
142
|
-
icon: /* @__PURE__ */ s(
|
|
132
|
+
children: /* @__PURE__ */ s(L, {
|
|
133
|
+
icon: /* @__PURE__ */ s(xt, {}),
|
|
143
134
|
onClick: () => {
|
|
144
|
-
|
|
135
|
+
C();
|
|
145
136
|
}
|
|
146
137
|
})
|
|
147
|
-
}), /* @__PURE__ */ s(
|
|
138
|
+
}), /* @__PURE__ */ s(k, {
|
|
148
139
|
title: "缩小-鼠标滚轮后滑",
|
|
149
140
|
placement: "right",
|
|
150
|
-
children: /* @__PURE__ */ s(
|
|
151
|
-
icon: /* @__PURE__ */ s(
|
|
141
|
+
children: /* @__PURE__ */ s(L, {
|
|
142
|
+
icon: /* @__PURE__ */ s(yt, {}),
|
|
152
143
|
onClick: () => {
|
|
153
|
-
|
|
144
|
+
W();
|
|
154
145
|
}
|
|
155
146
|
})
|
|
156
|
-
}), /* @__PURE__ */ s(
|
|
147
|
+
}), /* @__PURE__ */ s(k, {
|
|
157
148
|
title: "拖动-按住ctrl",
|
|
158
149
|
placement: "right",
|
|
159
|
-
children: /* @__PURE__ */ s(
|
|
160
|
-
icon: /* @__PURE__ */ s(
|
|
150
|
+
children: /* @__PURE__ */ s(L, {
|
|
151
|
+
icon: /* @__PURE__ */ s(St, {}),
|
|
161
152
|
className: a ? "active" : "",
|
|
162
153
|
onClick: () => {
|
|
163
|
-
|
|
154
|
+
T(!a);
|
|
164
155
|
}
|
|
165
156
|
})
|
|
166
157
|
})]
|
|
167
158
|
})
|
|
168
159
|
})
|
|
169
|
-
}), /* @__PURE__ */
|
|
170
|
-
className:
|
|
160
|
+
}), /* @__PURE__ */ E("div", {
|
|
161
|
+
className: Mt({
|
|
171
162
|
"image-map": !0,
|
|
172
163
|
draggable: a
|
|
173
164
|
}),
|
|
174
|
-
ref:
|
|
175
|
-
onMouseDown: a ?
|
|
176
|
-
onMouseMove: a ?
|
|
177
|
-
onMouseUp: a ?
|
|
178
|
-
onWheel:
|
|
179
|
-
onTouchStart: a ?
|
|
180
|
-
onTouchMove: a ?
|
|
181
|
-
onTouchEnd: a ?
|
|
182
|
-
onContextMenu: (
|
|
183
|
-
|
|
165
|
+
ref: w,
|
|
166
|
+
onMouseDown: a ? at : void 0,
|
|
167
|
+
onMouseMove: a ? lt : void 0,
|
|
168
|
+
onMouseUp: a ? G : void 0,
|
|
169
|
+
onWheel: ct,
|
|
170
|
+
onTouchStart: a ? ut : void 0,
|
|
171
|
+
onTouchMove: a ? gt : void 0,
|
|
172
|
+
onTouchEnd: a ? G : void 0,
|
|
173
|
+
onContextMenu: (t) => {
|
|
174
|
+
t.preventDefault();
|
|
184
175
|
},
|
|
185
176
|
children: [/* @__PURE__ */ s("img", {
|
|
186
177
|
draggable: "false",
|
|
@@ -188,39 +179,35 @@ const ke = ye((B, ie) => {
|
|
|
188
179
|
style: {
|
|
189
180
|
position: "absolute",
|
|
190
181
|
left: u,
|
|
191
|
-
top:
|
|
182
|
+
top: g,
|
|
192
183
|
width: r,
|
|
193
|
-
height: c
|
|
194
|
-
visibility: q ? "visible" : "hidden"
|
|
195
|
-
},
|
|
196
|
-
ref: h,
|
|
197
|
-
onLoad: T,
|
|
198
|
-
onError: () => {
|
|
199
|
-
X == null || X();
|
|
184
|
+
height: c
|
|
200
185
|
},
|
|
201
|
-
|
|
186
|
+
ref: M,
|
|
187
|
+
onLoad: F,
|
|
188
|
+
src: R,
|
|
202
189
|
alt: ""
|
|
203
|
-
}),
|
|
190
|
+
}), it ? /* @__PURE__ */ s("svg", {
|
|
204
191
|
style: {
|
|
205
192
|
position: "absolute",
|
|
206
193
|
left: u,
|
|
207
|
-
top:
|
|
194
|
+
top: g,
|
|
208
195
|
width: r,
|
|
209
196
|
height: c
|
|
210
197
|
},
|
|
211
|
-
children:
|
|
198
|
+
children: N == null ? void 0 : N.map((t, e) => {
|
|
212
199
|
var o;
|
|
213
200
|
return /* @__PURE__ */ s("g", {
|
|
214
201
|
children: /* @__PURE__ */ s("polygon", {
|
|
215
202
|
className: "label-box",
|
|
216
|
-
points: (o =
|
|
217
|
-
},
|
|
218
|
-
},
|
|
203
|
+
points: (o = t == null ? void 0 : t.box) == null ? void 0 : o.map((n) => `${n[0] * l} ${n[1] * l}`).join(",")
|
|
204
|
+
}, t.id)
|
|
205
|
+
}, e);
|
|
219
206
|
})
|
|
220
207
|
}) : ""]
|
|
221
208
|
})]
|
|
222
209
|
});
|
|
223
210
|
});
|
|
224
211
|
export {
|
|
225
|
-
|
|
212
|
+
Dt as default
|
|
226
213
|
};
|