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