@glodon-aiot/dataset-annotation 3.19.0-alpha.19 → 3.19.0-alpha.21
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 +3 -2
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +183 -177
- package/dist/es/components/VLMAnnotationDetail/index.mjs +73 -71
- package/dist/es/createClassificationDatasetAnnotation/index.mjs +99 -80
- package/dist/es/createDatasetAnnotation/index.mjs +95 -76
- package/dist/es/createDetectionDatasetAnnotation/index.mjs +103 -84
- package/dist/es/createOcrDatasetAnnotation/index.mjs +103 -84
- package/dist/es/createVlmtasetAnnotation/index.mjs +100 -80
- package/dist/es/index.mjs +1 -1
- package/dist/es/utils/index.mjs +44 -17
- package/dist/lib/index.js +3 -3
- package/dist/src/DatasetContext/index.d.ts +2 -0
- package/dist/src/api.d.ts +2 -1
- package/dist/src/createClassificationDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createDetectionDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createOcrDatasetAnnotation/index.d.ts +2 -0
- package/dist/src/createVlmtasetAnnotation/index.d.ts +2 -0
- package/dist/src/featuresConfig.d.ts +2 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1,127 +1,146 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var F = Object.defineProperty, H = Object.defineProperties;
|
|
2
|
+
var B = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (e, r, o) => r in e ? F(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o, l = (e, r) => {
|
|
6
6
|
for (var o in r || (r = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
A.call(r, o) && h(e, o, r[o]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var o of d(r))
|
|
10
|
+
S.call(r, o) && h(e, o, r[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, M = (e, r) => H(e, B(r));
|
|
13
|
+
var b = (e, r) => {
|
|
14
14
|
var o = {};
|
|
15
15
|
for (var t in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var t of
|
|
19
|
-
r.indexOf(t) < 0 &&
|
|
16
|
+
A.call(e, t) && r.indexOf(t) < 0 && (o[t] = e[t]);
|
|
17
|
+
if (e != null && d)
|
|
18
|
+
for (var t of d(e))
|
|
19
|
+
r.indexOf(t) < 0 && S.call(e, t) && (o[t] = e[t]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
var w = (e, r, o) => new Promise((t, a) => {
|
|
23
|
+
var T = (s) => {
|
|
24
|
+
try {
|
|
25
|
+
m(o.next(s));
|
|
26
|
+
} catch (u) {
|
|
27
|
+
a(u);
|
|
28
|
+
}
|
|
29
|
+
}, v = (s) => {
|
|
30
|
+
try {
|
|
31
|
+
m(o.throw(s));
|
|
32
|
+
} catch (u) {
|
|
33
|
+
a(u);
|
|
34
|
+
}
|
|
35
|
+
}, m = (s) => s.done ? t(s.value) : Promise.resolve(s.value).then(T, v);
|
|
36
|
+
m((o = o.apply(e, r)).next());
|
|
37
|
+
});
|
|
38
|
+
import { defaultApiUrl as L } from "../constant.mjs";
|
|
39
|
+
import { CVForceDatahubApi as $, ModelServiceApi as V } from "@glodon-aiot/apis";
|
|
40
|
+
import { isExpired as z, createTokenResolver as G } from "../utils/index.mjs";
|
|
41
|
+
import { notification as I } from "antd";
|
|
42
|
+
import N from "axios";
|
|
43
|
+
import W from "lodash/merge";
|
|
44
|
+
import { VIEW_MODE_FEATURES as j, LABEL_MODE_FEATURES as J, MANAGE_MODE_FEATURES as K } from "../featuresConfig.mjs";
|
|
45
|
+
import P from "../createDetectionDatasetAnnotation/index.mjs";
|
|
46
|
+
import Q from "../createOcrDatasetAnnotation/index.mjs";
|
|
47
|
+
function X(e) {
|
|
32
48
|
switch (e) {
|
|
33
49
|
case "manage":
|
|
34
|
-
return
|
|
50
|
+
return l({}, K);
|
|
35
51
|
case "label":
|
|
36
|
-
return
|
|
52
|
+
return l({}, J);
|
|
37
53
|
case "view":
|
|
38
|
-
return
|
|
54
|
+
return l({}, j);
|
|
39
55
|
default:
|
|
40
56
|
return null;
|
|
41
57
|
}
|
|
42
58
|
}
|
|
43
|
-
const
|
|
44
|
-
const
|
|
59
|
+
const fe = (e) => {
|
|
60
|
+
const k = e, {
|
|
45
61
|
getContainer: r = () => document.createElement("div"),
|
|
46
62
|
token: o,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
getToken: t,
|
|
64
|
+
errorHandlers: a,
|
|
65
|
+
apiUrl: T = L,
|
|
66
|
+
datasetId: v,
|
|
67
|
+
versionId: m,
|
|
68
|
+
mode: s = "label"
|
|
69
|
+
} = k, u = b(k, [
|
|
53
70
|
"getContainer",
|
|
54
71
|
"token",
|
|
72
|
+
"getToken",
|
|
55
73
|
"errorHandlers",
|
|
56
74
|
"apiUrl",
|
|
57
75
|
"datasetId",
|
|
58
76
|
"versionId",
|
|
59
77
|
"mode"
|
|
60
|
-
]),
|
|
61
|
-
|
|
62
|
-
const
|
|
78
|
+
]), C = l({}, X(s));
|
|
79
|
+
W(C, u), r(), (() => {
|
|
80
|
+
const p = T, R = G(o, t), y = (n) => w(void 0, null, function* () {
|
|
63
81
|
var i;
|
|
64
|
-
|
|
82
|
+
const c = yield R();
|
|
83
|
+
if (!c)
|
|
65
84
|
return n;
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
|
|
85
|
+
if (z(c)) {
|
|
86
|
+
const f = "aiotToken is timeout";
|
|
87
|
+
a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
|
|
69
88
|
// @ts-ignore
|
|
70
|
-
new Error(
|
|
89
|
+
new Error(f, {
|
|
71
90
|
cause: {
|
|
72
91
|
status: 401,
|
|
73
|
-
message:
|
|
92
|
+
message: f
|
|
74
93
|
}
|
|
75
94
|
})
|
|
76
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
95
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(f);
|
|
77
96
|
}
|
|
78
|
-
return n.headers = (i = n.headers) != null ? i : {}, n.headers =
|
|
79
|
-
Authorization:
|
|
97
|
+
return n.headers = (i = n.headers) != null ? i : {}, n.headers = M(l({}, n.headers), {
|
|
98
|
+
Authorization: c ? `Bearer ${c}` : ""
|
|
80
99
|
}), n;
|
|
81
|
-
};
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
baseURL:
|
|
100
|
+
});
|
|
101
|
+
function E(n, c = !0) {
|
|
102
|
+
const i = `${p}${n}`, f = N.create({
|
|
103
|
+
baseURL: i
|
|
85
104
|
});
|
|
86
|
-
return
|
|
105
|
+
return c && f.interceptors.request.use(y), f;
|
|
87
106
|
}
|
|
88
|
-
const
|
|
89
|
-
n !== 10001 && n !== 10215 && (
|
|
107
|
+
const g = (n, c) => {
|
|
108
|
+
n !== 10001 && n !== 10215 && (I.config({
|
|
90
109
|
getContainer: r
|
|
91
|
-
}),
|
|
92
|
-
message:
|
|
110
|
+
}), I.error({
|
|
111
|
+
message: c
|
|
93
112
|
}));
|
|
94
|
-
},
|
|
113
|
+
}, D = (n, c) => {
|
|
95
114
|
if (n === 401) {
|
|
96
|
-
const
|
|
97
|
-
|
|
115
|
+
const i = "aiotToken is invalid";
|
|
116
|
+
a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
|
|
98
117
|
// @ts-ignore
|
|
99
|
-
new Error(
|
|
118
|
+
new Error(i, {
|
|
100
119
|
cause: {
|
|
101
120
|
status: 401,
|
|
102
|
-
message:
|
|
121
|
+
message: i
|
|
103
122
|
}
|
|
104
123
|
})
|
|
105
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
124
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(i);
|
|
106
125
|
}
|
|
107
|
-
},
|
|
108
|
-
onHttpStatusError:
|
|
109
|
-
onAppStatusError:
|
|
110
|
-
}),
|
|
111
|
-
onHttpStatusError:
|
|
112
|
-
onAppStatusError:
|
|
126
|
+
}, O = E("/datahub/v1"), U = new $(O, {
|
|
127
|
+
onHttpStatusError: D,
|
|
128
|
+
onAppStatusError: g
|
|
129
|
+
}), _ = E("/mlopsdeploy/v1"), x = new V(_, {
|
|
130
|
+
onHttpStatusError: D,
|
|
131
|
+
onAppStatusError: g
|
|
113
132
|
});
|
|
114
133
|
return {
|
|
115
|
-
cvforceDatahub:
|
|
116
|
-
cvforceModelService:
|
|
134
|
+
cvforceDatahub: U,
|
|
135
|
+
cvforceModelService: x
|
|
117
136
|
};
|
|
118
|
-
})().cvforceDatahub.getDatasetsId(
|
|
119
|
-
switch (
|
|
137
|
+
})().cvforceDatahub.getDatasetsId(v).then((p) => {
|
|
138
|
+
switch (p.markType) {
|
|
120
139
|
case "detection":
|
|
121
|
-
|
|
140
|
+
P(e);
|
|
122
141
|
return;
|
|
123
142
|
case "ocr":
|
|
124
|
-
|
|
143
|
+
p.ocrMarkTmpl === "DetectionOCR" ? Q(e) : console.error("ocr类型下只支持DetectionOCR类型,请检查数据集ocrMarkTmpl类型。");
|
|
125
144
|
return;
|
|
126
145
|
default:
|
|
127
146
|
console.error("只支持detection、ocr两种类型,请检查数据集markType类型。");
|
|
@@ -129,5 +148,5 @@ const ae = (e) => {
|
|
|
129
148
|
});
|
|
130
149
|
};
|
|
131
150
|
export {
|
|
132
|
-
|
|
151
|
+
fe as default
|
|
133
152
|
};
|
|
@@ -1,133 +1,152 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var $ = Object.defineProperty, V = Object.defineProperties;
|
|
2
|
+
var j = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var S = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (e, t, o) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, f = (e, t) => {
|
|
6
6
|
for (var o in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var o of
|
|
10
|
-
|
|
7
|
+
S.call(t, o) && h(e, o, t[o]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var o of p(t))
|
|
10
|
+
D.call(t, o) && h(e, o, t[o]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, I = (e, t) => V(e, j(t));
|
|
13
|
+
var w = (e, t) => {
|
|
14
14
|
var o = {};
|
|
15
15
|
for (var r in e)
|
|
16
|
-
|
|
17
|
-
if (e != null &&
|
|
18
|
-
for (var r of
|
|
19
|
-
t.indexOf(r) < 0 &&
|
|
16
|
+
S.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
|
|
17
|
+
if (e != null && p)
|
|
18
|
+
for (var r of p(e))
|
|
19
|
+
t.indexOf(r) < 0 && D.call(e, r) && (o[r] = e[r]);
|
|
20
20
|
return o;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
var M = (e, t, o) => new Promise((r, a) => {
|
|
23
|
+
var d = (i) => {
|
|
24
|
+
try {
|
|
25
|
+
l(o.next(i));
|
|
26
|
+
} catch (m) {
|
|
27
|
+
a(m);
|
|
28
|
+
}
|
|
29
|
+
}, v = (i) => {
|
|
30
|
+
try {
|
|
31
|
+
l(o.throw(i));
|
|
32
|
+
} catch (m) {
|
|
33
|
+
a(m);
|
|
34
|
+
}
|
|
35
|
+
}, l = (i) => i.done ? r(i.value) : Promise.resolve(i.value).then(d, v);
|
|
36
|
+
l((o = o.apply(e, t)).next());
|
|
37
|
+
});
|
|
38
|
+
import { jsx as z } from "react/jsx-runtime";
|
|
39
|
+
import G from "react-dom";
|
|
40
|
+
import { defaultApiUrl as N } from "../constant.mjs";
|
|
41
|
+
import W from "../components/DetectionAnnotation/index.mjs";
|
|
42
|
+
import { CVForceDatahubApi as J, ModelServiceApi as K, AIShopApi as P } from "@glodon-aiot/apis";
|
|
43
|
+
import { isExpired as Q, createTokenResolver as X } from "../utils/index.mjs";
|
|
44
|
+
import { notification as b } from "antd";
|
|
45
|
+
import Y from "axios";
|
|
46
|
+
import Z from "lodash/merge";
|
|
47
|
+
import { VIEW_MODE_FEATURES as q, LABEL_MODE_FEATURES as ee, MANAGE_MODE_FEATURES as oe } from "../featuresConfig.mjs";
|
|
48
|
+
function te(e) {
|
|
33
49
|
switch (e) {
|
|
34
50
|
case "manage":
|
|
35
|
-
return
|
|
51
|
+
return f({}, oe);
|
|
36
52
|
case "label":
|
|
37
|
-
return
|
|
53
|
+
return f({}, ee);
|
|
38
54
|
case "view":
|
|
39
|
-
return
|
|
55
|
+
return f({}, q);
|
|
40
56
|
default:
|
|
41
57
|
return null;
|
|
42
58
|
}
|
|
43
59
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
60
|
+
const ve = (e) => {
|
|
61
|
+
const A = e, {
|
|
46
62
|
getContainer: t = () => document.createElement("div"),
|
|
47
63
|
token: o,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
getToken: r,
|
|
65
|
+
errorHandlers: a,
|
|
66
|
+
apiUrl: d = N,
|
|
67
|
+
datasetId: v,
|
|
68
|
+
versionId: l,
|
|
69
|
+
mode: i = "label"
|
|
70
|
+
} = A, m = w(A, [
|
|
54
71
|
"getContainer",
|
|
55
72
|
"token",
|
|
73
|
+
"getToken",
|
|
56
74
|
"errorHandlers",
|
|
57
75
|
"apiUrl",
|
|
58
76
|
"datasetId",
|
|
59
77
|
"versionId",
|
|
60
78
|
"mode"
|
|
61
|
-
]),
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
|
|
79
|
+
]), k = f({}, te(i));
|
|
80
|
+
Z(k, m);
|
|
81
|
+
const R = t(), U = (() => {
|
|
82
|
+
const _ = d, x = X(o, r), C = (n) => M(void 0, null, function* () {
|
|
83
|
+
var c;
|
|
84
|
+
const s = yield x();
|
|
85
|
+
if (!s)
|
|
67
86
|
return n;
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
87
|
+
if (Q(s)) {
|
|
88
|
+
const u = "aiotToken is timeout";
|
|
89
|
+
a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
|
|
71
90
|
// @ts-ignore
|
|
72
|
-
new Error(
|
|
91
|
+
new Error(u, {
|
|
73
92
|
cause: {
|
|
74
93
|
status: 401,
|
|
75
|
-
message:
|
|
94
|
+
message: u
|
|
76
95
|
}
|
|
77
96
|
})
|
|
78
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
97
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(u);
|
|
79
98
|
}
|
|
80
|
-
return n.headers = (
|
|
81
|
-
Authorization:
|
|
99
|
+
return n.headers = (c = n.headers) != null ? c : {}, n.headers = I(f({}, n.headers), {
|
|
100
|
+
Authorization: s ? `Bearer ${s}` : ""
|
|
82
101
|
}), n;
|
|
83
|
-
};
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
baseURL:
|
|
102
|
+
});
|
|
103
|
+
function E(n, s = !0) {
|
|
104
|
+
const c = `${_}${n}`, u = Y.create({
|
|
105
|
+
baseURL: c
|
|
87
106
|
});
|
|
88
|
-
return
|
|
107
|
+
return s && u.interceptors.request.use(C), u;
|
|
89
108
|
}
|
|
90
|
-
const
|
|
91
|
-
n !== 10001 && n !== 10215 && (
|
|
109
|
+
const T = (n, s) => {
|
|
110
|
+
n !== 10001 && n !== 10215 && (b.config({
|
|
92
111
|
getContainer: t
|
|
93
|
-
}),
|
|
94
|
-
message:
|
|
112
|
+
}), b.error({
|
|
113
|
+
message: s
|
|
95
114
|
}));
|
|
96
|
-
},
|
|
115
|
+
}, g = (n, s) => {
|
|
97
116
|
if (n === 401) {
|
|
98
|
-
const
|
|
99
|
-
|
|
117
|
+
const c = "aiotToken is invalid";
|
|
118
|
+
a.aiotToken ? typeof a.aiotToken == "function" ? a.aiotToken(
|
|
100
119
|
// @ts-ignore
|
|
101
|
-
new Error(
|
|
120
|
+
new Error(c, {
|
|
102
121
|
cause: {
|
|
103
122
|
status: 401,
|
|
104
|
-
message:
|
|
123
|
+
message: c
|
|
105
124
|
}
|
|
106
125
|
})
|
|
107
|
-
) : console.error("errorHandlers.aiotToken is not a function") : console.error(
|
|
126
|
+
) : console.error("errorHandlers.aiotToken is not a function") : console.error(c);
|
|
108
127
|
}
|
|
109
|
-
},
|
|
110
|
-
onHttpStatusError:
|
|
111
|
-
onAppStatusError:
|
|
112
|
-
}),
|
|
113
|
-
onHttpStatusError:
|
|
114
|
-
onAppStatusError:
|
|
115
|
-
}),
|
|
116
|
-
onHttpStatusError:
|
|
117
|
-
onAppStatusError:
|
|
128
|
+
}, y = E("/datahub/v1"), F = new J(y, {
|
|
129
|
+
onHttpStatusError: g,
|
|
130
|
+
onAppStatusError: T
|
|
131
|
+
}), H = E("/mlopsdeploy/v1"), O = new K(H, {
|
|
132
|
+
onHttpStatusError: g,
|
|
133
|
+
onAppStatusError: T
|
|
134
|
+
}), B = E("/aishop"), L = new P(B, {
|
|
135
|
+
onHttpStatusError: g,
|
|
136
|
+
onAppStatusError: T
|
|
118
137
|
});
|
|
119
138
|
return {
|
|
120
|
-
cvforceDatahub:
|
|
121
|
-
cvforceModelService:
|
|
122
|
-
aiShop:
|
|
139
|
+
cvforceDatahub: F,
|
|
140
|
+
cvforceModelService: O,
|
|
141
|
+
aiShop: L
|
|
123
142
|
};
|
|
124
143
|
})();
|
|
125
|
-
|
|
126
|
-
services:
|
|
127
|
-
datasetId:
|
|
128
|
-
versionId:
|
|
129
|
-
},
|
|
144
|
+
G.render(/* @__PURE__ */ z(W, f({
|
|
145
|
+
services: U,
|
|
146
|
+
datasetId: v,
|
|
147
|
+
versionId: l
|
|
148
|
+
}, k)), R);
|
|
130
149
|
};
|
|
131
150
|
export {
|
|
132
|
-
|
|
151
|
+
ve as default
|
|
133
152
|
};
|