@glodon-aiot/dataset-annotation 3.16.0-alpha.37 → 3.16.0-alpha.38
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.
|
@@ -2,15 +2,15 @@ var $ = Math.pow;
|
|
|
2
2
|
import { jsx as f, jsxs as V } from "react/jsx-runtime";
|
|
3
3
|
import { useRef as ee, useState as D, useEffect as h } from "react";
|
|
4
4
|
import { fabric as X } from "fabric";
|
|
5
|
-
import { useKeyPress as
|
|
5
|
+
import { useKeyPress as R } from "ahooks";
|
|
6
6
|
import "./style.less.mjs";
|
|
7
7
|
import le from "react-dom";
|
|
8
|
-
import { Spin as fe, Space as de, Tooltip as
|
|
8
|
+
import { Spin as fe, Space as de, Tooltip as A, Button as L } from "antd";
|
|
9
9
|
import te from "./RectLabel.mjs";
|
|
10
10
|
import { drawable as ue } from "./Drawable.mjs";
|
|
11
11
|
import { ZoomInOutlined as me, ZoomOutOutlined as ge, DragOutlined as he, ClearOutlined as pe } from "@ant-design/icons";
|
|
12
12
|
import be from "classnames";
|
|
13
|
-
import { approxeq as
|
|
13
|
+
import { approxeq as S } from "../../../../utils/index.mjs";
|
|
14
14
|
const oe = (a) => {
|
|
15
15
|
a.off("mouse:down"), a.off("mouse:up");
|
|
16
16
|
}, O = (a) => {
|
|
@@ -28,9 +28,9 @@ const oe = (a) => {
|
|
|
28
28
|
id: a.config.id,
|
|
29
29
|
label: a.config.name,
|
|
30
30
|
color: a.config.color,
|
|
31
|
-
box: (d == null ? void 0 : d.map((y) => [
|
|
31
|
+
box: (d == null ? void 0 : d.map((y) => [S(y.x - m.x, 0) ? 0 : S(y.x - m.x, p.width) ? p.width : y.x - m.x, S(y.y - m.y, 0) ? 0 : S(y.y - m.y, p.height) ? p.height : y.y - m.y])) || []
|
|
32
32
|
};
|
|
33
|
-
},
|
|
33
|
+
}, Ae = (a) => {
|
|
34
34
|
const d = ee(null), {
|
|
35
35
|
labels: m,
|
|
36
36
|
imageUrl: p,
|
|
@@ -38,12 +38,12 @@ const oe = (a) => {
|
|
|
38
38
|
onImageLoad: E,
|
|
39
39
|
onChange: l,
|
|
40
40
|
isPreLabel: y,
|
|
41
|
-
disabled:
|
|
41
|
+
disabled: k,
|
|
42
42
|
renderLabelItem: N
|
|
43
|
-
} = a, [z, B] = D(!0), [e, Z] = D(), [ye, ne] = D({}), [
|
|
43
|
+
} = a, [z, B] = D(!0), [e, Z] = D(), [ye, ne] = D({}), [j, K] = D(), [W, re] = D({
|
|
44
44
|
left: 0,
|
|
45
45
|
top: 0
|
|
46
|
-
}), [ie, U] = D([1, 1]), [
|
|
46
|
+
}), [ie, U] = D([1, 1]), [M, H] = D(), [x, v] = D([]), w = ee(/* @__PURE__ */ new Set()), [b, P] = D(k || !1), Y = (o, t) => {
|
|
47
47
|
if (!e)
|
|
48
48
|
return;
|
|
49
49
|
t || (t = {
|
|
@@ -74,8 +74,8 @@ const oe = (a) => {
|
|
|
74
74
|
return i && i === t;
|
|
75
75
|
})), u >= 0 && r[u]) {
|
|
76
76
|
const s = r[u];
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
w.current.add(s.config.id), s.destroy(), r.splice(u, 1), l && l(r.map(O)), setTimeout(() => {
|
|
78
|
+
w.current.delete(s.config.id);
|
|
79
79
|
}, 100);
|
|
80
80
|
} else if (t && e) {
|
|
81
81
|
const s = r.findIndex((i) => {
|
|
@@ -84,8 +84,8 @@ const oe = (a) => {
|
|
|
84
84
|
});
|
|
85
85
|
if (s >= 0 && r[s]) {
|
|
86
86
|
const i = r[s];
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
w.current.add(i.config.id), i.destroy(), r.splice(s, 1), l && l(r.map(O)), setTimeout(() => {
|
|
88
|
+
w.current.delete(i.config.id);
|
|
89
89
|
}, 100);
|
|
90
90
|
} else
|
|
91
91
|
e.remove(t), e.discardActiveObject(), e.renderAll();
|
|
@@ -93,21 +93,21 @@ const oe = (a) => {
|
|
|
93
93
|
return [...r];
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
R("Delete", q), R("Backspace", q), R("ctrl", () => {
|
|
97
|
+
P(!0);
|
|
98
98
|
}, {
|
|
99
99
|
events: ["keydown"]
|
|
100
|
-
}),
|
|
101
|
-
|
|
100
|
+
}), R("ctrl", () => {
|
|
101
|
+
k || P(!1);
|
|
102
102
|
}, {
|
|
103
103
|
events: ["keyup"]
|
|
104
104
|
}), h(() => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
105
|
+
P(k || !1);
|
|
106
|
+
}, [k]);
|
|
107
107
|
const F = (o) => {
|
|
108
108
|
e && oe(e), v((t) => {
|
|
109
109
|
const n = t.findIndex((r) => r === o);
|
|
110
|
-
return n > -1 && (t.splice(n, 1), l && l(t.map(O)),
|
|
110
|
+
return n > -1 && (t.splice(n, 1), l && l(t.map(O)), T()), [...t];
|
|
111
111
|
});
|
|
112
112
|
}, G = (o) => {
|
|
113
113
|
v((t) => {
|
|
@@ -139,7 +139,7 @@ const oe = (a) => {
|
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
141
|
}, [e, p]);
|
|
142
|
-
const
|
|
142
|
+
const T = () => {
|
|
143
143
|
e && ue(e, (o) => {
|
|
144
144
|
const t = new te({
|
|
145
145
|
id: (c == null ? void 0 : c.id) || o.id,
|
|
@@ -154,7 +154,7 @@ const oe = (a) => {
|
|
|
154
154
|
t.active = !0, v((n) => {
|
|
155
155
|
const r = [...n, t];
|
|
156
156
|
return l && l(r.map(O)), setTimeout(() => {
|
|
157
|
-
e && !b &&
|
|
157
|
+
e && !b && T();
|
|
158
158
|
}, 0), r;
|
|
159
159
|
});
|
|
160
160
|
}, y);
|
|
@@ -188,8 +188,8 @@ const oe = (a) => {
|
|
|
188
188
|
return;
|
|
189
189
|
const I = e.getPointer(t.e);
|
|
190
190
|
if (I.x < i.tl.x || I.x > i.br.x || I.y < i.tl.y || I.y > i.br.y) {
|
|
191
|
-
const
|
|
192
|
-
typeof
|
|
191
|
+
const C = n == null ? void 0 : n._onMouseUp;
|
|
192
|
+
typeof C == "function" && C(t.e);
|
|
193
193
|
}
|
|
194
194
|
};
|
|
195
195
|
return e.on("mouse:move", o), () => {
|
|
@@ -220,7 +220,7 @@ const oe = (a) => {
|
|
|
220
220
|
}), o))) : (e.defaultCursor = "default", e.off("mouse:down:before"), e.off("mouse:up"), e.setCursor("default"), v((o) => (o.forEach((t) => {
|
|
221
221
|
var n;
|
|
222
222
|
return (n = t.object) == null ? void 0 : n.set("evented", !0);
|
|
223
|
-
}), o)),
|
|
223
|
+
}), o)), T()), () => {
|
|
224
224
|
ae();
|
|
225
225
|
};
|
|
226
226
|
}, [e, b]), h(() => {
|
|
@@ -233,7 +233,7 @@ const oe = (a) => {
|
|
|
233
233
|
n.renderLabel();
|
|
234
234
|
});
|
|
235
235
|
}), !b)
|
|
236
|
-
return
|
|
236
|
+
return T(), () => {
|
|
237
237
|
e && (oe(e), e.off("mouse:wheel"));
|
|
238
238
|
};
|
|
239
239
|
}, [e, c, x, b]);
|
|
@@ -250,7 +250,7 @@ const oe = (a) => {
|
|
|
250
250
|
crossOrigin: "anonymous"
|
|
251
251
|
});
|
|
252
252
|
}, [p]), h(() => {
|
|
253
|
-
if (!
|
|
253
|
+
if (!j && e) {
|
|
254
254
|
try {
|
|
255
255
|
e.clear();
|
|
256
256
|
} catch (_) {
|
|
@@ -259,23 +259,23 @@ const oe = (a) => {
|
|
|
259
259
|
}
|
|
260
260
|
if (!d.current || !d.current.parentElement)
|
|
261
261
|
return;
|
|
262
|
-
const o =
|
|
262
|
+
const o = j == null ? void 0 : j.getElement();
|
|
263
263
|
if (!(o != null && o.width) || !(o != null && o.height))
|
|
264
264
|
return;
|
|
265
265
|
const t = o.width / o.height, n = d.current.parentElement.offsetWidth, r = d.current.parentElement.offsetHeight, u = n / o.width, s = r / o.height;
|
|
266
266
|
let i = [n, r];
|
|
267
267
|
u > s ? i = [r * t, r] : i = [n, n / t];
|
|
268
|
-
const I = i[0] / o.width, J = i[1] / o.height,
|
|
269
|
-
U([
|
|
268
|
+
const I = i[0] / o.width, J = i[1] / o.height, C = Math.min(I, J);
|
|
269
|
+
U([C, C]);
|
|
270
270
|
const g = new X.Canvas(d.current, {
|
|
271
271
|
containerClass: "marking-canvas",
|
|
272
272
|
width: n,
|
|
273
273
|
height: r
|
|
274
274
|
});
|
|
275
|
-
if (g.uniScaleKey = "", g.uniformScaling = !1, g == null || g.setZoom(
|
|
276
|
-
const _ = (n - i[0]) /
|
|
275
|
+
if (g.uniScaleKey = "", g.uniformScaling = !1, g == null || g.setZoom(C), g == null || g.renderAll(), g && j) {
|
|
276
|
+
const _ = (n - i[0]) / C / 2, Q = (r - i[1]) / C / 2;
|
|
277
277
|
g.setBackgroundImage(
|
|
278
|
-
|
|
278
|
+
j,
|
|
279
279
|
() => {
|
|
280
280
|
g.renderAll(), re({
|
|
281
281
|
left: _,
|
|
@@ -291,12 +291,12 @@ const oe = (a) => {
|
|
|
291
291
|
}
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
|
-
}, [
|
|
294
|
+
}, [j]), h(() => {
|
|
295
295
|
if (x.length > m.length) {
|
|
296
|
-
if (
|
|
296
|
+
if (w.current.size > 0)
|
|
297
297
|
return;
|
|
298
298
|
x.forEach((t) => {
|
|
299
|
-
const n =
|
|
299
|
+
const n = w.current.has(t.config.id), r = t._isDestroying;
|
|
300
300
|
!m.find((s) => s.id === t.config.id) && !r && !n && t.destroy();
|
|
301
301
|
});
|
|
302
302
|
}
|
|
@@ -311,12 +311,12 @@ const oe = (a) => {
|
|
|
311
311
|
}));
|
|
312
312
|
}, [c, e, b]), h(() => {
|
|
313
313
|
var o;
|
|
314
|
-
if (z && d.current && !
|
|
314
|
+
if (z && d.current && !M) {
|
|
315
315
|
const t = document.createElement("div");
|
|
316
316
|
t.setAttribute("style", "width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: absolute;top: 0;"), (o = d.current.parentElement) == null || o.appendChild(t), le.render(/* @__PURE__ */ f(fe, {}), t), H(t);
|
|
317
317
|
} else
|
|
318
|
-
!z &&
|
|
319
|
-
}, [z, d.current,
|
|
318
|
+
!z && M && (M.remove(), H(null));
|
|
319
|
+
}, [z, d.current, M]), /* @__PURE__ */ V("div", {
|
|
320
320
|
style: {
|
|
321
321
|
width: "100%",
|
|
322
322
|
height: "100%",
|
|
@@ -329,46 +329,54 @@ const oe = (a) => {
|
|
|
329
329
|
children: /* @__PURE__ */ V(de, {
|
|
330
330
|
direction: "vertical",
|
|
331
331
|
size: 16,
|
|
332
|
-
children: [/* @__PURE__ */ f(
|
|
332
|
+
children: [/* @__PURE__ */ f(A, {
|
|
333
333
|
title: "放大-鼠标滚轮前滑",
|
|
334
334
|
placement: "right",
|
|
335
|
-
children: /* @__PURE__ */ f(
|
|
335
|
+
children: /* @__PURE__ */ f(L, {
|
|
336
336
|
icon: /* @__PURE__ */ f(me, {}),
|
|
337
337
|
onClick: () => {
|
|
338
338
|
Y(-100);
|
|
339
339
|
}
|
|
340
340
|
})
|
|
341
|
-
}), /* @__PURE__ */ f(
|
|
341
|
+
}), /* @__PURE__ */ f(A, {
|
|
342
342
|
title: "缩小-鼠标滚轮后滑",
|
|
343
343
|
placement: "right",
|
|
344
|
-
children: /* @__PURE__ */ f(
|
|
344
|
+
children: /* @__PURE__ */ f(L, {
|
|
345
345
|
icon: /* @__PURE__ */ f(ge, {}),
|
|
346
346
|
onClick: () => {
|
|
347
347
|
Y(100);
|
|
348
348
|
}
|
|
349
349
|
})
|
|
350
|
-
}), !
|
|
350
|
+
}), !k && /* @__PURE__ */ f(A, {
|
|
351
351
|
title: "拖动-按住ctrl",
|
|
352
352
|
placement: "right",
|
|
353
|
-
children: /* @__PURE__ */ f(
|
|
354
|
-
disabled:
|
|
353
|
+
children: /* @__PURE__ */ f(L, {
|
|
354
|
+
disabled: k,
|
|
355
355
|
icon: /* @__PURE__ */ f(he, {}),
|
|
356
356
|
className: b ? "active" : "",
|
|
357
357
|
onClick: () => {
|
|
358
|
-
|
|
358
|
+
P(!b);
|
|
359
359
|
}
|
|
360
360
|
})
|
|
361
|
-
}), !
|
|
361
|
+
}), !k && /* @__PURE__ */ f(A, {
|
|
362
362
|
title: "一键清空全部标注",
|
|
363
363
|
placement: "right",
|
|
364
|
-
children: /* @__PURE__ */ f(
|
|
364
|
+
children: /* @__PURE__ */ f(L, {
|
|
365
365
|
icon: /* @__PURE__ */ f(pe, {}),
|
|
366
366
|
disabled: !(x != null && x.length),
|
|
367
367
|
onClick: () => {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
368
|
+
if (!e)
|
|
369
|
+
return;
|
|
370
|
+
v((t) => (t.forEach((n) => {
|
|
371
|
+
w.current.add(n.config.id);
|
|
372
|
+
}), t.forEach((n) => {
|
|
373
|
+
n.destroy();
|
|
374
|
+
}), setTimeout(() => {
|
|
375
|
+
w.current.clear();
|
|
376
|
+
}, 100), [])), e.discardActiveObject(), e.getObjects().forEach((t) => {
|
|
377
|
+
t !== e.backgroundImage && e.remove(t);
|
|
378
|
+
}), e.renderAll(), l && l([]), setTimeout(() => {
|
|
379
|
+
e && !b && T();
|
|
372
380
|
}, 0);
|
|
373
381
|
}
|
|
374
382
|
})
|
|
@@ -391,5 +399,5 @@ const oe = (a) => {
|
|
|
391
399
|
});
|
|
392
400
|
};
|
|
393
401
|
export {
|
|
394
|
-
|
|
402
|
+
Ae as default
|
|
395
403
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var E = (D, c, r) => new Promise((V, P) => {
|
|
2
2
|
var O = (d) => {
|
|
3
3
|
try {
|
|
4
4
|
p(r.next(d));
|
|
@@ -12,11 +12,11 @@ var w = (D, o, r) => new Promise((V, P) => {
|
|
|
12
12
|
P(y);
|
|
13
13
|
}
|
|
14
14
|
}, p = (d) => d.done ? V(d.value) : Promise.resolve(d.value).then(O, a);
|
|
15
|
-
p((r = r.apply(D,
|
|
15
|
+
p((r = r.apply(D, c)).next());
|
|
16
16
|
});
|
|
17
17
|
import { jsx as n, jsxs as N } from "react/jsx-runtime";
|
|
18
18
|
import { useState as v, useContext as ee, useEffect as k } from "react";
|
|
19
|
-
import { Form as S, Modal as te, Button as C, Space as
|
|
19
|
+
import { Form as S, Modal as te, Button as C, Space as z, Spin as le, Select as A, Tooltip as G, Tag as ae, Radio as q } from "antd";
|
|
20
20
|
import { PreLabelTaskStatus as u } from "@glodon-aiot/apis";
|
|
21
21
|
import "./style.less.mjs";
|
|
22
22
|
import se from "../../DatasetContext/index.mjs";
|
|
@@ -24,35 +24,35 @@ import { detectionPreService as ne, ocrPreService as re } from "../../constant.m
|
|
|
24
24
|
import ie from "../PreLableTable/index.mjs";
|
|
25
25
|
const fe = (D) => {
|
|
26
26
|
const {
|
|
27
|
-
datasetId:
|
|
27
|
+
datasetId: c,
|
|
28
28
|
versionId: r,
|
|
29
29
|
isVisible: V,
|
|
30
30
|
onClose: P,
|
|
31
31
|
setIsTaskChange: O,
|
|
32
32
|
record: a,
|
|
33
33
|
datasetType: p
|
|
34
|
-
} = D, [d, y] = v([]), [
|
|
34
|
+
} = D, [d, y] = v([]), [B, _] = v([]), [h] = S.useForm(), [l, L] = v(), [I, H] = v(), [f, x] = v(""), m = S.useWatch("service", h), [J, M] = v(!1), [W, T] = v(null), {
|
|
35
35
|
services: {
|
|
36
36
|
cvforceDatahub: b,
|
|
37
37
|
cvforceModelService: g
|
|
38
38
|
}
|
|
39
|
-
} = ee(se),
|
|
39
|
+
} = ee(se), K = p === "detection" ? ne : re, F = () => {
|
|
40
40
|
P();
|
|
41
41
|
};
|
|
42
42
|
k(() => {
|
|
43
|
-
|
|
43
|
+
X(), Y();
|
|
44
44
|
}, []), k(() => {
|
|
45
|
-
a &&
|
|
45
|
+
a && L(a), a != null && a.lastTaskResult && H(JSON.parse(a == null ? void 0 : a.lastTaskResult));
|
|
46
46
|
}, [a]), k(() => {
|
|
47
|
-
var e, t, s, i,
|
|
47
|
+
var e, t, s, i, o;
|
|
48
48
|
h.setFieldsValue({
|
|
49
49
|
service: {
|
|
50
50
|
value: (e = l == null ? void 0 : l.params) == null ? void 0 : e.serviceId,
|
|
51
51
|
label: (t = l == null ? void 0 : l.params) == null ? void 0 : t.serviceName
|
|
52
52
|
},
|
|
53
53
|
data: ((s = l == null ? void 0 : l.params) == null ? void 0 : s.data) || "nolabel",
|
|
54
|
-
confidence: (
|
|
55
|
-
}),
|
|
54
|
+
confidence: (o = (i = l == null ? void 0 : l.params) == null ? void 0 : i.confidence) != null ? o : 0.6
|
|
55
|
+
}), x((l == null ? void 0 : l.state) || "PENDING"), console.log(l, "============");
|
|
56
56
|
}, [l]), k(() => {
|
|
57
57
|
if (!m || !m.value) {
|
|
58
58
|
T(null);
|
|
@@ -62,72 +62,72 @@ const fe = (D) => {
|
|
|
62
62
|
T(null);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
Promise.all([
|
|
65
|
+
Promise.all([Q(), U(m.value)]).then(([e, t]) => {
|
|
66
66
|
if (t && Array.isArray(t) && t.length > 0 ? T(!0) : T(!1), !e)
|
|
67
67
|
return;
|
|
68
68
|
const s = e.filter((i) => {
|
|
69
|
-
if (!(t != null && t.find((
|
|
69
|
+
if (!(t != null && t.find((o) => o === i)))
|
|
70
70
|
return i;
|
|
71
71
|
});
|
|
72
|
-
|
|
72
|
+
M(!!s.length), h.validateFields(["labels"]);
|
|
73
73
|
}).catch(() => {
|
|
74
74
|
T(!1), h.validateFields(["labels"]);
|
|
75
75
|
});
|
|
76
76
|
}, [m]);
|
|
77
|
-
const
|
|
78
|
-
if (!(!
|
|
79
|
-
return b.getDatasetsIdVersionsVidLabelcount(
|
|
80
|
-
},
|
|
77
|
+
const Q = () => {
|
|
78
|
+
if (!(!c || !r || !b))
|
|
79
|
+
return b.getDatasetsIdVersionsVidLabelcount(c, r).then((e) => e.filter((s) => s.label !== "nocode").map((s) => s.label));
|
|
80
|
+
}, U = (e) => g == null ? void 0 : g.getModelServiceById(e).then((t) => {
|
|
81
81
|
const s = t.deployOptions.confidence;
|
|
82
|
-
return s == null ? void 0 : s.map((
|
|
83
|
-
}),
|
|
82
|
+
return s == null ? void 0 : s.map((o) => o.label);
|
|
83
|
+
}), X = () => {
|
|
84
84
|
g == null || g.openModelServices({
|
|
85
|
-
signName:
|
|
85
|
+
signName: K,
|
|
86
86
|
state: "Running"
|
|
87
87
|
}).then((e) => {
|
|
88
88
|
const s = (e || []).map((i) => {
|
|
89
|
-
var
|
|
89
|
+
var o;
|
|
90
90
|
return {
|
|
91
91
|
label: i.name,
|
|
92
92
|
value: i.id,
|
|
93
|
-
confidence: ((
|
|
93
|
+
confidence: ((o = i.deployOptions.confidence) == null ? void 0 : o.map((w) => w.label)) || []
|
|
94
94
|
};
|
|
95
95
|
});
|
|
96
96
|
y(s);
|
|
97
97
|
});
|
|
98
|
-
},
|
|
99
|
-
!
|
|
98
|
+
}, Y = () => {
|
|
99
|
+
!c || !r || !b || b.getDatasetsIdVersionsVidSamples(c, r, {
|
|
100
100
|
labels: "nocode",
|
|
101
101
|
pageNo: 1,
|
|
102
102
|
pageSize: 1
|
|
103
103
|
}).then((e) => {
|
|
104
104
|
const t = e.recordList || [];
|
|
105
|
-
|
|
105
|
+
_([{
|
|
106
106
|
label: "全部未标注数据",
|
|
107
107
|
value: "nolabel",
|
|
108
108
|
disabled: !t.length
|
|
109
109
|
}]);
|
|
110
110
|
});
|
|
111
|
-
},
|
|
112
|
-
!
|
|
113
|
-
O((t) => !t),
|
|
111
|
+
}, R = () => {
|
|
112
|
+
!c || !r || !(l != null && l.taskId) || !b || b.delPreLabelTask(c, r, l.taskId).then((e) => {
|
|
113
|
+
O((t) => !t), x("PENDING");
|
|
114
114
|
});
|
|
115
|
-
}, Y = () => {
|
|
116
|
-
x();
|
|
117
115
|
}, Z = () => {
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
R();
|
|
117
|
+
}, $ = () => {
|
|
118
|
+
R(), h.resetFields(), L(void 0);
|
|
119
|
+
}, j = (e) => {
|
|
120
|
+
var s, i;
|
|
121
|
+
if (!c || !r || !e.service || !b)
|
|
122
122
|
return;
|
|
123
123
|
const t = {
|
|
124
124
|
serviceId: e.service.value,
|
|
125
|
-
serviceName: (s = d.find((
|
|
125
|
+
serviceName: (s = d.find((o) => o.value === e.service.value)) == null ? void 0 : s.label,
|
|
126
126
|
data: "nolabel",
|
|
127
|
-
confidence: e.confidence
|
|
127
|
+
confidence: (i = e.confidence) != null ? i : 0.6
|
|
128
128
|
};
|
|
129
|
-
b.postPreLabelTask(
|
|
130
|
-
O((
|
|
129
|
+
b.postPreLabelTask(c, r, t).then((o) => {
|
|
130
|
+
O((w) => !w);
|
|
131
131
|
});
|
|
132
132
|
};
|
|
133
133
|
return /* @__PURE__ */ n(te, {
|
|
@@ -147,16 +147,16 @@ const fe = (D) => {
|
|
|
147
147
|
type: "primary",
|
|
148
148
|
htmlType: "submit",
|
|
149
149
|
form: "preLabelForm",
|
|
150
|
-
onClick:
|
|
150
|
+
onClick: j,
|
|
151
151
|
children: "确定"
|
|
152
152
|
}, "confirm")] : (a == null ? void 0 : a.state) === u.Started ? [/* @__PURE__ */ n(C, {
|
|
153
|
-
onClick:
|
|
153
|
+
onClick: Z,
|
|
154
154
|
children: "终止"
|
|
155
155
|
}, "abort"), /* @__PURE__ */ n(C, {
|
|
156
156
|
onClick: F,
|
|
157
157
|
children: "返回"
|
|
158
158
|
}, "cancel")] : [/* @__PURE__ */ n(C, {
|
|
159
|
-
onClick:
|
|
159
|
+
onClick: $,
|
|
160
160
|
children: "新建任务"
|
|
161
161
|
}, "abort"), /* @__PURE__ */ n(C, {
|
|
162
162
|
onClick: F,
|
|
@@ -166,7 +166,7 @@ const fe = (D) => {
|
|
|
166
166
|
style: {
|
|
167
167
|
padding: "80px 0"
|
|
168
168
|
},
|
|
169
|
-
children: /* @__PURE__ */ N(
|
|
169
|
+
children: /* @__PURE__ */ N(z, {
|
|
170
170
|
className: "mark-status",
|
|
171
171
|
direction: "vertical",
|
|
172
172
|
align: "center",
|
|
@@ -174,22 +174,22 @@ const fe = (D) => {
|
|
|
174
174
|
width: "100%"
|
|
175
175
|
},
|
|
176
176
|
size: 24,
|
|
177
|
-
children: [f === u.Started && /* @__PURE__ */ n(
|
|
177
|
+
children: [f === u.Started && /* @__PURE__ */ n(le, {
|
|
178
178
|
size: "default"
|
|
179
|
-
}), (f === u.Started || f === u.Success) && /* @__PURE__ */ N(
|
|
179
|
+
}), (f === u.Started || f === u.Success) && /* @__PURE__ */ N(z, {
|
|
180
180
|
style: {
|
|
181
181
|
marginLeft: 14
|
|
182
182
|
},
|
|
183
183
|
size: 0,
|
|
184
184
|
children: [/* @__PURE__ */ N("span", {
|
|
185
|
-
children: ["已标注数据:",
|
|
185
|
+
children: ["已标注数据:", I.completeCount || 0, " 张,"]
|
|
186
186
|
}), /* @__PURE__ */ N("span", {
|
|
187
|
-
children: ["共计:",
|
|
187
|
+
children: ["共计:", I.allCount || 0, " 张"]
|
|
188
188
|
})]
|
|
189
189
|
})]
|
|
190
190
|
})
|
|
191
191
|
}) : /* @__PURE__ */ N(S, {
|
|
192
|
-
onFinish:
|
|
192
|
+
onFinish: j,
|
|
193
193
|
name: "preLabelForm",
|
|
194
194
|
labelAlign: "right",
|
|
195
195
|
labelCol: {
|
|
@@ -204,20 +204,20 @@ const fe = (D) => {
|
|
|
204
204
|
rules: [{
|
|
205
205
|
required: !0
|
|
206
206
|
}, {
|
|
207
|
-
validator: (e, t) =>
|
|
207
|
+
validator: (e, t) => E(void 0, null, function* () {
|
|
208
208
|
const s = h.getFieldValue("service");
|
|
209
209
|
if (!s.value || !s.label)
|
|
210
210
|
return Promise.reject(new Error("请选择服务"));
|
|
211
211
|
})
|
|
212
212
|
}],
|
|
213
|
-
children: /* @__PURE__ */ n(
|
|
213
|
+
children: /* @__PURE__ */ n(A, {
|
|
214
214
|
labelInValue: !0,
|
|
215
215
|
disabled: (a == null ? void 0 : a.state) === u.Started,
|
|
216
|
-
children: d.map((e) => /* @__PURE__ */ n(
|
|
216
|
+
children: d.map((e) => /* @__PURE__ */ n(A.Option, {
|
|
217
217
|
value: e.value,
|
|
218
218
|
disabled: e.disabled,
|
|
219
|
-
children: /* @__PURE__ */ n(
|
|
220
|
-
title: e.confidence.length ? e.confidence.map((t) => /* @__PURE__ */ n(
|
|
219
|
+
children: /* @__PURE__ */ n(G, {
|
|
220
|
+
title: e.confidence.length ? e.confidence.map((t) => /* @__PURE__ */ n(ae, {
|
|
221
221
|
children: t
|
|
222
222
|
}, t)) : null,
|
|
223
223
|
overlayClassName: "service-tag-tooltip",
|
|
@@ -229,15 +229,15 @@ const fe = (D) => {
|
|
|
229
229
|
label: "标签",
|
|
230
230
|
name: "labels",
|
|
231
231
|
rules: [{
|
|
232
|
-
validator: (e, t) =>
|
|
233
|
-
if (p === "detection" && (m != null && m.value) &&
|
|
232
|
+
validator: (e, t) => E(void 0, null, function* () {
|
|
233
|
+
if (p === "detection" && (m != null && m.value) && W === !1)
|
|
234
234
|
return Promise.reject(new Error("未获取相关信息"));
|
|
235
|
-
if (
|
|
235
|
+
if (J && p === "detection")
|
|
236
236
|
return Promise.reject(new Error("所选服务与当前数据集标签不符"));
|
|
237
237
|
})
|
|
238
238
|
}],
|
|
239
239
|
children: /* @__PURE__ */ n(ie, {
|
|
240
|
-
datasetId:
|
|
240
|
+
datasetId: c,
|
|
241
241
|
service: m
|
|
242
242
|
})
|
|
243
243
|
}), /* @__PURE__ */ n(S.Item, {
|
|
@@ -248,11 +248,11 @@ const fe = (D) => {
|
|
|
248
248
|
message: "请选择数据"
|
|
249
249
|
}],
|
|
250
250
|
initialValue: "nolabel",
|
|
251
|
-
children: /* @__PURE__ */ n(
|
|
251
|
+
children: /* @__PURE__ */ n(q.Group, {
|
|
252
252
|
disabled: (a == null ? void 0 : a.state) === u.Started,
|
|
253
|
-
children:
|
|
253
|
+
children: B.map((e) => /* @__PURE__ */ n(G, {
|
|
254
254
|
title: e.disabled ? "该数据集下不存在未标注的数据" : "当前数据集版本下所有未标注的数据",
|
|
255
|
-
children: /* @__PURE__ */ n(
|
|
255
|
+
children: /* @__PURE__ */ n(q, {
|
|
256
256
|
value: e.value,
|
|
257
257
|
disabled: e.disabled,
|
|
258
258
|
children: e.label
|