@glodon-aiot/dataset-annotation 3.3.2-beta.0 → 3.3.2-beta.2

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.
@@ -1,20 +1,20 @@
1
- var x = (I, c, i) => new Promise((V, y) => {
2
- var T = (d) => {
1
+ var x = (I, d, i) => new Promise((V, y) => {
2
+ var T = (u) => {
3
3
  try {
4
- m(i.next(d));
4
+ m(i.next(u));
5
5
  } catch (N) {
6
6
  y(N);
7
7
  }
8
- }, t = (d) => {
8
+ }, t = (u) => {
9
9
  try {
10
- m(i.throw(d));
10
+ m(i.throw(u));
11
11
  } catch (N) {
12
12
  y(N);
13
13
  }
14
- }, m = (d) => d.done ? V(d.value) : Promise.resolve(d.value).then(T, t);
15
- m((i = i.apply(I, c)).next());
14
+ }, m = (u) => u.done ? V(u.value) : Promise.resolve(u.value).then(T, t);
15
+ m((i = i.apply(I, d)).next());
16
16
  });
17
- import { jsx as a, jsxs as v } from "react/jsx-runtime";
17
+ import { jsx as a, jsxs as g } from "react/jsx-runtime";
18
18
  import { useState as f, useContext as Y, useEffect as O } from "react";
19
19
  import { Form as h, Modal as Z, Button as C, Select as E, Tooltip as G, Tag as ee, InputNumber as te, Space as z, Spin as ae } from "antd";
20
20
  import { LoadingOutlined as ne } from "@ant-design/icons";
@@ -37,20 +37,20 @@ const re = [{
37
37
  key: "SUCCESS",
38
38
  color: "#2DC159",
39
39
  name: "已完成"
40
- }], ve = (I) => {
40
+ }], ge = (I) => {
41
41
  var j;
42
42
  const {
43
- datasetId: c,
43
+ datasetId: d,
44
44
  versionId: i,
45
45
  isVisible: V,
46
46
  onClose: y,
47
47
  setIsTaskChange: T,
48
48
  record: t,
49
49
  datasetType: m
50
- } = I, [d, N] = f([]), [A, M] = f([]), [S] = h.useForm(), [l, L] = f(), [F, q] = f(), [b, R] = f(""), k = h.useWatch("service", S), [B, _] = f(!1), {
50
+ } = I, [u, N] = f([]), [A, M] = f([]), [S] = h.useForm(), [l, L] = f(), [F, q] = f(), [b, R] = f(""), k = h.useWatch("service", S), [B, _] = f(!1), {
51
51
  services: {
52
- cvforceDatahub: r,
53
- cvforceModelService: g
52
+ cvforceDatahub: o,
53
+ cvforceModelService: v
54
54
  },
55
55
  featuresConfig: {
56
56
  labelManager: oe
@@ -65,49 +65,49 @@ const re = [{
65
65
  }, []), O(() => {
66
66
  t && L(t), t != null && t.lastTaskResult && q(JSON.parse(t == null ? void 0 : t.lastTaskResult));
67
67
  }, [t]), O(() => {
68
- var e, n, s, o, u;
68
+ var e, n, s, r, c;
69
69
  S.setFieldsValue({
70
70
  service: {
71
71
  value: (e = l == null ? void 0 : l.params) == null ? void 0 : e.serviceId,
72
72
  label: (n = l == null ? void 0 : l.params) == null ? void 0 : n.serviceName
73
73
  },
74
74
  data: (s = l == null ? void 0 : l.params) == null ? void 0 : s.data,
75
- confidence: (u = (o = l == null ? void 0 : l.params) == null ? void 0 : o.confidence) != null ? u : 0.6
75
+ confidence: (c = (r = l == null ? void 0 : l.params) == null ? void 0 : r.confidence) != null ? c : 0.6
76
76
  }), R((l == null ? void 0 : l.state) || "PENDING");
77
77
  }, [l]), O(() => {
78
78
  !k || !k.value || m !== "ocr" && Promise.all([U(), W(k.value)]).then(([e, n]) => {
79
79
  if (!e)
80
80
  return;
81
- const s = e.filter((o) => {
82
- if (!(n != null && n.find((u) => u === o)))
83
- return o;
81
+ const s = e.filter((r) => {
82
+ if (!(n != null && n.find((c) => c === r)))
83
+ return r;
84
84
  });
85
85
  _(!!s.length), S.validateFields(["service"]);
86
86
  });
87
87
  }, [k]);
88
88
  const U = () => {
89
- if (!(!c || !i))
90
- return r == null ? void 0 : r.getDatasetsIdVersionsVidLabelcount(c, i).then((e) => e.filter((s) => s.label !== "nocode").map((s) => s.label));
91
- }, W = (e) => g == null ? void 0 : g.getModelServiceById(e).then((n) => {
89
+ if (!(!d || !i))
90
+ return o == null ? void 0 : o.getDatasetsIdVersionsVidLabelcount(d, i).then((e) => e.filter((s) => s.label !== "nocode").map((s) => s.label));
91
+ }, W = (e) => v == null ? void 0 : v.getModelServiceById(e).then((n) => {
92
92
  const s = n.deployOptions.confidence;
93
- return s == null ? void 0 : s.map((u) => u.label);
93
+ return s == null ? void 0 : s.map((c) => c.label);
94
94
  }), $ = () => {
95
- g == null || g.openModelServices({
95
+ v == null || v.openModelServices({
96
96
  signName: J,
97
97
  state: "Running"
98
98
  }).then((e) => {
99
- const s = (e || []).map((o) => {
100
- var u;
99
+ const s = (e || []).map((r) => {
100
+ var c;
101
101
  return {
102
- label: o.name,
103
- value: o.id,
104
- confidence: ((u = o.deployOptions.confidence) == null ? void 0 : u.map((X) => X.label)) || []
102
+ label: r.name,
103
+ value: r.id,
104
+ confidence: ((c = r.deployOptions.confidence) == null ? void 0 : c.map((X) => X.label)) || []
105
105
  };
106
106
  });
107
107
  N(s);
108
108
  });
109
109
  }, H = () => {
110
- !c || !i || r == null || r.getDatasetsIdVersionsVidSamples(c, i, {
110
+ !d || !i || o == null || o.getDatasetsIdVersionsVidSamples(d, i, {
111
111
  labels: "nocode",
112
112
  pageNo: 1,
113
113
  pageSize: 1
@@ -120,7 +120,7 @@ const re = [{
120
120
  }]);
121
121
  });
122
122
  }, w = () => {
123
- !c || !i || !(l != null && l.taskId) || r == null || r.delPreLabelTask(c, i, l.taskId).then((e) => {
123
+ !d || !i || !(l != null && l.taskId) || o == null || o.delPreLabelTask(d, i, l.taskId).then((e) => {
124
124
  T((n) => !n), R("PENDING");
125
125
  });
126
126
  }, K = () => {
@@ -128,16 +128,17 @@ const re = [{
128
128
  }, Q = () => {
129
129
  w(), S.resetFields(), L(void 0);
130
130
  }, D = (e) => {
131
- if (!c || !i || !e.service)
131
+ var s;
132
+ if (!d || !i || !e.service)
132
133
  return;
133
134
  const n = {
134
135
  serviceId: e.service.value,
135
- serviceName: e.service.label,
136
+ serviceName: (s = u.find((r) => r.value === e.service.value)) == null ? void 0 : s.label,
136
137
  data: "nolabel",
137
138
  confidence: e.confidence
138
139
  };
139
- r == null || r.postPreLabelTask(c, i, n).then((s) => {
140
- T((o) => !o);
140
+ o == null || o.postPreLabelTask(d, i, n).then((r) => {
141
+ T((c) => !c);
141
142
  });
142
143
  };
143
144
  return /* @__PURE__ */ a(Z, {
@@ -171,7 +172,7 @@ const re = [{
171
172
  onClick: P,
172
173
  children: "返回"
173
174
  }, "cancel")],
174
- children: /* @__PURE__ */ v(h, {
175
+ children: /* @__PURE__ */ g(h, {
175
176
  onFinish: D,
176
177
  name: "preLabelForm",
177
178
  labelAlign: "right",
@@ -201,7 +202,7 @@ const re = [{
201
202
  children: /* @__PURE__ */ a(E, {
202
203
  labelInValue: !0,
203
204
  disabled: (t == null ? void 0 : t.state) === p.Started,
204
- children: d.map((e) => /* @__PURE__ */ a(E.Option, {
205
+ children: u.map((e) => /* @__PURE__ */ a(E.Option, {
205
206
  value: e.value,
206
207
  disabled: e.disabled,
207
208
  children: /* @__PURE__ */ a(G, {
@@ -245,7 +246,7 @@ const re = [{
245
246
  })
246
247
  }), /* @__PURE__ */ a(h.Item, {
247
248
  label: "标注状态",
248
- children: /* @__PURE__ */ v(z, {
249
+ children: /* @__PURE__ */ g(z, {
249
250
  className: "mark-status",
250
251
  children: [b === p.Started ? /* @__PURE__ */ a(ae, {
251
252
  indicator: /* @__PURE__ */ a(ne, {
@@ -258,17 +259,17 @@ const re = [{
258
259
  className: `status-tip status-tip-${b || "PENDING"}`
259
260
  }), /* @__PURE__ */ a("span", {
260
261
  children: ((j = re.find((e) => e.key == b)) == null ? void 0 : j.name) || "待确认"
261
- }), (b === p.Started || b === p.Success) && /* @__PURE__ */ v(z, {
262
+ }), (b === p.Started || b === p.Success) && /* @__PURE__ */ g(z, {
262
263
  style: {
263
264
  marginLeft: 14
264
265
  },
265
266
  size: 14,
266
- children: [/* @__PURE__ */ v("span", {
267
+ children: [/* @__PURE__ */ g("span", {
267
268
  children: [F.successCount || 0, "/", F.allCount || 0]
268
- }), /* @__PURE__ */ v("span", {
269
+ }), /* @__PURE__ */ g("span", {
269
270
  children: ["已标注数据:", F.successCount || 0, " 张"]
270
271
  })]
271
- }), b === p.Success && /* @__PURE__ */ v("span", {
272
+ }), b === p.Success && /* @__PURE__ */ g("span", {
272
273
  children: [",失败:", F.failCount || 0, " 张"]
273
274
  })]
274
275
  })
@@ -277,5 +278,5 @@ const re = [{
277
278
  });
278
279
  };
279
280
  export {
280
- ve as default
281
+ ge as default
281
282
  };
@@ -1,18 +1,18 @@
1
- var V = (E, o, r) => new Promise((I, y) => {
2
- var T = (c) => {
1
+ var V = (E, c, i) => new Promise((I, y) => {
2
+ var T = (d) => {
3
3
  try {
4
- p(r.next(c));
4
+ p(i.next(d));
5
5
  } catch (N) {
6
6
  y(N);
7
7
  }
8
- }, t = (c) => {
8
+ }, t = (d) => {
9
9
  try {
10
- p(r.throw(c));
10
+ p(i.throw(d));
11
11
  } catch (N) {
12
12
  y(N);
13
13
  }
14
- }, p = (c) => c.done ? I(c.value) : Promise.resolve(c.value).then(T, t);
15
- p((r = r.apply(E, o)).next());
14
+ }, p = (d) => d.done ? I(d.value) : Promise.resolve(d.value).then(T, t);
15
+ p((i = i.apply(E, c)).next());
16
16
  });
17
17
  import { jsx as a, jsxs as S } from "react/jsx-runtime";
18
18
  import { useState as g, useContext as Y, useEffect as D } from "react";
@@ -21,8 +21,8 @@ import { LoadingOutlined as ne } from "@ant-design/icons";
21
21
  import { PreLabelTaskStatus as u } from "@glodon-aiot/apis";
22
22
  import "./style.less.mjs";
23
23
  import le from "../../DatasetContext/index.mjs";
24
- import { detectionPreService as se, ocrPreService as re } from "../../constant.mjs";
25
- const ie = [{
24
+ import { detectionPreService as se, ocrPreService as ie } from "../../constant.mjs";
25
+ const re = [{
26
26
  index: 0,
27
27
  key: "PENDING",
28
28
  color: "#0F64FF",
@@ -40,19 +40,19 @@ const ie = [{
40
40
  }], fe = (E) => {
41
41
  var j;
42
42
  const {
43
- datasetId: o,
44
- versionId: r,
43
+ datasetId: c,
44
+ versionId: i,
45
45
  isVisible: I,
46
46
  onClose: y,
47
47
  setIsTaskChange: T,
48
48
  record: t,
49
49
  datasetType: p
50
- } = E, [c, N] = g([]), [A, q] = g([]), [v] = h.useForm(), [l, x] = g(), [F, B] = g(), [b, L] = g(""), k = h.useWatch("service", v), [_, J] = g(!1), {
50
+ } = E, [d, N] = g([]), [A, q] = g([]), [v] = h.useForm(), [l, x] = g(), [F, B] = g(), [b, L] = g(""), k = h.useWatch("service", v), [_, J] = g(!1), {
51
51
  services: {
52
52
  cvforceDatahub: m,
53
53
  cvforceModelService: f
54
54
  }
55
- } = Y(le), M = p === "detection" ? se : re, P = () => {
55
+ } = Y(le), M = p === "detection" ? se : ie, P = () => {
56
56
  y();
57
57
  };
58
58
  D(() => {
@@ -60,49 +60,49 @@ const ie = [{
60
60
  }, []), D(() => {
61
61
  t && x(t), t != null && t.lastTaskResult && B(JSON.parse(t == null ? void 0 : t.lastTaskResult));
62
62
  }, [t]), D(() => {
63
- var e, n, s, i, d;
63
+ var e, n, s, r, o;
64
64
  v.setFieldsValue({
65
65
  service: {
66
66
  value: (e = l == null ? void 0 : l.params) == null ? void 0 : e.serviceId,
67
67
  label: (n = l == null ? void 0 : l.params) == null ? void 0 : n.serviceName
68
68
  },
69
69
  data: (s = l == null ? void 0 : l.params) == null ? void 0 : s.data,
70
- confidence: (d = (i = l == null ? void 0 : l.params) == null ? void 0 : i.confidence) != null ? d : 0.6
70
+ confidence: (o = (r = l == null ? void 0 : l.params) == null ? void 0 : r.confidence) != null ? o : 0.6
71
71
  }), L((l == null ? void 0 : l.state) || "PENDING");
72
72
  }, [l]), D(() => {
73
73
  !k || !k.value || p !== "ocr" && Promise.all([U(), W(k.value)]).then(([e, n]) => {
74
74
  if (!e)
75
75
  return;
76
- const s = e.filter((i) => {
77
- if (!(n != null && n.find((d) => d === i)))
78
- return i;
76
+ const s = e.filter((r) => {
77
+ if (!(n != null && n.find((o) => o === r)))
78
+ return r;
79
79
  });
80
80
  J(!!s.length), v.validateFields(["service"]);
81
81
  });
82
82
  }, [k]);
83
83
  const U = () => {
84
- if (!(!o || !r || !m))
85
- return m.getDatasetsIdVersionsVidLabelcount(o, r).then((e) => e.filter((s) => s.label !== "nocode").map((s) => s.label));
84
+ if (!(!c || !i || !m))
85
+ return m.getDatasetsIdVersionsVidLabelcount(c, i).then((e) => e.filter((s) => s.label !== "nocode").map((s) => s.label));
86
86
  }, W = (e) => f == null ? void 0 : f.getModelServiceById(e).then((n) => {
87
87
  const s = n.deployOptions.confidence;
88
- return s == null ? void 0 : s.map((d) => d.label);
88
+ return s == null ? void 0 : s.map((o) => o.label);
89
89
  }), $ = () => {
90
90
  f == null || f.openModelServices({
91
91
  signName: M,
92
92
  state: "Running"
93
93
  }).then((e) => {
94
- const s = (e || []).map((i) => {
95
- var d;
94
+ const s = (e || []).map((r) => {
95
+ var o;
96
96
  return {
97
- label: i.name,
98
- value: i.id,
99
- confidence: ((d = i.deployOptions.confidence) == null ? void 0 : d.map((X) => X.label)) || []
97
+ label: r.name,
98
+ value: r.id,
99
+ confidence: ((o = r.deployOptions.confidence) == null ? void 0 : o.map((X) => X.label)) || []
100
100
  };
101
101
  });
102
102
  N(s);
103
103
  });
104
104
  }, H = () => {
105
- !o || !r || !m || m.getDatasetsIdVersionsVidSamples(o, r, {
105
+ !c || !i || !m || m.getDatasetsIdVersionsVidSamples(c, i, {
106
106
  labels: "nocode",
107
107
  pageNo: 1,
108
108
  pageSize: 1
@@ -115,7 +115,7 @@ const ie = [{
115
115
  }]);
116
116
  });
117
117
  }, R = () => {
118
- !o || !r || !(l != null && l.taskId) || !m || m.delPreLabelTask(o, r, l.taskId).then((e) => {
118
+ !c || !i || !(l != null && l.taskId) || !m || m.delPreLabelTask(c, i, l.taskId).then((e) => {
119
119
  T((n) => !n), L("PENDING");
120
120
  });
121
121
  }, K = () => {
@@ -123,16 +123,17 @@ const ie = [{
123
123
  }, Q = () => {
124
124
  R(), v.resetFields(), x(void 0);
125
125
  }, w = (e) => {
126
- if (!o || !r || !e.service || !m)
126
+ var s;
127
+ if (!c || !i || !e.service || !m)
127
128
  return;
128
129
  const n = {
129
130
  serviceId: e.service.value,
130
- serviceName: e.service.label,
131
+ serviceName: (s = d.find((r) => r.value === e.service.value)) == null ? void 0 : s.label,
131
132
  data: "nolabel",
132
133
  confidence: e.confidence
133
134
  };
134
- m.postPreLabelTask(o, r, n).then((s) => {
135
- T((i) => !i);
135
+ m.postPreLabelTask(c, i, n).then((r) => {
136
+ T((o) => !o);
136
137
  });
137
138
  };
138
139
  return /* @__PURE__ */ a(Z, {
@@ -196,7 +197,7 @@ const ie = [{
196
197
  children: /* @__PURE__ */ a(O, {
197
198
  labelInValue: !0,
198
199
  disabled: (t == null ? void 0 : t.state) === u.Started,
199
- children: c.map((e) => /* @__PURE__ */ a(O.Option, {
200
+ children: d.map((e) => /* @__PURE__ */ a(O.Option, {
200
201
  value: e.value,
201
202
  disabled: e.disabled,
202
203
  children: /* @__PURE__ */ a(G, {
@@ -252,7 +253,7 @@ const ie = [{
252
253
  }) : /* @__PURE__ */ a("span", {
253
254
  className: `status-tip status-tip-${b || "PENDING"}`
254
255
  }), /* @__PURE__ */ a("span", {
255
- children: ((j = ie.find((e) => e.key == b)) == null ? void 0 : j.name) || "待确认"
256
+ children: ((j = re.find((e) => e.key == b)) == null ? void 0 : j.name) || "待确认"
256
257
  }), (b === u.Started || b === u.Success) && /* @__PURE__ */ S(z, {
257
258
  style: {
258
259
  marginLeft: 14