@glodon-aiot/dataset-annotation 3.9.0-beta.9 → 3.10.0-alpha.10
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/DatasetContext/index.mjs +6 -3
- package/dist/es/components/Iconfont/index.mjs +2 -2
- package/dist/es/components/PicZipImportModal/config.mjs +41 -0
- package/dist/es/components/PicZipImportModal/index.mjs +317 -301
- package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +4 -0
- package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +4 -0
- package/dist/es/components/VLMAnnotation/RegionItem.mjs +95 -0
- package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +83 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +75 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +115 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +42 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +55 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +51 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +47 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +220 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +106 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +68 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +38 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +141 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +72 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +102 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +103 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +156 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +507 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +33 -0
- package/dist/es/components/VLMAnnotation/components/DragButton.mjs +18 -0
- package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +16 -0
- package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +30 -0
- package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +40 -0
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +44 -0
- package/dist/es/components/VLMAnnotation/constants.mjs +50 -0
- package/dist/es/components/VLMAnnotation/index.mjs +242 -0
- package/dist/es/components/VLMAnnotation/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +345 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +240 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +201 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +399 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +139 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/index.mjs +446 -0
- package/dist/es/components/VLMAnnotationDetail/style.less.mjs +4 -0
- package/dist/es/constant.mjs +3 -3
- package/dist/es/createVlmtasetAnnotation/index.mjs +131 -0
- package/dist/es/featuresConfig.mjs +13 -9
- package/dist/es/index.mjs +11 -7
- 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 -3
- package/dist/src/DatasetContext/index.d.ts +2 -0
- package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
- package/dist/src/components/PicZipImportModal/config.d.ts +20 -0
- package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/RegionItem.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +12 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +38 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +18 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +13 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +21 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +31 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +11 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +28 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +13 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +37 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +12 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +15 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +32 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +25 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +32 -0
- package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +6 -0
- package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/constants.d.ts +97 -0
- package/dist/src/components/VLMAnnotation/index.d.ts +6 -0
- package/dist/src/components/VLMAnnotation/types.d.ts +172 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +14 -0
- 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/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +16 -0
- package/dist/src/components/VLMAnnotationDetail/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/createVlmtasetAnnotation/index.d.ts +16 -0
- package/dist/src/featuresConfig.d.ts +4 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/utils/reactCompatibility.d.ts +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
var Pe = Object.defineProperty, Ee = Object.defineProperties;
|
|
2
|
+
var Ue = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ae = Object.getOwnPropertySymbols;
|
|
4
|
+
var Fe = Object.prototype.hasOwnProperty, He = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var de = (f, i, r) => i in f ? Pe(f, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : f[i] = r, m = (f, i) => {
|
|
6
|
+
for (var r in i || (i = {}))
|
|
7
|
+
Fe.call(i, r) && de(f, r, i[r]);
|
|
8
|
+
if (ae)
|
|
9
|
+
for (var r of ae(i))
|
|
10
|
+
He.call(i, r) && de(f, r, i[r]);
|
|
11
|
+
return f;
|
|
12
|
+
}, g = (f, i) => Ee(f, Ue(i));
|
|
13
|
+
import { jsx as n, jsxs as I, Fragment as Ke } from "react/jsx-runtime";
|
|
14
|
+
import { useState as s, useRef as Ze, useEffect as u } from "react";
|
|
15
|
+
import { message as _, ConfigProvider as $e, Space as E, Select as je, Button as q, Tabs as We, Col as _e, Empty as qe } from "antd";
|
|
16
|
+
import Oe from "antd/es/locale/zh_CN";
|
|
17
|
+
import "./style.less.mjs";
|
|
18
|
+
import Ge from "./VlmModal/index.mjs";
|
|
19
|
+
import Je from "./MarkVLMBoxModal/index.mjs";
|
|
20
|
+
import Qe from "lodash/merge";
|
|
21
|
+
import { UploadZipsStatus as V } from "@glodon-aiot/apis";
|
|
22
|
+
import Xe from "rc-virtual-list";
|
|
23
|
+
import Ye from "../../Common/Page/index.mjs";
|
|
24
|
+
import et from "../Thumbnail/index.mjs";
|
|
25
|
+
import tt from "../../DatasetContext/index.mjs";
|
|
26
|
+
import { DEFAULT_FILTER_SWITCH as rt } from "../../constant.mjs";
|
|
27
|
+
import ot from "../PageNav/index.mjs";
|
|
28
|
+
import nt from "../PicZipImportModal/index.mjs";
|
|
29
|
+
import lt from "../DetectionAnnotation/components/DisabledTooltip/index.mjs";
|
|
30
|
+
import { Prompt as it } from "../hooks/Prompt.mjs";
|
|
31
|
+
import st from "../DetectionAnnotation/icon_item_empty.svg.mjs";
|
|
32
|
+
const Lt = (f) => {
|
|
33
|
+
var ie;
|
|
34
|
+
const {
|
|
35
|
+
services: i,
|
|
36
|
+
datasetId: r,
|
|
37
|
+
versionId: D,
|
|
38
|
+
backTo: ue,
|
|
39
|
+
labelManager: fe = !1,
|
|
40
|
+
datasetManager: b = !1,
|
|
41
|
+
annotation: me,
|
|
42
|
+
header: a = {
|
|
43
|
+
versionSelect: !1
|
|
44
|
+
},
|
|
45
|
+
exampleSrcRoot: pe,
|
|
46
|
+
apiUrl: he,
|
|
47
|
+
token: ge
|
|
48
|
+
} = f, [c, U] = s(), [t, x] = s(), [N, O] = s([]), [G, w] = s(!1), [F, H] = s(!1), [T, J] = s(0), [p, ve] = s([]), [z, k] = s(), [be, Q] = s(), [X, L] = s(-1), [l, y] = s({
|
|
49
|
+
current: 0,
|
|
50
|
+
pageSize: 100
|
|
51
|
+
}), [R, Y] = s(0), [M, Se] = s(""), [ee, K] = s(!1), [S, Ie] = s(""), [ke, ye] = s(), [Ce, Ve] = s(), [te, Z] = s(!1), [re, De] = s(!1), [oe, xe] = s(!0), [Te, Le] = s(!1), A = Ze(null), $ = m({}, rt);
|
|
52
|
+
Qe($, f.filterSwitch);
|
|
53
|
+
const Me = () => {
|
|
54
|
+
Q(void 0), K(!0);
|
|
55
|
+
}, Ne = (e) => {
|
|
56
|
+
if (!p)
|
|
57
|
+
return;
|
|
58
|
+
L(e);
|
|
59
|
+
const o = p[e];
|
|
60
|
+
k(o), H(!0);
|
|
61
|
+
};
|
|
62
|
+
u(() => {
|
|
63
|
+
i.cvforceDatahub && i.cvforceDatahub.getOptionsImgproxy().then((e) => ye(e));
|
|
64
|
+
}, [i.cvforceDatahub]), u(() => {
|
|
65
|
+
r && i.cvforceDatahub.getS3Iam(r).then((e) => {
|
|
66
|
+
Ve(e);
|
|
67
|
+
});
|
|
68
|
+
}, [r]), u(() => {
|
|
69
|
+
!r || t || (w(!0), Promise.all([
|
|
70
|
+
// 数据集
|
|
71
|
+
i.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
72
|
+
U(e);
|
|
73
|
+
}),
|
|
74
|
+
// 版本列表
|
|
75
|
+
i.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
|
|
76
|
+
O(e.recordList), x(D ? e.recordList.find((o) => o.id === D) : e.recordList[0]);
|
|
77
|
+
})
|
|
78
|
+
]).finally(() => w(!1)));
|
|
79
|
+
}, [r, t == null ? void 0 : t.id]), u(() => {
|
|
80
|
+
r && (w(!0), Promise.all([
|
|
81
|
+
// 数据集
|
|
82
|
+
i.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
83
|
+
U(e);
|
|
84
|
+
}),
|
|
85
|
+
// 版本列表
|
|
86
|
+
i.cvforceDatahub.getDatasetsIdVersions(r, 1, 1e3).then((e) => {
|
|
87
|
+
O(e.recordList), x(D ? e.recordList.find((o) => o.id === D) : e.recordList[0]);
|
|
88
|
+
})
|
|
89
|
+
]).finally(() => w(!1)));
|
|
90
|
+
}, [r, D]), u(() => {
|
|
91
|
+
r && i.cvforceDatahub.getDatasetsId(r).then((e) => {
|
|
92
|
+
U(e);
|
|
93
|
+
});
|
|
94
|
+
}, []);
|
|
95
|
+
const ne = () => {
|
|
96
|
+
!r || !t || i.cvforceDatahub.getDatasetsIdVersionsVid(r, t.id).then((e) => {
|
|
97
|
+
Ie(e.versionAsyncTask.state);
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
u(() => {
|
|
101
|
+
ne();
|
|
102
|
+
}, [r, t == null ? void 0 : t.id]), u(() => {
|
|
103
|
+
S !== V.Pending && S !== V.Started || _.warning("文件导入中,请刷新页面再试");
|
|
104
|
+
}, [S]), u(() => {
|
|
105
|
+
Le(!oe && re);
|
|
106
|
+
}, [oe, re]);
|
|
107
|
+
const B = () => {
|
|
108
|
+
!r || !t || i.cvforceDatahub.getDatasetsIdVersionsVidLabelcount(r, t.id).then((e) => {
|
|
109
|
+
const o = e.find((h) => h.id === "allcodeid"), d = e.find((h) => h.id === "nocodeid");
|
|
110
|
+
J(o ? o.count : 0), Y(d ? d.count : 0);
|
|
111
|
+
});
|
|
112
|
+
}, C = (e, o) => {
|
|
113
|
+
const d = (e == null ? void 0 : e.current) || l.current, h = (e == null ? void 0 : e.pageSize) || l.pageSize, j = (e == null ? void 0 : e.type) || l.type, W = o || p || [];
|
|
114
|
+
if (!r || !t || !d)
|
|
115
|
+
return Promise.resolve(!1);
|
|
116
|
+
const Be = () => {
|
|
117
|
+
switch (M) {
|
|
118
|
+
case "nocode":
|
|
119
|
+
return "nocode";
|
|
120
|
+
case "hascode":
|
|
121
|
+
return "hascode";
|
|
122
|
+
default:
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return d === 1 && le(), y(g(m({}, l), {
|
|
127
|
+
current: d,
|
|
128
|
+
pageSize: h
|
|
129
|
+
})), i.cvforceDatahub.getDatasetsIdVersionsVidSamples(r, t.id, {
|
|
130
|
+
pageNo: d,
|
|
131
|
+
pageSize: h,
|
|
132
|
+
labels: Be()
|
|
133
|
+
}).then((se) => {
|
|
134
|
+
const v = se.recordList || [], ce = d === 1 ? v : j === "prev" ? [...v, ...W] : [...W, ...v];
|
|
135
|
+
if (ve(ce), y(g(m({}, l), {
|
|
136
|
+
current: d,
|
|
137
|
+
pageSize: h,
|
|
138
|
+
type: void 0,
|
|
139
|
+
total: se.totalResults
|
|
140
|
+
})), j === "next" && v.length) {
|
|
141
|
+
const P = W.length;
|
|
142
|
+
L(P), k(v[0]);
|
|
143
|
+
}
|
|
144
|
+
if (j === "prev" && v.length) {
|
|
145
|
+
const P = v.length - 1;
|
|
146
|
+
L(P), k(v[P]);
|
|
147
|
+
}
|
|
148
|
+
return ce;
|
|
149
|
+
}).catch(() => !1);
|
|
150
|
+
};
|
|
151
|
+
u(() => {
|
|
152
|
+
!t || !c || C(g(m({}, l), {
|
|
153
|
+
current: 1
|
|
154
|
+
})).then((e) => {
|
|
155
|
+
});
|
|
156
|
+
}, [c == null ? void 0 : c.id, t == null ? void 0 : t.id]), u(() => {
|
|
157
|
+
C().then((e) => {
|
|
158
|
+
}), B();
|
|
159
|
+
}, [l.current]), u(() => {
|
|
160
|
+
C(g(m({}, l), {
|
|
161
|
+
current: 1,
|
|
162
|
+
total: void 0
|
|
163
|
+
})).then((e) => {
|
|
164
|
+
});
|
|
165
|
+
}, [M]);
|
|
166
|
+
const we = () => {
|
|
167
|
+
if (!p)
|
|
168
|
+
return;
|
|
169
|
+
const e = X + 1;
|
|
170
|
+
if (e >= p.length) {
|
|
171
|
+
let o = T;
|
|
172
|
+
M === "hascode" && (o = T - R), M === "nocode" && (o = R), (l.current - 1) * l.pageSize + e >= o ? _.error("已经是最后一个了") : y({
|
|
173
|
+
current: l.current + 1,
|
|
174
|
+
pageSize: l.pageSize,
|
|
175
|
+
type: "next"
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
L(e);
|
|
179
|
+
const o = p[e];
|
|
180
|
+
k(o);
|
|
181
|
+
}
|
|
182
|
+
}, ze = () => {
|
|
183
|
+
if (!p)
|
|
184
|
+
return;
|
|
185
|
+
const e = X - 1;
|
|
186
|
+
if (e < 0)
|
|
187
|
+
(l.current - 1) * l.pageSize + e < 0 ? _.error("已经是第一个了") : y({
|
|
188
|
+
current: l.current - 1,
|
|
189
|
+
pageSize: l.pageSize,
|
|
190
|
+
type: "prev"
|
|
191
|
+
});
|
|
192
|
+
else {
|
|
193
|
+
L(e);
|
|
194
|
+
const o = p[e];
|
|
195
|
+
k(o);
|
|
196
|
+
}
|
|
197
|
+
}, Re = [{
|
|
198
|
+
key: "",
|
|
199
|
+
label: `全部(${T})`,
|
|
200
|
+
children: null
|
|
201
|
+
}, {
|
|
202
|
+
key: "nocode",
|
|
203
|
+
label: `未标注(${R})`,
|
|
204
|
+
children: null
|
|
205
|
+
}, {
|
|
206
|
+
key: "hascode",
|
|
207
|
+
label: `已标注(${T - R})`,
|
|
208
|
+
children: null
|
|
209
|
+
}];
|
|
210
|
+
u(() => {
|
|
211
|
+
F || k(void 0);
|
|
212
|
+
}, [F]), u(() => {
|
|
213
|
+
c && c.markType !== "vlm" && console.error(`当前数据集不是vlm类型,请检查数据集类型。
|
|
214
|
+
请检查markType是否为vlm。`);
|
|
215
|
+
}, [c]);
|
|
216
|
+
const le = () => {
|
|
217
|
+
var e, o;
|
|
218
|
+
(o = (e = A.current) == null ? void 0 : e.getElementsByClassName("rc-virtual-list-holder")[0]) == null || o.scrollTo({
|
|
219
|
+
top: 0
|
|
220
|
+
});
|
|
221
|
+
}, Ae = (e) => {
|
|
222
|
+
var o;
|
|
223
|
+
(!l.total || l.total > p.length) && e.currentTarget.scrollHeight - e.currentTarget.scrollTop === ((o = A.current) == null ? void 0 : o.clientHeight) && y(g(m({}, l), {
|
|
224
|
+
current: l.current + 1
|
|
225
|
+
}));
|
|
226
|
+
};
|
|
227
|
+
return /* @__PURE__ */ n($e, {
|
|
228
|
+
locale: Oe,
|
|
229
|
+
children: /* @__PURE__ */ n(tt.Provider, {
|
|
230
|
+
value: {
|
|
231
|
+
datasetId: r,
|
|
232
|
+
versionId: (t == null ? void 0 : t.id) || "",
|
|
233
|
+
no: (t == null ? void 0 : t.no) || "",
|
|
234
|
+
loading: G,
|
|
235
|
+
version: t,
|
|
236
|
+
versions: N,
|
|
237
|
+
samples: p,
|
|
238
|
+
pagination: l,
|
|
239
|
+
services: i,
|
|
240
|
+
token: ge,
|
|
241
|
+
apiUrl: he,
|
|
242
|
+
featuresConfig: {
|
|
243
|
+
labelManager: fe,
|
|
244
|
+
datasetManager: b,
|
|
245
|
+
annotation: me,
|
|
246
|
+
filterSwitch: $,
|
|
247
|
+
header: a,
|
|
248
|
+
exampleSrcRoot: pe
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
children: c ? c.markType === "vlm" ? /* @__PURE__ */ I("div", {
|
|
252
|
+
className: "vlm-version-detail",
|
|
253
|
+
children: [/* @__PURE__ */ I(Ye, {
|
|
254
|
+
className: "product-details-page",
|
|
255
|
+
header: a === !1 ? void 0 : /* @__PURE__ */ n(ot, {
|
|
256
|
+
backTo: ue,
|
|
257
|
+
onBackClick: a != null && a.onBackClick ? () => {
|
|
258
|
+
a.onBackClick && a.onBackClick();
|
|
259
|
+
} : void 0,
|
|
260
|
+
left: !G && /* @__PURE__ */ I(E, {
|
|
261
|
+
children: [/* @__PURE__ */ n("span", {
|
|
262
|
+
style: {
|
|
263
|
+
fontWeight: "bold"
|
|
264
|
+
},
|
|
265
|
+
children: c == null ? void 0 : c.name
|
|
266
|
+
}), /* @__PURE__ */ n(je, {
|
|
267
|
+
disabled: (a == null ? void 0 : a.versionSelect) === !1,
|
|
268
|
+
value: t == null ? void 0 : t.id,
|
|
269
|
+
style: {
|
|
270
|
+
width: 70
|
|
271
|
+
},
|
|
272
|
+
options: N.map((e) => ({
|
|
273
|
+
label: e.no,
|
|
274
|
+
value: e.id
|
|
275
|
+
})),
|
|
276
|
+
onChange: (e) => {
|
|
277
|
+
const o = N.find((h) => h.id === e);
|
|
278
|
+
if (!c || !o)
|
|
279
|
+
return;
|
|
280
|
+
const d = N.find((h) => h.id === o.id);
|
|
281
|
+
x(d), a != null && a.onVersionChange && a.onVersionChange(d);
|
|
282
|
+
}
|
|
283
|
+
})]
|
|
284
|
+
}),
|
|
285
|
+
right: /* @__PURE__ */ I(E, {
|
|
286
|
+
children: [!z && b && b.add && /* @__PURE__ */ n(lt, {
|
|
287
|
+
isPreLabel: !1,
|
|
288
|
+
placement: "bottom",
|
|
289
|
+
children: /* @__PURE__ */ n(q, {
|
|
290
|
+
type: "default",
|
|
291
|
+
onClick: () => Z(!0),
|
|
292
|
+
disabled: S === V.Pending || S === V.Started,
|
|
293
|
+
children: "导入数据"
|
|
294
|
+
}, "del")
|
|
295
|
+
}), /* @__PURE__ */ n(it, {
|
|
296
|
+
when: Te,
|
|
297
|
+
content: "确认要离开此页面吗?",
|
|
298
|
+
subContent: "离开此页面后,将结束导入,放弃未上传的文件,请谨慎操作!"
|
|
299
|
+
}), te && /* @__PURE__ */ n(nt, {
|
|
300
|
+
datasetIam: Ce,
|
|
301
|
+
datasetId: r,
|
|
302
|
+
currentVersion: t,
|
|
303
|
+
tenCode: c == null ? void 0 : c.tenantCode,
|
|
304
|
+
markType: c.markType,
|
|
305
|
+
isVisible: te,
|
|
306
|
+
setIsVisible: Z,
|
|
307
|
+
getVersionListRequest: B,
|
|
308
|
+
setIsConfirm: xe,
|
|
309
|
+
onUploadStatusChange: (e) => {
|
|
310
|
+
De(e);
|
|
311
|
+
},
|
|
312
|
+
tableReload: () => {
|
|
313
|
+
t != null && t.id && (le(), C(g(m({}, l), {
|
|
314
|
+
current: 1
|
|
315
|
+
})));
|
|
316
|
+
},
|
|
317
|
+
loadVersionData: ne
|
|
318
|
+
})]
|
|
319
|
+
})
|
|
320
|
+
}),
|
|
321
|
+
children: [/* @__PURE__ */ I("div", {
|
|
322
|
+
className: "vlm-header",
|
|
323
|
+
children: [/* @__PURE__ */ n(E, {
|
|
324
|
+
children: $.tabs && /* @__PURE__ */ n(We, {
|
|
325
|
+
className: "header-tab",
|
|
326
|
+
defaultActiveKey: "",
|
|
327
|
+
onChange: (e) => {
|
|
328
|
+
y(g(m({}, l), {
|
|
329
|
+
current: 1,
|
|
330
|
+
total: 0
|
|
331
|
+
})), Se(e);
|
|
332
|
+
},
|
|
333
|
+
items: Re
|
|
334
|
+
})
|
|
335
|
+
}), /* @__PURE__ */ n(E, {
|
|
336
|
+
children: b && b.label && /* @__PURE__ */ n(q, {
|
|
337
|
+
type: "primary",
|
|
338
|
+
disabled: !T,
|
|
339
|
+
onClick: Me,
|
|
340
|
+
style: {
|
|
341
|
+
marginRight: "10px"
|
|
342
|
+
},
|
|
343
|
+
children: "标注"
|
|
344
|
+
})
|
|
345
|
+
})]
|
|
346
|
+
}), /* @__PURE__ */ n("div", {
|
|
347
|
+
className: "d-row",
|
|
348
|
+
children: /* @__PURE__ */ n("div", {
|
|
349
|
+
className: "d-right",
|
|
350
|
+
ref: A,
|
|
351
|
+
children: z ? /* @__PURE__ */ n("div", {}) : l.total !== void 0 && l.total > 0 ? /* @__PURE__ */ n(Ke, {
|
|
352
|
+
children: /* @__PURE__ */ n(Xe, {
|
|
353
|
+
innerProps: {
|
|
354
|
+
className: "d-right-row"
|
|
355
|
+
},
|
|
356
|
+
data: p,
|
|
357
|
+
itemKey: "id",
|
|
358
|
+
height: (ie = A.current) == null ? void 0 : ie.clientHeight,
|
|
359
|
+
onScroll: Ae,
|
|
360
|
+
children: (e, o) => /* @__PURE__ */ n(_e, {
|
|
361
|
+
className: "d-right-col",
|
|
362
|
+
onClick: () => Ne(o),
|
|
363
|
+
children: /* @__PURE__ */ n("div", {
|
|
364
|
+
className: "right-col-wrapper",
|
|
365
|
+
children: /* @__PURE__ */ n("div", {
|
|
366
|
+
className: "right-col-img",
|
|
367
|
+
children: /* @__PURE__ */ n(et, {
|
|
368
|
+
fileKey: e.fileKey,
|
|
369
|
+
width: 124,
|
|
370
|
+
imgProxy: ke
|
|
371
|
+
})
|
|
372
|
+
})
|
|
373
|
+
})
|
|
374
|
+
}, e.id)
|
|
375
|
+
})
|
|
376
|
+
}) : /* @__PURE__ */ n("div", {
|
|
377
|
+
className: "empty",
|
|
378
|
+
children: l.total === 0 ? /* @__PURE__ */ n(qe, {
|
|
379
|
+
image: st,
|
|
380
|
+
description: /* @__PURE__ */ I("span", {
|
|
381
|
+
children: ["暂无数据", M !== "hascode" && /* @__PURE__ */ n("span", {
|
|
382
|
+
children: b && b.add && /* @__PURE__ */ I(q, {
|
|
383
|
+
type: "link",
|
|
384
|
+
size: "small",
|
|
385
|
+
style: {
|
|
386
|
+
padding: 0
|
|
387
|
+
},
|
|
388
|
+
onClick: () => Z(!0),
|
|
389
|
+
disabled: S === V.Pending || S === V.Started,
|
|
390
|
+
children: [/* @__PURE__ */ n("span", {
|
|
391
|
+
style: {
|
|
392
|
+
color: "black"
|
|
393
|
+
},
|
|
394
|
+
children: ","
|
|
395
|
+
}), " ", "立即导入 >"]
|
|
396
|
+
})
|
|
397
|
+
})]
|
|
398
|
+
})
|
|
399
|
+
}) : null
|
|
400
|
+
})
|
|
401
|
+
})
|
|
402
|
+
})]
|
|
403
|
+
}), z && /* @__PURE__ */ n(Ge, {
|
|
404
|
+
isVlmModalVisible: F,
|
|
405
|
+
setIsVlmModalVisible: H,
|
|
406
|
+
record: z,
|
|
407
|
+
onNextClick: () => we(),
|
|
408
|
+
onPrevClick: () => ze(),
|
|
409
|
+
ocrMarkTmpl: c == null ? void 0 : c.ocrMarkTmpl,
|
|
410
|
+
datasetId: r,
|
|
411
|
+
versionId: t == null ? void 0 : t.id,
|
|
412
|
+
handleMarkClick: (e) => {
|
|
413
|
+
Q(e), H(!1), K(!0);
|
|
414
|
+
},
|
|
415
|
+
updateSampleList: () => {
|
|
416
|
+
C(g(m({}, l), {
|
|
417
|
+
current: 1
|
|
418
|
+
})), B();
|
|
419
|
+
}
|
|
420
|
+
}), ee && (t == null ? void 0 : t.id) && /* @__PURE__ */ n(Je, {
|
|
421
|
+
visible: ee,
|
|
422
|
+
selectSampleId: be,
|
|
423
|
+
datasetId: r,
|
|
424
|
+
versionId: t.id,
|
|
425
|
+
onClose: () => K(!1),
|
|
426
|
+
onSave: (e) => {
|
|
427
|
+
if (!r || !t)
|
|
428
|
+
throw "datasetId or version is not exist.";
|
|
429
|
+
return i.cvforceDatahub.updateSamples(r, t.id, [m({}, e)]).then(() => (C(g(m({}, l), {
|
|
430
|
+
current: 1
|
|
431
|
+
})), B(), !0));
|
|
432
|
+
}
|
|
433
|
+
})]
|
|
434
|
+
}) : /* @__PURE__ */ n("div", {
|
|
435
|
+
style: {
|
|
436
|
+
color: "red",
|
|
437
|
+
textAlign: "center"
|
|
438
|
+
},
|
|
439
|
+
children: "当前数据集不是vlm(视觉语言模型)类型,请检查数据集类型。"
|
|
440
|
+
}) : null
|
|
441
|
+
})
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
export {
|
|
445
|
+
Lt as default
|
|
446
|
+
};
|
package/dist/es/constant.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = "https://aiot-dev.glodon.com/api/cvforcepd", t = 1048576, o = 1073741824, c = "ocr-det", r = "obj-det", s = {
|
|
2
2
|
tabs: !0,
|
|
3
3
|
search: !0,
|
|
4
4
|
labels: !0
|
|
@@ -6,8 +6,8 @@ const t = "https://copilot.glodon.com/api/cvforce", e = 1048576, o = 1073741824,
|
|
|
6
6
|
export {
|
|
7
7
|
s as DEFAULT_FILTER_SWITCH,
|
|
8
8
|
o as GB,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
t as MB,
|
|
10
|
+
e as defaultApiUrl,
|
|
11
11
|
r as detectionPreService,
|
|
12
12
|
c as ocrPreService
|
|
13
13
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var H = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var O = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var c = Object.getOwnPropertySymbols;
|
|
4
|
+
var g = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var v = (e, r, o) => r in e ? H(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, s = (e, r) => {
|
|
6
|
+
for (var o in r || (r = {}))
|
|
7
|
+
g.call(r, o) && v(e, o, r[o]);
|
|
8
|
+
if (c)
|
|
9
|
+
for (var o of c(r))
|
|
10
|
+
T.call(r, o) && v(e, o, r[o]);
|
|
11
|
+
return e;
|
|
12
|
+
}, A = (e, r) => L(e, O(r));
|
|
13
|
+
var k = (e, r) => {
|
|
14
|
+
var o = {};
|
|
15
|
+
for (var t in e)
|
|
16
|
+
g.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
|
|
17
|
+
if (e != null && c)
|
|
18
|
+
for (var t of c(e))
|
|
19
|
+
r.indexOf(t) < 0 && T.call(e, t) && (o[t] = e[t]);
|
|
20
|
+
return o;
|
|
21
|
+
};
|
|
22
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
23
|
+
import B from "react-dom";
|
|
24
|
+
import { defaultApiUrl as V } from "../constant.mjs";
|
|
25
|
+
import $ from "../components/VLMAnnotationDetail/index.mjs";
|
|
26
|
+
import { CVForceDatahubApi as j, ModelServiceApi as z } from "@glodon-aiot/apis";
|
|
27
|
+
import { isExpired as G } from "../utils/index.mjs";
|
|
28
|
+
import { notification as h } from "antd";
|
|
29
|
+
import N from "axios";
|
|
30
|
+
import W from "lodash/merge";
|
|
31
|
+
import { VIEW_MODE_FEATURES as J, LABEL_MODE_FEATURES as K, MANAGE_MODE_FEATURES as P } from "../featuresConfig.mjs";
|
|
32
|
+
function Q(e) {
|
|
33
|
+
switch (e) {
|
|
34
|
+
case "manage":
|
|
35
|
+
return s({}, P);
|
|
36
|
+
case "label":
|
|
37
|
+
return s({}, K);
|
|
38
|
+
case "view":
|
|
39
|
+
return s({}, J);
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const ce = (e) => {
|
|
45
|
+
const l = e, {
|
|
46
|
+
getContainer: r = () => document.createElement("div"),
|
|
47
|
+
token: o,
|
|
48
|
+
errorHandlers: t,
|
|
49
|
+
apiUrl: f = V,
|
|
50
|
+
datasetId: S,
|
|
51
|
+
versionId: D,
|
|
52
|
+
mode: M = "label"
|
|
53
|
+
} = l, b = k(l, [
|
|
54
|
+
"getContainer",
|
|
55
|
+
"token",
|
|
56
|
+
"errorHandlers",
|
|
57
|
+
"apiUrl",
|
|
58
|
+
"datasetId",
|
|
59
|
+
"versionId",
|
|
60
|
+
"mode"
|
|
61
|
+
]), u = s({}, Q(M));
|
|
62
|
+
W(u, b);
|
|
63
|
+
const I = r(), w = (() => {
|
|
64
|
+
const x = f, U = (n) => {
|
|
65
|
+
var a;
|
|
66
|
+
if (!o)
|
|
67
|
+
return n;
|
|
68
|
+
if (G(o)) {
|
|
69
|
+
const i = "aiotToken is timeout";
|
|
70
|
+
t.aiotToken ? typeof t.aiotToken == "function" ? t.aiotToken(
|
|
71
|
+
// @ts-ignore
|
|
72
|
+
new Error(i, {
|
|
73
|
+
cause: {
|
|
74
|
+
status: 401,
|
|
75
|
+
message: i
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
|
|
79
|
+
}
|
|
80
|
+
return n.headers = (a = n.headers) != null ? a : {}, n.headers = A(s({}, n.headers), {
|
|
81
|
+
Authorization: o ? `Bearer ${o}` : ""
|
|
82
|
+
}), n;
|
|
83
|
+
};
|
|
84
|
+
function m(n, a = !0) {
|
|
85
|
+
const i = `${x}${n}`, E = N.create({
|
|
86
|
+
baseURL: i
|
|
87
|
+
});
|
|
88
|
+
return a && E.interceptors.request.use(U), E;
|
|
89
|
+
}
|
|
90
|
+
const d = (n, a) => {
|
|
91
|
+
n !== 10001 && n !== 10215 && (h.config({
|
|
92
|
+
getContainer: r
|
|
93
|
+
}), h.error({
|
|
94
|
+
message: a
|
|
95
|
+
}));
|
|
96
|
+
}, p = (n, a) => {
|
|
97
|
+
if (n === 401) {
|
|
98
|
+
const i = "aiotToken is invalid";
|
|
99
|
+
t.aiotToken ? typeof t.aiotToken == "function" ? t.aiotToken(
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
new Error(i, {
|
|
102
|
+
cause: {
|
|
103
|
+
status: 401,
|
|
104
|
+
message: i
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
|
|
108
|
+
}
|
|
109
|
+
}, _ = m("/datahub/v1"), C = new j(_, {
|
|
110
|
+
onHttpStatusError: p,
|
|
111
|
+
onAppStatusError: d
|
|
112
|
+
}), R = m("/mlopsdeploy/v1"), F = new z(R, {
|
|
113
|
+
onHttpStatusError: p,
|
|
114
|
+
onAppStatusError: d
|
|
115
|
+
});
|
|
116
|
+
return {
|
|
117
|
+
cvforceDatahub: C,
|
|
118
|
+
cvforceModelService: F
|
|
119
|
+
};
|
|
120
|
+
})();
|
|
121
|
+
B.render(/* @__PURE__ */ y($, s({
|
|
122
|
+
services: w,
|
|
123
|
+
datasetId: S,
|
|
124
|
+
versionId: D,
|
|
125
|
+
token: o,
|
|
126
|
+
apiUrl: f
|
|
127
|
+
}, u)), I);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
ce as default
|
|
131
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "https://cv-aiot.obs.cn-north-4.myhuaweicloud.com:443/demodata", a = {
|
|
1
|
+
const e = "https://cv-aiot.obs.cn-north-4.myhuaweicloud.com:443/demodata", a = "https://sjzn-cv-data.obs.cn-north-4.myhuaweicloud.com:443/dataset_data", t = {
|
|
2
2
|
labelManager: {
|
|
3
3
|
visible: !0,
|
|
4
4
|
add: !0,
|
|
@@ -21,8 +21,9 @@ const e = "https://cv-aiot.obs.cn-north-4.myhuaweicloud.com:443/demodata", a = {
|
|
|
21
21
|
labels: !0,
|
|
22
22
|
search: !0
|
|
23
23
|
},
|
|
24
|
-
exampleSrcRoot: e
|
|
25
|
-
|
|
24
|
+
exampleSrcRoot: e,
|
|
25
|
+
vlmExampleSrcRoot: a
|
|
26
|
+
}, l = {
|
|
26
27
|
labelManager: {
|
|
27
28
|
visible: !1,
|
|
28
29
|
add: !0,
|
|
@@ -45,8 +46,9 @@ const e = "https://cv-aiot.obs.cn-north-4.myhuaweicloud.com:443/demodata", a = {
|
|
|
45
46
|
labels: !0,
|
|
46
47
|
search: !0
|
|
47
48
|
},
|
|
48
|
-
exampleSrcRoot: e
|
|
49
|
-
|
|
49
|
+
exampleSrcRoot: e,
|
|
50
|
+
vlmExampleSrcRoot: a
|
|
51
|
+
}, r = {
|
|
50
52
|
labelManager: {
|
|
51
53
|
visible: !1,
|
|
52
54
|
add: !1,
|
|
@@ -69,11 +71,13 @@ const e = "https://cv-aiot.obs.cn-north-4.myhuaweicloud.com:443/demodata", a = {
|
|
|
69
71
|
labels: !0,
|
|
70
72
|
search: !0
|
|
71
73
|
},
|
|
72
|
-
exampleSrcRoot: e
|
|
74
|
+
exampleSrcRoot: e,
|
|
75
|
+
vlmExampleSrcRoot: a
|
|
73
76
|
};
|
|
74
77
|
export {
|
|
75
78
|
e as EXAMPLE_SRC_ROOT,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
l as LABEL_MODE_FEATURES,
|
|
80
|
+
t as MANAGE_MODE_FEATURES,
|
|
81
|
+
r as VIEW_MODE_FEATURES,
|
|
82
|
+
a as VLM_EXAMPLE_SRC_ROOT
|
|
79
83
|
};
|