@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,382 @@
|
|
|
1
|
+
var xe = Object.defineProperty, ye = Object.defineProperties;
|
|
2
|
+
var Le = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var re = Object.getOwnPropertySymbols;
|
|
4
|
+
var Ve = Object.prototype.hasOwnProperty, Pe = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var oe = (f, n, r) => n in f ? xe(f, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[n] = r, h = (f, n) => {
|
|
6
|
+
for (var r in n || (n = {}))
|
|
7
|
+
Ve.call(n, r) && oe(f, r, n[r]);
|
|
8
|
+
if (re)
|
|
9
|
+
for (var r of re(n))
|
|
10
|
+
Pe.call(n, r) && oe(f, r, n[r]);
|
|
11
|
+
return f;
|
|
12
|
+
}, C = (f, n) => ye(f, Le(n));
|
|
13
|
+
import { jsx as c, jsxs as D } from "react/jsx-runtime";
|
|
14
|
+
import { useState as a, useEffect as m } from "react";
|
|
15
|
+
import { message as $, ConfigProvider as Re, Space as x, Select as Ne, Tabs as Oe, Tooltip as we, Button as ze, Row as Be, Col as Ke, Pagination as Ae } from "antd";
|
|
16
|
+
import Ee from "antd/es/locale/zh_CN";
|
|
17
|
+
import "./style.less.mjs";
|
|
18
|
+
import Fe from "./OcrModal/index.mjs";
|
|
19
|
+
import Ue from "./MarkKVOCRModal/index.mjs";
|
|
20
|
+
import Ze from "./MarkOCRBoxModal/index.mjs";
|
|
21
|
+
import $e from "./PreLabelOCR/index.mjs";
|
|
22
|
+
import je from "lodash/merge";
|
|
23
|
+
import { UploadZipsStatus as ie, PreLabelTaskStatus as We } from "@glodon-aiot/apis";
|
|
24
|
+
import _e from "../../Common/Page/index.mjs";
|
|
25
|
+
import He from "../Thumbnail/index.mjs";
|
|
26
|
+
import Je from "../DataEmpty/index.mjs";
|
|
27
|
+
import Qe from "../../DatasetContext/index.mjs";
|
|
28
|
+
import { DEFAULT_FILTER_SWITCH as qe } from "../../constant.mjs";
|
|
29
|
+
import Ge from "../PageNav/index.mjs";
|
|
30
|
+
const gt = (f) => {
|
|
31
|
+
const {
|
|
32
|
+
services: n,
|
|
33
|
+
datasetId: r,
|
|
34
|
+
versionId: S,
|
|
35
|
+
backTo: ne,
|
|
36
|
+
labelManager: ce = !1,
|
|
37
|
+
datasetManager: T = !1,
|
|
38
|
+
annotation: le,
|
|
39
|
+
header: d = {
|
|
40
|
+
versionSelect: !1
|
|
41
|
+
},
|
|
42
|
+
exampleSrcRoot: ae
|
|
43
|
+
} = f, [i, R] = a(), [t, I] = a(), [y, j] = a([]), [W, L] = a(!1), [N, O] = a(!1), [g, _] = a(0), [u, H] = a(), [w, b] = a(), [se, J] = a(), [Q, M] = a(-1), [l, k] = a({
|
|
44
|
+
current: 1,
|
|
45
|
+
pageSize: 50
|
|
46
|
+
}), [V, q] = a(0), [v, de] = a(""), [G, z] = a(!1), [X, Y] = a(), [B, ee] = a(!1), [P, K] = a(null), [ue, te] = a(!1), [fe, pe] = a(!1), [A, me] = a(""), [he, ge] = a(), E = h({}, qe);
|
|
47
|
+
je(E, f.filterSwitch);
|
|
48
|
+
const be = () => {
|
|
49
|
+
J(void 0), z(!0);
|
|
50
|
+
}, ke = (e, o) => {
|
|
51
|
+
k({
|
|
52
|
+
current: e,
|
|
53
|
+
pageSize: o
|
|
54
|
+
});
|
|
55
|
+
}, Ce = (e) => {
|
|
56
|
+
if (!u)
|
|
57
|
+
return;
|
|
58
|
+
M(e);
|
|
59
|
+
const o = u[e];
|
|
60
|
+
b(o), O(!0);
|
|
61
|
+
};
|
|
62
|
+
m(() => {
|
|
63
|
+
n.cvforceDatahub && n.cvforceDatahub.getOptionsImgproxy().then((e) => ge(e));
|
|
64
|
+
}, [n.cvforceDatahub]), m(() => {
|
|
65
|
+
!r || t || (L(!0), Promise.all([
|
|
66
|
+
// 数据集
|
|
67
|
+
n.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
68
|
+
R(e);
|
|
69
|
+
}),
|
|
70
|
+
// 版本列表
|
|
71
|
+
n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
|
|
72
|
+
j(e.recordList), I(S ? e.recordList.find((o) => o.id === S) : e.recordList[0]);
|
|
73
|
+
})
|
|
74
|
+
]).finally(() => L(!1)));
|
|
75
|
+
}, [r, t == null ? void 0 : t.id]), m(() => {
|
|
76
|
+
r && (L(!0), Promise.all([
|
|
77
|
+
// 数据集
|
|
78
|
+
n.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
79
|
+
R(e);
|
|
80
|
+
}),
|
|
81
|
+
// 版本列表
|
|
82
|
+
n.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
|
|
83
|
+
j(e.recordList), I(S ? e.recordList.find((o) => o.id === S) : e.recordList[0]);
|
|
84
|
+
})
|
|
85
|
+
]).finally(() => L(!1)));
|
|
86
|
+
}, [r, S]), m(() => {
|
|
87
|
+
r && n.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
88
|
+
R(e);
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
const Se = () => {
|
|
92
|
+
!r || !t || n.cvforceDatahub.getDatasetsIdVersionsVid(r, t.id).then((e) => {
|
|
93
|
+
me(e.versionAsyncTask.state);
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
m(() => {
|
|
97
|
+
Se();
|
|
98
|
+
}, [r, t == null ? void 0 : t.id]), m(() => {
|
|
99
|
+
A !== ie.Pending && A !== ie.Started || $.warning("文件导入中,请刷新页面再试");
|
|
100
|
+
}, [A]);
|
|
101
|
+
const Te = () => {
|
|
102
|
+
!r || !t || n.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(r, t.id).then((e) => {
|
|
103
|
+
const o = e.find((p) => p.id === "allcodeid"), s = e.find((p) => p.id === "nocodeid");
|
|
104
|
+
_(o ? o.count : 0), q(s ? s.count : 0);
|
|
105
|
+
});
|
|
106
|
+
}, F = () => {
|
|
107
|
+
const e = l.current || 1, o = l.pageSize || 50;
|
|
108
|
+
!r || !t || (n.cvforceDatahub.getDatasetsIdVersionsVidSamples(r, t.id, {
|
|
109
|
+
labels: v || void 0,
|
|
110
|
+
pageNo: e,
|
|
111
|
+
pageSize: o
|
|
112
|
+
}).then((s) => {
|
|
113
|
+
const p = s.recordList || [];
|
|
114
|
+
if (!p.length && s.totalResults > 0) {
|
|
115
|
+
k(C(h({}, l), {
|
|
116
|
+
current: Math.ceil(s.totalResults / o)
|
|
117
|
+
})), Math.ceil(s.totalResults / o) === e && H([]);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (H(p), k(C(h({}, l), {
|
|
121
|
+
total: s.totalResults
|
|
122
|
+
})), l.type === "next" && p.length) {
|
|
123
|
+
M(0);
|
|
124
|
+
const Z = s.recordList[0];
|
|
125
|
+
b(Z);
|
|
126
|
+
}
|
|
127
|
+
if (l.type === "prev" && p.length) {
|
|
128
|
+
M(l.pageSize - 1);
|
|
129
|
+
const Z = s.recordList[l.pageSize - 1];
|
|
130
|
+
b(Z);
|
|
131
|
+
}
|
|
132
|
+
}), Te());
|
|
133
|
+
};
|
|
134
|
+
m(F, [l.current, l.pageSize, v, X, t == null ? void 0 : t.id, r]);
|
|
135
|
+
const Ie = () => {
|
|
136
|
+
if (!u)
|
|
137
|
+
return;
|
|
138
|
+
const e = Q + 1;
|
|
139
|
+
if (e >= u.length) {
|
|
140
|
+
let o = g;
|
|
141
|
+
v === "hascode" && (o = g - V), v === "nocode" && (o = V), (l.current - 1) * l.pageSize + e >= o ? $.error("已经是最后一个了") : k({
|
|
142
|
+
current: l.current + 1,
|
|
143
|
+
pageSize: l.pageSize,
|
|
144
|
+
type: "next"
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
M(e);
|
|
148
|
+
const o = u[e];
|
|
149
|
+
b(o);
|
|
150
|
+
}
|
|
151
|
+
}, Me = () => {
|
|
152
|
+
if (!u)
|
|
153
|
+
return;
|
|
154
|
+
const e = Q - 1;
|
|
155
|
+
if (e < 0)
|
|
156
|
+
(l.current - 1) * l.pageSize + e < 0 ? $.error("已经是第一个了") : k({
|
|
157
|
+
current: l.current - 1,
|
|
158
|
+
pageSize: l.pageSize,
|
|
159
|
+
type: "prev"
|
|
160
|
+
});
|
|
161
|
+
else {
|
|
162
|
+
M(e);
|
|
163
|
+
const o = u[e];
|
|
164
|
+
b(o);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
m(() => {
|
|
168
|
+
if (!r) {
|
|
169
|
+
P && (clearTimeout(P), K(null)), Y(void 0);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
U();
|
|
173
|
+
}, [t == null ? void 0 : t.id]), m(() => {
|
|
174
|
+
U();
|
|
175
|
+
}, [fe]);
|
|
176
|
+
const U = () => {
|
|
177
|
+
!r || !t || n.cvforceDatahub.getPreLabelTask(r, t.id).then((e) => {
|
|
178
|
+
const o = e[0];
|
|
179
|
+
if (Y(o), P && (clearTimeout(P), K(null)), !(o != null && o.state) || o.state !== We.Started) {
|
|
180
|
+
ee(!1);
|
|
181
|
+
return;
|
|
182
|
+
} else
|
|
183
|
+
ee(!0);
|
|
184
|
+
K(setTimeout(() => {
|
|
185
|
+
U();
|
|
186
|
+
}, 1e4));
|
|
187
|
+
});
|
|
188
|
+
}, ve = [{
|
|
189
|
+
key: "",
|
|
190
|
+
label: `全部(${g})`,
|
|
191
|
+
children: null
|
|
192
|
+
}, {
|
|
193
|
+
key: "nocode",
|
|
194
|
+
label: `未标注(${V})`,
|
|
195
|
+
children: null
|
|
196
|
+
}, {
|
|
197
|
+
key: "hascode",
|
|
198
|
+
label: `已标注(${g - V})`,
|
|
199
|
+
children: null
|
|
200
|
+
}];
|
|
201
|
+
m(() => {
|
|
202
|
+
N || b(void 0);
|
|
203
|
+
}, [N]), m(() => {
|
|
204
|
+
i && (i.markType !== "ocr" || (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR") && console.error(`当前数据集不是DetectionOCR(ocr检测)类型,请检查数据集类型。
|
|
205
|
+
请检查markType是否为ocr并且ocrMarkTmpl为DetectionOCR。`);
|
|
206
|
+
}, [i]);
|
|
207
|
+
const De = (i == null ? void 0 : i.ocrMarkTmpl) === "StructKVCOCR" ? Ue : Ze;
|
|
208
|
+
return /* @__PURE__ */ c(Re, {
|
|
209
|
+
locale: Ee,
|
|
210
|
+
children: /* @__PURE__ */ c(Qe.Provider, {
|
|
211
|
+
value: {
|
|
212
|
+
datasetId: r,
|
|
213
|
+
versionId: (t == null ? void 0 : t.id) || "",
|
|
214
|
+
no: (t == null ? void 0 : t.no) || "",
|
|
215
|
+
loading: W,
|
|
216
|
+
version: t,
|
|
217
|
+
versions: y,
|
|
218
|
+
samples: u,
|
|
219
|
+
pagination: l,
|
|
220
|
+
services: n,
|
|
221
|
+
featuresConfig: {
|
|
222
|
+
labelManager: ce,
|
|
223
|
+
datasetManager: T,
|
|
224
|
+
annotation: le,
|
|
225
|
+
filterSwitch: E,
|
|
226
|
+
header: d,
|
|
227
|
+
exampleSrcRoot: ae
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
children: i ? i.markType === "ocr" ? /* @__PURE__ */ D("div", {
|
|
231
|
+
className: "ocr-version-detail",
|
|
232
|
+
children: [/* @__PURE__ */ D(_e, {
|
|
233
|
+
className: "product-details-page",
|
|
234
|
+
header: d === !1 ? void 0 : /* @__PURE__ */ c(Ge, {
|
|
235
|
+
backTo: ne,
|
|
236
|
+
onBackClick: d != null && d.onBackClick ? () => {
|
|
237
|
+
d.onBackClick && d.onBackClick();
|
|
238
|
+
} : void 0,
|
|
239
|
+
left: !W && /* @__PURE__ */ D(x, {
|
|
240
|
+
children: [/* @__PURE__ */ c("span", {
|
|
241
|
+
style: {
|
|
242
|
+
fontWeight: "bold"
|
|
243
|
+
},
|
|
244
|
+
children: i == null ? void 0 : i.name
|
|
245
|
+
}), /* @__PURE__ */ c(Ne, {
|
|
246
|
+
disabled: (d == null ? void 0 : d.versionSelect) === !1,
|
|
247
|
+
value: t == null ? void 0 : t.id,
|
|
248
|
+
style: {
|
|
249
|
+
width: 70
|
|
250
|
+
},
|
|
251
|
+
options: y.map((e) => ({
|
|
252
|
+
label: e.no,
|
|
253
|
+
value: e.id
|
|
254
|
+
})),
|
|
255
|
+
onChange: (e) => {
|
|
256
|
+
const o = y.find((p) => p.id === e);
|
|
257
|
+
if (!i || !o)
|
|
258
|
+
return;
|
|
259
|
+
const s = y.find((p) => p.id === o.id);
|
|
260
|
+
I(s), d != null && d.onVersionChange && d.onVersionChange(s);
|
|
261
|
+
}
|
|
262
|
+
})]
|
|
263
|
+
}),
|
|
264
|
+
right: /* @__PURE__ */ c(x, {
|
|
265
|
+
children: !w && T && T.preLabel && (t != null && t.id) ? /* @__PURE__ */ c($e, {
|
|
266
|
+
datasetId: r,
|
|
267
|
+
versionId: t.id,
|
|
268
|
+
disabled: !g || (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR",
|
|
269
|
+
setIsTaskChange: pe,
|
|
270
|
+
preLabelTask: X,
|
|
271
|
+
datasetType: "ocr"
|
|
272
|
+
}) : null
|
|
273
|
+
})
|
|
274
|
+
}),
|
|
275
|
+
children: [/* @__PURE__ */ D("div", {
|
|
276
|
+
className: "ocr-header",
|
|
277
|
+
children: [/* @__PURE__ */ c(x, {
|
|
278
|
+
children: E.tabs && /* @__PURE__ */ c(Oe, {
|
|
279
|
+
className: "header-tab",
|
|
280
|
+
defaultActiveKey: "",
|
|
281
|
+
onChange: (e) => {
|
|
282
|
+
k(C(h({}, l), {
|
|
283
|
+
current: 1,
|
|
284
|
+
total: 0
|
|
285
|
+
})), de(e);
|
|
286
|
+
},
|
|
287
|
+
items: ve
|
|
288
|
+
})
|
|
289
|
+
}), /* @__PURE__ */ c(x, {
|
|
290
|
+
children: T && T.label && /* @__PURE__ */ c(we, {
|
|
291
|
+
title: "预标注进行中,请任务完成后再试",
|
|
292
|
+
open: ue,
|
|
293
|
+
children: /* @__PURE__ */ c(ze, {
|
|
294
|
+
type: "primary",
|
|
295
|
+
disabled: !g || (i == null ? void 0 : i.ocrMarkTmpl) !== "StructKVCOCR" && (i == null ? void 0 : i.ocrMarkTmpl) !== "DetectionOCR" || B,
|
|
296
|
+
onClick: be,
|
|
297
|
+
onMouseEnter: () => B && te(!0),
|
|
298
|
+
onMouseLeave: () => te(!1),
|
|
299
|
+
style: {
|
|
300
|
+
marginRight: "10px"
|
|
301
|
+
},
|
|
302
|
+
children: "单张标注"
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
})]
|
|
306
|
+
}), /* @__PURE__ */ c("div", {
|
|
307
|
+
className: "d-row",
|
|
308
|
+
children: u != null && u.length ? /* @__PURE__ */ D(x, {
|
|
309
|
+
direction: "vertical",
|
|
310
|
+
className: "d-right",
|
|
311
|
+
children: [/* @__PURE__ */ c(Be, {
|
|
312
|
+
gutter: [16, 16],
|
|
313
|
+
wrap: !0,
|
|
314
|
+
className: "d-right-row",
|
|
315
|
+
children: u == null ? void 0 : u.map((e, o) => /* @__PURE__ */ c(Ke, {
|
|
316
|
+
className: "d-right-col",
|
|
317
|
+
onClick: () => Ce(o),
|
|
318
|
+
children: /* @__PURE__ */ c("div", {
|
|
319
|
+
className: "right-col-wrapper",
|
|
320
|
+
children: /* @__PURE__ */ c("div", {
|
|
321
|
+
className: "right-col-img",
|
|
322
|
+
children: /* @__PURE__ */ c(He, {
|
|
323
|
+
fileKey: e.fileKey,
|
|
324
|
+
width: 124,
|
|
325
|
+
imgProxy: he
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
})
|
|
329
|
+
}, e.id))
|
|
330
|
+
}), /* @__PURE__ */ c(Ae, h({
|
|
331
|
+
onChange: ke,
|
|
332
|
+
className: "d-right-pageination",
|
|
333
|
+
showQuickJumper: !0,
|
|
334
|
+
showSizeChanger: !0
|
|
335
|
+
}, l))]
|
|
336
|
+
}) : /* @__PURE__ */ c(Je, {})
|
|
337
|
+
})]
|
|
338
|
+
}), w && /* @__PURE__ */ c(Fe, {
|
|
339
|
+
isOcrModalVisible: N,
|
|
340
|
+
setIsOcrModalVisible: O,
|
|
341
|
+
record: w,
|
|
342
|
+
onNextClick: () => Ie(),
|
|
343
|
+
onPrevClick: () => Me(),
|
|
344
|
+
ocrMarkTmpl: i == null ? void 0 : i.ocrMarkTmpl,
|
|
345
|
+
datasetId: r,
|
|
346
|
+
versionId: t == null ? void 0 : t.id,
|
|
347
|
+
handleMarkClick: (e) => {
|
|
348
|
+
J(e), O(!1), z(!0);
|
|
349
|
+
},
|
|
350
|
+
updateSampleList: F,
|
|
351
|
+
isPreLabel: B
|
|
352
|
+
}), G && (t == null ? void 0 : t.id) && /* @__PURE__ */ c(De, {
|
|
353
|
+
visible: G,
|
|
354
|
+
selectSampleId: se,
|
|
355
|
+
ocrMarkTmpl: i == null ? void 0 : i.ocrMarkTmpl,
|
|
356
|
+
datasetId: r,
|
|
357
|
+
versionId: t.id,
|
|
358
|
+
onClose: () => z(!1),
|
|
359
|
+
onSave: (e) => {
|
|
360
|
+
var o;
|
|
361
|
+
if (!r || !t)
|
|
362
|
+
throw "datasetId or version is not exist.";
|
|
363
|
+
return n.cvforceDatahub.updateSamples(r, t.id, [C(h({}, e), {
|
|
364
|
+
labels: (o = e.labels) == null ? void 0 : o.map((s) => C(h({}, s), {
|
|
365
|
+
box: s.box.length > 4 ? s.box.splice(0, 4) : s.box
|
|
366
|
+
}))
|
|
367
|
+
})]).then(() => (F(), !0));
|
|
368
|
+
}
|
|
369
|
+
})]
|
|
370
|
+
}) : /* @__PURE__ */ c("div", {
|
|
371
|
+
style: {
|
|
372
|
+
color: "red",
|
|
373
|
+
textAlign: "center"
|
|
374
|
+
},
|
|
375
|
+
children: "当前数据集不是ocr(ocr检测)类型,请检查数据集类型。"
|
|
376
|
+
}) : null
|
|
377
|
+
})
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
export {
|
|
381
|
+
gt as default
|
|
382
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as b, useState as h, useEffect as v } from "react";
|
|
3
|
+
import "./style.less.mjs";
|
|
4
|
+
import g from "../OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.mjs";
|
|
5
|
+
const S = (l) => {
|
|
6
|
+
const {
|
|
7
|
+
value: e,
|
|
8
|
+
onChange: n,
|
|
9
|
+
readonly: o,
|
|
10
|
+
onNextClick: s,
|
|
11
|
+
onPrevClick: c,
|
|
12
|
+
showLabelList: C,
|
|
13
|
+
categories: d,
|
|
14
|
+
renderLabelItem: m
|
|
15
|
+
} = l, u = b(null), [r, f] = h();
|
|
16
|
+
return v(() => {
|
|
17
|
+
e && f(e);
|
|
18
|
+
}, [e]), /* @__PURE__ */ i("div", {
|
|
19
|
+
className: "ocr-version-detail",
|
|
20
|
+
children: /* @__PURE__ */ i("div", {
|
|
21
|
+
className: "d-right",
|
|
22
|
+
ref: u,
|
|
23
|
+
children: r && /* @__PURE__ */ i(g, {
|
|
24
|
+
readonly: o,
|
|
25
|
+
currentSample: r,
|
|
26
|
+
onChange: n,
|
|
27
|
+
onNextClick: s,
|
|
28
|
+
onPrevClick: c,
|
|
29
|
+
categories: d || Object.values(r.labels.reduce((t, a) => (t.find((p) => p.id === a.id) || t.push({
|
|
30
|
+
id: a.id,
|
|
31
|
+
name: a.label
|
|
32
|
+
}), t), [])),
|
|
33
|
+
renderLabelItem: m
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
S as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as e, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Space as r } from "antd";
|
|
3
|
+
import "./style.less.mjs";
|
|
4
|
+
import s from "../Iconfont/index.mjs";
|
|
5
|
+
const d = (c) => {
|
|
6
|
+
const {
|
|
7
|
+
left: n,
|
|
8
|
+
right: o,
|
|
9
|
+
onBackClick: a
|
|
10
|
+
} = c;
|
|
11
|
+
return /* @__PURE__ */ e("div", {
|
|
12
|
+
className: "page-nav",
|
|
13
|
+
children: [/* @__PURE__ */ e(r, {
|
|
14
|
+
size: 12,
|
|
15
|
+
children: [a && /* @__PURE__ */ e(r, {
|
|
16
|
+
size: 4,
|
|
17
|
+
className: "header-back",
|
|
18
|
+
onClick: a,
|
|
19
|
+
children: [/* @__PURE__ */ i(s, {
|
|
20
|
+
type: "icon-fanhui1"
|
|
21
|
+
}), /* @__PURE__ */ i("span", {
|
|
22
|
+
children: "返回"
|
|
23
|
+
})]
|
|
24
|
+
}), n]
|
|
25
|
+
}), o]
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
d as default
|
|
30
|
+
};
|