@glodon-aiot/dataset-annotation 3.2.2-beta.3 → 3.2.2-beta.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/es/Common/Page/index.mjs +29 -0
- package/dist/es/Common/Page/style.less.mjs +4 -0
- package/dist/es/Common/PageContent/index.mjs +18 -0
- package/dist/es/Common/PageHeader/index.mjs +39 -0
- package/dist/es/Common/PageHeader/style.less.mjs +4 -0
- package/dist/es/DatasetContext/index.mjs +11 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +4 -0
- package/dist/es/_virtual/minio.mjs +4 -0
- package/dist/es/access/images/data_empty.svg.mjs +4 -0
- package/dist/es/components/CompositionInput/index.mjs +53 -0
- package/dist/es/components/DataEmpty/index.mjs +51 -0
- package/dist/es/components/DataEmpty/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/PreSamplesPage/index.mjs +292 -0
- package/dist/es/components/DetectionAnnotation/PreSamplesPage/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/DisabledTooltip/index.mjs +23 -0
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +166 -0
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +51 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/FabricCustomize.mjs +42 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +283 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/icons/delete-icon.svg.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +315 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/Labels/index.mjs +201 -0
- package/dist/es/components/DetectionAnnotation/components/Labels/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/TagItem/index.mjs +144 -0
- package/dist/es/components/DetectionAnnotation/components/TagItem/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/icon_item_empty.svg.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/index.mjs +713 -0
- package/dist/es/components/DetectionAnnotation/style.less.mjs +4 -0
- package/dist/es/components/DetectionImageAnnotation/index.mjs +62 -0
- package/dist/es/components/DetectionImageAnnotation/style.less.mjs +4 -0
- package/dist/es/components/Iconfont/index.mjs +16 -0
- package/dist/es/components/MarkDescriptions/index.mjs +66 -0
- package/dist/es/components/MarkDescriptions/style.less.mjs +4 -0
- package/dist/es/components/OCRImageViewer/index.mjs +213 -0
- package/dist/es/components/OCRImageViewer/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/CategoryDrawer.mjs +136 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.mjs +57 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.mjs +73 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.mjs +55 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +366 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/index.mjs +255 -0
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.mjs +101 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/images/delete.png.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +756 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/index.mjs +231 -0
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +180 -0
- package/dist/es/components/OcrAnnotation/OcrModal/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/PreLabelOCR/PreLabelModal.mjs +281 -0
- package/dist/es/components/OcrAnnotation/PreLabelOCR/index.mjs +44 -0
- package/dist/es/components/OcrAnnotation/PreLabelOCR/style.less.mjs +4 -0
- package/dist/es/components/OcrAnnotation/constant.mjs +5 -0
- package/dist/es/components/OcrAnnotation/index.mjs +382 -0
- package/dist/es/components/OcrAnnotation/style.less.mjs +4 -0
- package/dist/es/components/OcrImageAnnotation/index.mjs +40 -0
- package/dist/es/components/OcrImageAnnotation/style.less.mjs +4 -0
- package/dist/es/components/PageNav/index.mjs +30 -0
- package/dist/es/components/PageNav/style.less.mjs +4 -0
- package/dist/es/components/PicZipImportModal/index.mjs +584 -0
- package/dist/es/components/PicZipImportModal/pic_zip.svg.mjs +4 -0
- package/dist/es/components/PicZipImportModal/pic_zip_json.svg.mjs +4 -0
- package/dist/es/components/PicZipImportModal/style.less.mjs +4 -0
- package/dist/es/components/PreLabelOCR/PreLabelModal.mjs +276 -0
- package/dist/es/components/PreLabelOCR/index.mjs +44 -0
- package/dist/es/components/PreLabelOCR/style.less.mjs +4 -0
- package/dist/es/components/ScanTable/index.mjs +97 -0
- package/dist/es/components/ScanTable/style.less.mjs +4 -0
- package/dist/es/components/Thumbnail/default.png.mjs +4 -0
- package/dist/es/components/Thumbnail/index.mjs +31 -0
- package/dist/es/components/Thumbnail/style.less.mjs +4 -0
- package/dist/es/components/hooks/Prompt.mjs +33 -0
- package/dist/es/constant.mjs +13 -0
- package/dist/es/createDatasetAnnotation/index.mjs +133 -0
- package/dist/es/createDetectionDatasetAnnotation/index.mjs +129 -0
- package/dist/es/createDetectionImageAnnotation/index.mjs +31 -0
- package/dist/es/createOcrDatasetAnnotation/index.mjs +129 -0
- package/dist/es/createOcrImageAnnotation/index.mjs +33 -0
- package/dist/es/featuresConfig.mjs +79 -0
- package/dist/es/index.mjs +13 -0
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio.mjs +28463 -0
- package/dist/es/utils/color.mjs +30 -0
- package/dist/es/utils/index.mjs +22 -0
- package/dist/es/utils/sign.mjs +33 -0
- package/dist/lib/index.js +130 -0
- package/dist/src/Common/Page/index.d.ts +1 -2
- package/dist/src/Common/PageHeader/index.d.ts +0 -1
- package/dist/src/DatasetContext/index.d.ts +3 -4
- package/dist/src/components/CompositionInput/index.d.ts +2 -2
- package/dist/src/components/DataEmpty/index.d.ts +1 -2
- package/dist/src/components/DetectionAnnotation/PreSamplesPage/index.d.ts +1 -2
- package/dist/src/components/DetectionAnnotation/components/DisabledTooltip/index.d.ts +2 -2
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -2
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/Drawable.d.ts +2 -2
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/RectLabel.d.ts +6 -5
- package/dist/src/components/DetectionAnnotation/components/LabelMaker/index.d.ts +0 -1
- package/dist/src/components/DetectionAnnotation/components/Labels/index.d.ts +0 -1
- package/dist/src/components/DetectionAnnotation/components/TagItem/index.d.ts +1 -2
- package/dist/src/components/DetectionAnnotation/index.d.ts +1 -2
- package/dist/src/components/DetectionImageAnnotation/index.d.ts +0 -2
- package/dist/src/components/Iconfont/font_3140028_iptomfpgyu.d.ts +0 -0
- package/dist/src/components/Iconfont/font_3454453_gu5ijeufyng.d.ts +0 -0
- package/dist/src/components/Iconfont/font_4108228_3slzqhoow93.d.ts +0 -0
- package/dist/src/components/Iconfont/font_4439177_k3mjwv7kzfd.d.ts +0 -0
- package/dist/src/components/Iconfont/index.d.ts +1 -2
- package/dist/src/components/MarkDescriptions/index.d.ts +0 -1
- package/dist/src/components/OCRImageViewer/index.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.d.ts +2 -2
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/MarkKVOCRModal/index.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +2 -2
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LableEditor.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/index.d.ts +0 -1
- package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/PreLabelOCR/PreLabelModal.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/PreLabelOCR/index.d.ts +1 -2
- package/dist/src/components/OcrAnnotation/index.d.ts +1 -2
- package/dist/src/components/OcrImageAnnotation/index.d.ts +0 -2
- package/dist/src/components/PageNav/index.d.ts +1 -2
- package/dist/src/components/PicZipImportModal/index.d.ts +1 -2
- package/dist/src/components/PreLabelOCR/PreLabelModal.d.ts +1 -2
- package/dist/src/components/PreLabelOCR/index.d.ts +1 -2
- package/dist/src/components/ScanTable/index.d.ts +1 -2
- package/dist/src/components/Thumbnail/index.d.ts +1 -2
- package/dist/src/components/hooks/Prompt.d.ts +0 -1
- package/dist/src/components/hooks/useBlocker.d.ts +1 -1
- package/dist/src/featuresConfig.d.ts +1 -1
- package/dist/src/utils/sign.d.ts +1 -1
- package/package.json +15 -6
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
var ne = Object.defineProperty, oe = Object.defineProperties;
|
|
2
|
+
var re = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var D = Object.getOwnPropertySymbols;
|
|
4
|
+
var se = Object.prototype.hasOwnProperty, ie = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var G = (f, c, r) => c in f ? ne(f, c, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[c] = r, w = (f, c) => {
|
|
6
|
+
for (var r in c || (c = {}))
|
|
7
|
+
se.call(c, r) && G(f, r, c[r]);
|
|
8
|
+
if (D)
|
|
9
|
+
for (var r of D(c))
|
|
10
|
+
ie.call(c, r) && G(f, r, c[r]);
|
|
11
|
+
return f;
|
|
12
|
+
}, T = (f, c) => oe(f, re(c));
|
|
13
|
+
import { jsx as C, jsxs as L } from "react/jsx-runtime";
|
|
14
|
+
import { Modal as le, Space as ce, Button as P, message as b, Tabs as J } from "antd";
|
|
15
|
+
import { useContext as ae, useRef as R, useState as h, useEffect as N } from "react";
|
|
16
|
+
import "./style.less.mjs";
|
|
17
|
+
import de from "../../DataEmpty/index.mjs";
|
|
18
|
+
import fe from "../../../DatasetContext/index.mjs";
|
|
19
|
+
import ue from "./ImageDetail/index.mjs";
|
|
20
|
+
const {
|
|
21
|
+
TabPane: $
|
|
22
|
+
} = J, ze = (f) => {
|
|
23
|
+
var W;
|
|
24
|
+
const {
|
|
25
|
+
visible: c,
|
|
26
|
+
selectSampleId: r,
|
|
27
|
+
datasetId: u,
|
|
28
|
+
versionId: x,
|
|
29
|
+
ocrMarkTmpl: pe,
|
|
30
|
+
onClose: Q,
|
|
31
|
+
onSave: V
|
|
32
|
+
} = f, {
|
|
33
|
+
services: {
|
|
34
|
+
cvforceDatahub: a
|
|
35
|
+
}
|
|
36
|
+
} = ae(fe), I = R(null);
|
|
37
|
+
R(null), R({});
|
|
38
|
+
const [n, d] = h(), [ge, j] = h(0), [g, z] = h([]), [M, S] = h(-1), [t, k] = h({
|
|
39
|
+
current: 1,
|
|
40
|
+
pageSize: 50
|
|
41
|
+
}), [B, E] = h(0), [O, A] = h(0), [p, U] = h(() => r ? "" : "nocode");
|
|
42
|
+
h(!1);
|
|
43
|
+
const [X, Y] = h([]);
|
|
44
|
+
N(() => {
|
|
45
|
+
const e = t.current || 1, l = t.pageSize || 50;
|
|
46
|
+
!u || !x || (a == null || a.getDatasetsIdVersionsVidSamples(u, x, {
|
|
47
|
+
labels: p ? [p] : void 0,
|
|
48
|
+
pageNo: e,
|
|
49
|
+
pageSize: l
|
|
50
|
+
}).then((s) => {
|
|
51
|
+
const o = s.recordList || [];
|
|
52
|
+
if (z(o), k(T(w({}, t), {
|
|
53
|
+
current: e,
|
|
54
|
+
pageSize: l,
|
|
55
|
+
total: s.totalResults
|
|
56
|
+
})), o.find((i) => i.id === r)) {
|
|
57
|
+
if (d(r ? o.find((i) => i.id === r) : o[0]), S(0), j(o.length), t.type === "next" && o.length) {
|
|
58
|
+
S(0);
|
|
59
|
+
const i = s.recordList[0];
|
|
60
|
+
d(i);
|
|
61
|
+
}
|
|
62
|
+
if (t.type === "prev" && o.length) {
|
|
63
|
+
S(t.pageSize - 1);
|
|
64
|
+
const i = s.recordList[t.pageSize - 1];
|
|
65
|
+
d(i);
|
|
66
|
+
}
|
|
67
|
+
} else if (r)
|
|
68
|
+
a.getDatasetsIdVersionsVidSsamplesSid(u, x, r).then((i) => {
|
|
69
|
+
d(i);
|
|
70
|
+
});
|
|
71
|
+
else {
|
|
72
|
+
if (d(o[0]), S(0), j(o.length), t.type === "next" && o.length) {
|
|
73
|
+
S(0);
|
|
74
|
+
const i = s.recordList[0];
|
|
75
|
+
d(i);
|
|
76
|
+
}
|
|
77
|
+
if (t.type === "prev" && o.length) {
|
|
78
|
+
S(t.pageSize - 1);
|
|
79
|
+
const i = s.recordList[t.pageSize - 1];
|
|
80
|
+
d(i);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}), v());
|
|
84
|
+
}, [t.current, p, u, x]);
|
|
85
|
+
const v = () => {
|
|
86
|
+
!u || !x || a == null || a.getDatasetsIdVersionsVidLabelcount(u, x).then((e) => {
|
|
87
|
+
const l = e.find((o) => o.id === "allcodeid"), s = e.find((o) => o.id === "nocodeid");
|
|
88
|
+
E(l ? l.count : 0), A(s ? s.count : 0);
|
|
89
|
+
});
|
|
90
|
+
}, Z = () => {
|
|
91
|
+
u && (a == null || a.listCategory(u).then((e) => Y(e || [])));
|
|
92
|
+
};
|
|
93
|
+
N(() => {
|
|
94
|
+
Z();
|
|
95
|
+
}, [u]);
|
|
96
|
+
const F = () => {
|
|
97
|
+
g && z((e) => {
|
|
98
|
+
var o, m, i, q;
|
|
99
|
+
let l;
|
|
100
|
+
const s = !n || (o = n.labels) != null && o.length && p === "hascode" || !((m = n.labels) != null && m.length) && p === "nocode" || p === "" ? M + 1 : M;
|
|
101
|
+
if (n && ((i = n.labels) != null && i.length && p === "nocode" || !((q = n.labels) != null && q.length) && p === "hascode")) {
|
|
102
|
+
const y = e.findIndex((te) => te.id === n.id);
|
|
103
|
+
y > -1 && (e.splice(y, 1), l = [...e], t.total && (t.total = t.total - 1));
|
|
104
|
+
}
|
|
105
|
+
if (s >= e.length) {
|
|
106
|
+
const y = (t.current - 1) * t.pageSize + s;
|
|
107
|
+
t.total && y >= t.total ? b.error("已经是最后一个了") : k({
|
|
108
|
+
current: t.current + 1,
|
|
109
|
+
pageSize: t.pageSize,
|
|
110
|
+
type: "next"
|
|
111
|
+
});
|
|
112
|
+
} else
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
S(s);
|
|
115
|
+
const y = e[s];
|
|
116
|
+
d(y);
|
|
117
|
+
}, 200);
|
|
118
|
+
return l || e;
|
|
119
|
+
});
|
|
120
|
+
}, _ = () => {
|
|
121
|
+
var s, o;
|
|
122
|
+
if (!g)
|
|
123
|
+
return;
|
|
124
|
+
let e;
|
|
125
|
+
if (n && g && ((s = n.labels) != null && s.length && p === "nocode" || !((o = n.labels) != null && o.length) && p === "hascode")) {
|
|
126
|
+
const m = g.findIndex((i) => i.id === n.id);
|
|
127
|
+
m > -1 && (g.splice(m, 1), e = [...g], t.total && (t.total = t.total - 1));
|
|
128
|
+
}
|
|
129
|
+
const l = M - 1;
|
|
130
|
+
if (l < 0)
|
|
131
|
+
(t.current - 1) * t.pageSize + l < 0 ? b.error("已经是第一个了") : k({
|
|
132
|
+
current: t.current - 1,
|
|
133
|
+
pageSize: t.pageSize,
|
|
134
|
+
type: "prev"
|
|
135
|
+
});
|
|
136
|
+
else {
|
|
137
|
+
S(l);
|
|
138
|
+
const m = g[l];
|
|
139
|
+
d(m);
|
|
140
|
+
}
|
|
141
|
+
e && z(e);
|
|
142
|
+
};
|
|
143
|
+
N(() => {
|
|
144
|
+
c && u && x && n && (a == null || a.getDatasetsIdVersionsVidSsamplesSid(u, x, n.id).then((e) => {
|
|
145
|
+
d(e);
|
|
146
|
+
}));
|
|
147
|
+
}, [c, n == null ? void 0 : n.id]);
|
|
148
|
+
const ee = () => {
|
|
149
|
+
Q();
|
|
150
|
+
};
|
|
151
|
+
N(() => {
|
|
152
|
+
I.current && (I.current.width = I.current.offsetWidth, I.current.height = I.current.offsetHeight);
|
|
153
|
+
}, [I.current]);
|
|
154
|
+
const H = () => {
|
|
155
|
+
n && V(n).then((e) => {
|
|
156
|
+
e ? (_(), v()) : b.error("保存失败");
|
|
157
|
+
});
|
|
158
|
+
}, K = () => {
|
|
159
|
+
n && V(n).then((e) => {
|
|
160
|
+
e ? (F(), v()) : b.error("保存失败");
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
return /* @__PURE__ */ C(le, {
|
|
164
|
+
title: "标注",
|
|
165
|
+
width: "100%",
|
|
166
|
+
wrapClassName: "ocr-modal-wrap",
|
|
167
|
+
className: "ocr-modal",
|
|
168
|
+
open: c,
|
|
169
|
+
destroyOnClose: !0,
|
|
170
|
+
onCancel: () => ee(),
|
|
171
|
+
maskClosable: !1,
|
|
172
|
+
keyboard: !1,
|
|
173
|
+
centered: !0,
|
|
174
|
+
footer: /* @__PURE__ */ L(ce, {
|
|
175
|
+
children: [/* @__PURE__ */ L("span", {
|
|
176
|
+
className: "ocr-modal-label-count",
|
|
177
|
+
children: ["当前图片标注框数量:", ((W = n == null ? void 0 : n.labels) == null ? void 0 : W.length) || 0]
|
|
178
|
+
}), /* @__PURE__ */ C(P, {
|
|
179
|
+
disabled: !n,
|
|
180
|
+
type: "primary",
|
|
181
|
+
onClick: () => {
|
|
182
|
+
n && V(n).then((e) => {
|
|
183
|
+
e ? (b.success("保存成功"), r || F(), v()) : b.error("保存失败");
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
children: "保存标注"
|
|
187
|
+
}, "save"), !r && /* @__PURE__ */ C(P, {
|
|
188
|
+
type: "default",
|
|
189
|
+
onClick: H,
|
|
190
|
+
children: "上一张"
|
|
191
|
+
}, "prev"), !r && /* @__PURE__ */ C(P, {
|
|
192
|
+
type: "default",
|
|
193
|
+
onClick: K,
|
|
194
|
+
children: "下一张"
|
|
195
|
+
}, "next")]
|
|
196
|
+
}),
|
|
197
|
+
children: /* @__PURE__ */ L("div", {
|
|
198
|
+
className: "records-content",
|
|
199
|
+
children: [!r && /* @__PURE__ */ L(J, {
|
|
200
|
+
className: "records-content-tabs",
|
|
201
|
+
defaultActiveKey: p,
|
|
202
|
+
onChange: (e) => {
|
|
203
|
+
k(T(w({}, t), {
|
|
204
|
+
current: 1
|
|
205
|
+
})), U(e);
|
|
206
|
+
},
|
|
207
|
+
children: [/* @__PURE__ */ C($, {
|
|
208
|
+
tab: `全部(${B})`
|
|
209
|
+
}, ""), /* @__PURE__ */ C($, {
|
|
210
|
+
tab: `未标注(${O})`
|
|
211
|
+
}, "nocode"), /* @__PURE__ */ C($, {
|
|
212
|
+
tab: `已标注(${B - O})`
|
|
213
|
+
}, "hascode")]
|
|
214
|
+
}), g != null && g.length ? /* @__PURE__ */ C(ue, {
|
|
215
|
+
currentSample: n,
|
|
216
|
+
categories: X,
|
|
217
|
+
onChange: (e) => {
|
|
218
|
+
d(e), z((l) => {
|
|
219
|
+
const s = l.findIndex((o) => o.id === e.id);
|
|
220
|
+
return l[s] = e, [...l];
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
onNextClick: K,
|
|
224
|
+
onPrevClick: H
|
|
225
|
+
}) : /* @__PURE__ */ C(de, {})]
|
|
226
|
+
})
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
export {
|
|
230
|
+
ze as default
|
|
231
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { jsxs as a, jsx as s, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as N, useState as n, useContext as H, useEffect as k } from "react";
|
|
3
|
+
import { Modal as u, Button as d, Tabs as I, Tooltip as Q, Space as X, message as v } from "antd";
|
|
4
|
+
import "./style.less.mjs";
|
|
5
|
+
import Y from "react-json-view";
|
|
6
|
+
import { useKeyPress as R } from "ahooks";
|
|
7
|
+
import Z from "../../MarkDescriptions/index.mjs";
|
|
8
|
+
import T from "../../Iconfont/index.mjs";
|
|
9
|
+
import _ from "../../../DatasetContext/index.mjs";
|
|
10
|
+
import $ from "../../OCRImageViewer/index.mjs";
|
|
11
|
+
import S from "../../ScanTable/index.mjs";
|
|
12
|
+
const {
|
|
13
|
+
TabPane: x
|
|
14
|
+
} = I, me = (V) => {
|
|
15
|
+
var O, M;
|
|
16
|
+
const {
|
|
17
|
+
isOcrModalVisible: c,
|
|
18
|
+
setIsOcrModalVisible: C,
|
|
19
|
+
record: h,
|
|
20
|
+
onNextClick: p,
|
|
21
|
+
onPrevClick: b,
|
|
22
|
+
datasetId: i,
|
|
23
|
+
versionId: r,
|
|
24
|
+
ocrMarkTmpl: l,
|
|
25
|
+
handleMarkClick: j,
|
|
26
|
+
updateSampleList: w,
|
|
27
|
+
isPreLabel: m
|
|
28
|
+
} = V, z = N(null), D = N({}), [f, K] = n("annotation"), [e, P] = n(), [J, L] = n(), [E, q] = n([]), [A, g] = n(!1), {
|
|
29
|
+
services: {
|
|
30
|
+
cvforceDatahub: t
|
|
31
|
+
},
|
|
32
|
+
featuresConfig: {
|
|
33
|
+
datasetManager: y
|
|
34
|
+
} = {
|
|
35
|
+
datasetManager: !1
|
|
36
|
+
}
|
|
37
|
+
} = H(_);
|
|
38
|
+
R("rightarrow", () => {
|
|
39
|
+
p();
|
|
40
|
+
}), R("leftarrow", () => {
|
|
41
|
+
b();
|
|
42
|
+
}), k(() => {
|
|
43
|
+
i && (t == null || t.listCategory(i).then((o) => q(o || [])));
|
|
44
|
+
}, [i]), k(() => {
|
|
45
|
+
c && i && r && (t == null || t.getDatasetsIdVersionsVidSsamplesSid(i, r, h.id).then((o) => {
|
|
46
|
+
P(o);
|
|
47
|
+
}));
|
|
48
|
+
}, [c, h]);
|
|
49
|
+
const B = () => {
|
|
50
|
+
C(!1);
|
|
51
|
+
}, F = (o) => {
|
|
52
|
+
K(o);
|
|
53
|
+
}, U = (o) => {
|
|
54
|
+
L(o);
|
|
55
|
+
}, W = () => {
|
|
56
|
+
u.confirm({
|
|
57
|
+
title: "确认要删除此数据吗?",
|
|
58
|
+
content: "删除后不可恢复,请慎重操作",
|
|
59
|
+
onOk: () => {
|
|
60
|
+
!i || !r || !(e != null && e.id) || t == null || t.delDatasetsIdVersionsVidSamplesId(i, r, e.id).then(() => {
|
|
61
|
+
v.success("删除成功"), C(!1), w();
|
|
62
|
+
}).catch(() => v.error("删除失败"));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ a(u, {
|
|
67
|
+
title: /* @__PURE__ */ a("div", {
|
|
68
|
+
children: ["详情", /* @__PURE__ */ a("span", {
|
|
69
|
+
className: "ocr-modal-label-count",
|
|
70
|
+
children: ["标注框数量:", (O = e == null ? void 0 : e.labels) == null ? void 0 : O.length]
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
width: "100%",
|
|
74
|
+
wrapClassName: "ocr-modal-wrap",
|
|
75
|
+
className: "ocr-modal",
|
|
76
|
+
open: c,
|
|
77
|
+
destroyOnClose: !0,
|
|
78
|
+
onCancel: () => B(),
|
|
79
|
+
maskClosable: !1,
|
|
80
|
+
centered: !0,
|
|
81
|
+
footer: null,
|
|
82
|
+
children: [/* @__PURE__ */ a("div", {
|
|
83
|
+
className: "ocr-detail",
|
|
84
|
+
children: [/* @__PURE__ */ a("div", {
|
|
85
|
+
className: "detail-content",
|
|
86
|
+
children: [/* @__PURE__ */ s(d, {
|
|
87
|
+
className: "select-prev",
|
|
88
|
+
icon: /* @__PURE__ */ s(T, {
|
|
89
|
+
type: "icon-zuojiantou"
|
|
90
|
+
}),
|
|
91
|
+
type: "text",
|
|
92
|
+
onClick: () => b()
|
|
93
|
+
}), /* @__PURE__ */ s("div", {
|
|
94
|
+
className: "select-main",
|
|
95
|
+
ref: D,
|
|
96
|
+
children: /* @__PURE__ */ s($, {
|
|
97
|
+
zoomMin: 0.1,
|
|
98
|
+
zoomMax: 10,
|
|
99
|
+
zoomStep: 0.1,
|
|
100
|
+
url: (e == null ? void 0 : e.fileUrl) || "",
|
|
101
|
+
ref: z,
|
|
102
|
+
labels: e == null ? void 0 : e.labels
|
|
103
|
+
})
|
|
104
|
+
}), /* @__PURE__ */ s(d, {
|
|
105
|
+
className: "select-next",
|
|
106
|
+
icon: /* @__PURE__ */ s(T, {
|
|
107
|
+
type: "icon-youjiantou"
|
|
108
|
+
}),
|
|
109
|
+
type: "text",
|
|
110
|
+
onClick: () => p()
|
|
111
|
+
})]
|
|
112
|
+
}), l !== "DetectionOCR" && /* @__PURE__ */ a("div", {
|
|
113
|
+
className: "detail-slide",
|
|
114
|
+
children: [/* @__PURE__ */ s("div", {
|
|
115
|
+
className: "slide-header",
|
|
116
|
+
children: /* @__PURE__ */ a(I, {
|
|
117
|
+
className: "header-tab",
|
|
118
|
+
onChange: F,
|
|
119
|
+
activeKey: f,
|
|
120
|
+
children: [/* @__PURE__ */ s(x, {
|
|
121
|
+
tab: "标注信息"
|
|
122
|
+
}, "annotation"), /* @__PURE__ */ s(x, {
|
|
123
|
+
tab: "JSON"
|
|
124
|
+
}, "json")]
|
|
125
|
+
})
|
|
126
|
+
}), /* @__PURE__ */ a("div", {
|
|
127
|
+
className: "slide-main",
|
|
128
|
+
children: [f === "annotation" && /* @__PURE__ */ s(G, {
|
|
129
|
+
children: l === "TableOCR" ? /* @__PURE__ */ s(S, {
|
|
130
|
+
currentInfer: e == null ? void 0 : e.labels,
|
|
131
|
+
onCellSelect: (o) => U(o),
|
|
132
|
+
currentCell: J
|
|
133
|
+
}) : (M = e == null ? void 0 : e.labels) != null && M.length ? /* @__PURE__ */ s(Z, {
|
|
134
|
+
labels: e == null ? void 0 : e.labels,
|
|
135
|
+
catagories: E
|
|
136
|
+
}) : "暂无标注信息"
|
|
137
|
+
}), f === "json" && // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
/* @__PURE__ */ s(Y, {
|
|
140
|
+
name: !1,
|
|
141
|
+
iconStyle: "square",
|
|
142
|
+
indentWidth: 2,
|
|
143
|
+
displayDataTypes: !1,
|
|
144
|
+
displayObjectSize: !1,
|
|
145
|
+
enableClipboard: !1,
|
|
146
|
+
src: l === "TableOCR" ? e == null ? void 0 : e.labels : (e == null ? void 0 : e.ocrJson) || {}
|
|
147
|
+
})]
|
|
148
|
+
})]
|
|
149
|
+
})]
|
|
150
|
+
}), /* @__PURE__ */ s("div", {
|
|
151
|
+
className: "ocr-mark-action",
|
|
152
|
+
style: l === "DetectionOCR" ? {
|
|
153
|
+
width: "100%"
|
|
154
|
+
} : void 0,
|
|
155
|
+
children: /* @__PURE__ */ s(Q, {
|
|
156
|
+
title: "预标注进行中,请任务完成后再试",
|
|
157
|
+
open: A,
|
|
158
|
+
children: /* @__PURE__ */ a(X, {
|
|
159
|
+
onMouseEnter: () => m && g(!0),
|
|
160
|
+
onMouseLeave: () => g(!1),
|
|
161
|
+
children: [/* @__PURE__ */ s(d, {
|
|
162
|
+
type: "primary",
|
|
163
|
+
disabled: l !== "StructKVCOCR" && l !== "DetectionOCR" || m,
|
|
164
|
+
onClick: () => j(e == null ? void 0 : e.id),
|
|
165
|
+
children: "标注"
|
|
166
|
+
}), y && y.delete && /* @__PURE__ */ s(d, {
|
|
167
|
+
danger: !0,
|
|
168
|
+
type: "ghost",
|
|
169
|
+
onClick: W,
|
|
170
|
+
disabled: m,
|
|
171
|
+
children: "删除数据"
|
|
172
|
+
})]
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
})]
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
export {
|
|
179
|
+
me as default
|
|
180
|
+
};
|