@glodon-aiot/dataset-annotation 3.16.0-alpha.37 → 3.16.0-alpha.39
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/OcrAnnotation/OCRBoxDetail/index.mjs +239 -0
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +175 -142
- package/dist/es/components/OcrAnnotation/index.mjs +268 -247
- package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +60 -60
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/OcrAnnotation/OCRBoxDetail/index.d.ts +20 -0
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +14 -5
- package/package.json +2 -2
|
@@ -1,178 +1,211 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Modal as
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useState as r, useContext as oe, useEffect as R } from "react";
|
|
3
|
+
import { Modal as I, Button as c, Tabs as z, Tooltip as se, Space as ie, message as w } from "antd";
|
|
4
4
|
import "./style.less.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { useKeyPress as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
import T from "react-json-view";
|
|
6
|
+
import { useKeyPress as j } from "ahooks";
|
|
7
|
+
import ne from "../../MarkDescriptions/index.mjs";
|
|
8
|
+
import P from "../../Iconfont/index.mjs";
|
|
9
|
+
import le from "../../../DatasetContext/index.mjs";
|
|
10
|
+
import re from "../../OCRImageViewer/index.mjs";
|
|
11
|
+
import de from "../../ScanTable/index.mjs";
|
|
12
|
+
import ce from "../OCRBoxDetail/index.mjs";
|
|
13
|
+
const me = T.default || T, {
|
|
14
|
+
TabPane: V
|
|
15
|
+
} = z, ke = (D) => {
|
|
16
|
+
var x, M, O;
|
|
16
17
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
mode: m = "preview",
|
|
19
|
+
visible: d,
|
|
20
|
+
onClose: C,
|
|
21
|
+
record: f,
|
|
22
|
+
onNextClick: g,
|
|
21
23
|
onPrevClick: b,
|
|
22
24
|
datasetId: i,
|
|
23
|
-
versionId:
|
|
24
|
-
ocrMarkTmpl:
|
|
25
|
-
handleMarkClick:
|
|
26
|
-
updateSampleList:
|
|
27
|
-
isPreLabel:
|
|
28
|
-
|
|
25
|
+
versionId: l,
|
|
26
|
+
ocrMarkTmpl: n,
|
|
27
|
+
handleMarkClick: F,
|
|
28
|
+
updateSampleList: J,
|
|
29
|
+
isPreLabel: p,
|
|
30
|
+
selectSampleId: K,
|
|
31
|
+
onSave: L,
|
|
32
|
+
filterMode: B,
|
|
33
|
+
pagination: E,
|
|
34
|
+
currentIndex: q,
|
|
35
|
+
onFilterModeChange: A,
|
|
36
|
+
onPaginationChange: U,
|
|
37
|
+
samples: W
|
|
38
|
+
} = D, G = u(null), H = u({}), [h, Q] = r("annotation"), [e, X] = r(), [Y, Z] = r(), [y, _] = r([]), [$, v] = r(!1), {
|
|
29
39
|
services: {
|
|
30
|
-
cvforceDatahub:
|
|
40
|
+
cvforceDatahub: o
|
|
31
41
|
},
|
|
32
42
|
featuresConfig: {
|
|
33
|
-
datasetManager:
|
|
43
|
+
datasetManager: N
|
|
34
44
|
} = {
|
|
35
45
|
datasetManager: !1
|
|
36
46
|
}
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}),
|
|
47
|
+
} = oe(le);
|
|
48
|
+
j("rightarrow", () => {
|
|
49
|
+
g();
|
|
50
|
+
}), j("leftarrow", () => {
|
|
41
51
|
b();
|
|
42
|
-
}),
|
|
43
|
-
i && (
|
|
44
|
-
}, [i]),
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
}), R(() => {
|
|
53
|
+
i && (o == null || o.listCategory(i).then((s) => _(s || [])));
|
|
54
|
+
}, [i]), R(() => {
|
|
55
|
+
d && i && l && f && m === "preview" && (o == null || o.getDatasetsIdVersionsVidSsamplesSid(i, l, f.id).then((s) => {
|
|
56
|
+
X(s);
|
|
47
57
|
}));
|
|
48
|
-
}, [
|
|
49
|
-
const
|
|
50
|
-
C(
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
58
|
+
}, [d, f]);
|
|
59
|
+
const S = () => {
|
|
60
|
+
C();
|
|
61
|
+
}, ee = (s) => {
|
|
62
|
+
Q(s);
|
|
63
|
+
}, te = (s) => {
|
|
64
|
+
Z(s);
|
|
65
|
+
}, ae = () => {
|
|
66
|
+
I.confirm({
|
|
57
67
|
title: "确认要删除此数据吗?",
|
|
58
68
|
content: "删除后不可恢复,请慎重操作",
|
|
59
69
|
onOk: () => {
|
|
60
|
-
!i || !
|
|
61
|
-
|
|
62
|
-
}).catch(() =>
|
|
70
|
+
!i || !l || !(e != null && e.id) || o == null || o.delDatasetsIdVersionsVidSamplesId(i, l, e.id).then(() => {
|
|
71
|
+
w.success("删除成功"), C(), J();
|
|
72
|
+
}).catch(() => w.error("删除失败"));
|
|
63
73
|
}
|
|
64
74
|
});
|
|
65
75
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
title: /* @__PURE__ */ a("div", {
|
|
76
|
+
return /* @__PURE__ */ t(I, {
|
|
77
|
+
title: m === "preview" ? /* @__PURE__ */ a("div", {
|
|
68
78
|
children: ["详情", /* @__PURE__ */ a("span", {
|
|
69
79
|
className: "ocr-modal-label-count",
|
|
70
|
-
children: ["标注框数量:", (
|
|
80
|
+
children: ["标注框数量:", (x = e == null ? void 0 : e.labels) == null ? void 0 : x.length]
|
|
71
81
|
})]
|
|
72
|
-
}),
|
|
82
|
+
}) : "标注",
|
|
73
83
|
width: "100%",
|
|
74
84
|
wrapClassName: "ocr-modal-wrap",
|
|
75
85
|
className: "ocr-modal",
|
|
76
|
-
|
|
86
|
+
style: {
|
|
87
|
+
padding: 12
|
|
88
|
+
},
|
|
89
|
+
open: d,
|
|
77
90
|
destroyOnClose: !0,
|
|
78
|
-
onCancel: () =>
|
|
91
|
+
onCancel: () => S(),
|
|
79
92
|
maskClosable: !1,
|
|
80
93
|
centered: !0,
|
|
81
94
|
footer: null,
|
|
82
|
-
children:
|
|
83
|
-
className: "ocr-detail",
|
|
95
|
+
children: m === "preview" ? /* @__PURE__ */ a(k, {
|
|
84
96
|
children: [/* @__PURE__ */ a("div", {
|
|
85
|
-
className: "detail
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
-
className: "
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
children: /* @__PURE__ */ a(V, {
|
|
117
|
-
className: "header-tab",
|
|
118
|
-
onChange: U,
|
|
119
|
-
activeKey: f,
|
|
120
|
-
children: [/* @__PURE__ */ s(I, {
|
|
121
|
-
tab: "标注信息"
|
|
122
|
-
}, "annotation"), /* @__PURE__ */ s(I, {
|
|
123
|
-
tab: "JSON"
|
|
124
|
-
}, "json")]
|
|
125
|
-
})
|
|
126
|
-
}), /* @__PURE__ */ a("div", {
|
|
127
|
-
className: "slide-main",
|
|
128
|
-
children: [f === "annotation" && /* @__PURE__ */ s(H, {
|
|
129
|
-
children: l === "TableOCR" ? /* @__PURE__ */ s(S, {
|
|
130
|
-
currentInfer: e == null ? void 0 : e.labels,
|
|
131
|
-
onCellSelect: (o) => W(o),
|
|
132
|
-
currentCell: L
|
|
133
|
-
}) : (M = e == null ? void 0 : e.labels) != null && M.length ? /* @__PURE__ */ s(Z, {
|
|
134
|
-
labels: e == null ? void 0 : e.labels,
|
|
135
|
-
catagories: q
|
|
136
|
-
}) : "暂无标注信息"
|
|
137
|
-
}), f === "json" && /* @__PURE__ */ s(ee, {
|
|
138
|
-
name: !1,
|
|
139
|
-
iconStyle: "square",
|
|
140
|
-
indentWidth: 2,
|
|
141
|
-
displayDataTypes: !1,
|
|
142
|
-
displayObjectSize: !1,
|
|
143
|
-
enableClipboard: !1,
|
|
144
|
-
src: l === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
|
|
97
|
+
className: "ocr-detail",
|
|
98
|
+
children: [/* @__PURE__ */ a("div", {
|
|
99
|
+
className: "detail-content",
|
|
100
|
+
children: [/* @__PURE__ */ t(c, {
|
|
101
|
+
className: "select-prev",
|
|
102
|
+
icon: /* @__PURE__ */ t(P, {
|
|
103
|
+
type: "icon-zuojiantou"
|
|
104
|
+
}),
|
|
105
|
+
type: "text",
|
|
106
|
+
onClick: () => b()
|
|
107
|
+
}), /* @__PURE__ */ a("div", {
|
|
108
|
+
className: "select-main",
|
|
109
|
+
ref: H,
|
|
110
|
+
children: [((M = e == null ? void 0 : e.sampleFileName) == null ? void 0 : M.name) && /* @__PURE__ */ t("div", {
|
|
111
|
+
className: "img-detail-name-overlay",
|
|
112
|
+
children: e.sampleFileName.name
|
|
113
|
+
}), /* @__PURE__ */ t(re, {
|
|
114
|
+
zoomMin: 0.1,
|
|
115
|
+
zoomMax: 10,
|
|
116
|
+
zoomStep: 0.1,
|
|
117
|
+
url: (e == null ? void 0 : e.fileUrl) || "",
|
|
118
|
+
ref: G,
|
|
119
|
+
labels: e == null ? void 0 : e.labels
|
|
120
|
+
})]
|
|
121
|
+
}), /* @__PURE__ */ t(c, {
|
|
122
|
+
className: "select-next",
|
|
123
|
+
icon: /* @__PURE__ */ t(P, {
|
|
124
|
+
type: "icon-youjiantou"
|
|
125
|
+
}),
|
|
126
|
+
type: "text",
|
|
127
|
+
onClick: () => g()
|
|
145
128
|
})]
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
129
|
+
}), n !== "DetectionOCR" && /* @__PURE__ */ a("div", {
|
|
130
|
+
className: "detail-slide",
|
|
131
|
+
children: [/* @__PURE__ */ t("div", {
|
|
132
|
+
className: "slide-header",
|
|
133
|
+
children: /* @__PURE__ */ a(z, {
|
|
134
|
+
className: "header-tab",
|
|
135
|
+
onChange: ee,
|
|
136
|
+
activeKey: h,
|
|
137
|
+
children: [/* @__PURE__ */ t(V, {
|
|
138
|
+
tab: "标注信息"
|
|
139
|
+
}, "annotation"), /* @__PURE__ */ t(V, {
|
|
140
|
+
tab: "JSON"
|
|
141
|
+
}, "json")]
|
|
142
|
+
})
|
|
143
|
+
}), /* @__PURE__ */ a("div", {
|
|
144
|
+
className: "slide-main",
|
|
145
|
+
children: [h === "annotation" && /* @__PURE__ */ t(k, {
|
|
146
|
+
children: n === "TableOCR" ? /* @__PURE__ */ t(de, {
|
|
147
|
+
currentInfer: e == null ? void 0 : e.labels,
|
|
148
|
+
onCellSelect: (s) => te(s),
|
|
149
|
+
currentCell: Y
|
|
150
|
+
}) : (O = e == null ? void 0 : e.labels) != null && O.length ? /* @__PURE__ */ t(ne, {
|
|
151
|
+
labels: e == null ? void 0 : e.labels,
|
|
152
|
+
catagories: y
|
|
153
|
+
}) : "暂无标注信息"
|
|
154
|
+
}), h === "json" && /* @__PURE__ */ t(me, {
|
|
155
|
+
name: !1,
|
|
156
|
+
iconStyle: "square",
|
|
157
|
+
indentWidth: 2,
|
|
158
|
+
displayDataTypes: !1,
|
|
159
|
+
displayObjectSize: !1,
|
|
160
|
+
enableClipboard: !1,
|
|
161
|
+
src: n === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
|
|
162
|
+
})]
|
|
170
163
|
})]
|
|
164
|
+
})]
|
|
165
|
+
}), /* @__PURE__ */ t("div", {
|
|
166
|
+
className: "ocr-mark-action",
|
|
167
|
+
style: n === "DetectionOCR" ? {
|
|
168
|
+
width: "100%"
|
|
169
|
+
} : void 0,
|
|
170
|
+
children: /* @__PURE__ */ t(se, {
|
|
171
|
+
title: "预标注进行中,请任务完成后再试",
|
|
172
|
+
open: $,
|
|
173
|
+
children: /* @__PURE__ */ a(ie, {
|
|
174
|
+
onMouseEnter: () => p && v(!0),
|
|
175
|
+
onMouseLeave: () => v(!1),
|
|
176
|
+
children: [/* @__PURE__ */ t(c, {
|
|
177
|
+
type: "primary",
|
|
178
|
+
disabled: n !== "StructKVCOCR" && n !== "DetectionOCR" || p,
|
|
179
|
+
onClick: () => F(e == null ? void 0 : e.id),
|
|
180
|
+
children: "标注"
|
|
181
|
+
}), N && N.delete && /* @__PURE__ */ t(c, {
|
|
182
|
+
danger: !0,
|
|
183
|
+
type: "ghost",
|
|
184
|
+
onClick: ae,
|
|
185
|
+
disabled: p,
|
|
186
|
+
children: "删除数据"
|
|
187
|
+
})]
|
|
188
|
+
})
|
|
171
189
|
})
|
|
172
|
-
})
|
|
173
|
-
})
|
|
190
|
+
})]
|
|
191
|
+
}) : /* @__PURE__ */ t(ce, {
|
|
192
|
+
visible: d,
|
|
193
|
+
selectSampleId: K,
|
|
194
|
+
ocrMarkTmpl: n,
|
|
195
|
+
datasetId: i,
|
|
196
|
+
versionId: l,
|
|
197
|
+
onClose: C,
|
|
198
|
+
onSave: L,
|
|
199
|
+
categories: y,
|
|
200
|
+
externalFilterMode: B,
|
|
201
|
+
onFilterModeChange: A,
|
|
202
|
+
onPaginationChange: U,
|
|
203
|
+
externalSamples: W,
|
|
204
|
+
externalPagination: E,
|
|
205
|
+
externalCurrentIndex: q
|
|
206
|
+
})
|
|
174
207
|
});
|
|
175
208
|
};
|
|
176
209
|
export {
|
|
177
|
-
|
|
210
|
+
ke as default
|
|
178
211
|
};
|