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