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