@glodon-aiot/dataset-annotation 3.16.0-alpha.35 → 3.16.0-alpha.37

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,14 +2,14 @@ var _ = Object.defineProperty, $ = Object.defineProperties;
2
2
  var H = Object.getOwnPropertyDescriptors;
3
3
  var P = Object.getOwnPropertySymbols;
4
4
  var I = Object.prototype.hasOwnProperty, L = Object.prototype.propertyIsEnumerable;
5
- var R = (i, o, s) => o in i ? _(i, o, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[o] = s, g = (i, o) => {
6
- for (var s in o || (o = {}))
7
- I.call(o, s) && R(i, s, o[s]);
5
+ var R = (i, r, s) => r in i ? _(i, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[r] = s, g = (i, r) => {
6
+ for (var s in r || (r = {}))
7
+ I.call(r, s) && R(i, s, r[s]);
8
8
  if (P)
9
- for (var s of P(o))
10
- L.call(o, s) && R(i, s, o[s]);
9
+ for (var s of P(r))
10
+ L.call(r, s) && R(i, s, r[s]);
11
11
  return i;
12
- }, N = (i, o) => $(i, H(o));
12
+ }, N = (i, r) => $(i, H(r));
13
13
  import { jsxs as h, jsx as a } from "react/jsx-runtime";
14
14
  import { Row as B, Button as U, Input as ee, Space as te, Empty as ie, Modal as le } from "antd";
15
15
  import { useState as m, useContext as re, useEffect as w } from "react";
@@ -22,7 +22,7 @@ import { tagColors as k } from "../../../../utils/index.mjs";
22
22
  import se from "../../../Iconfont/index.mjs";
23
23
  const Ae = ({
24
24
  datasetId: i,
25
- data: o,
25
+ data: r,
26
26
  selected: s = [],
27
27
  showZero: ce = !0,
28
28
  shortcut: F = !1,
@@ -33,7 +33,7 @@ const Ae = ({
33
33
  isPreLabel: v = !1,
34
34
  settingHide: C = !1
35
35
  }) => {
36
- const [n, A] = m([]), [ae, T] = m(!1), [r, p] = m([]), [j, z] = m(""), [x, S] = m(null), [D, J] = m(!1), {
36
+ const [n, A] = m([]), [ae, T] = m(!1), [o, p] = m([]), [j, z] = m(""), [x, S] = m(null), [D, J] = m(!1), {
37
37
  services: {
38
38
  cvforceDatahub: d
39
39
  },
@@ -44,15 +44,15 @@ const Ae = ({
44
44
  }
45
45
  } = re(ne);
46
46
  w(() => {
47
- r.length && A(s.map((e) => r.find((t) => t.id === e.id)));
48
- }, [s, r]), w(() => {
47
+ o.length && A(s.map((e) => o.find((t) => t.id === e.id)));
48
+ }, [s, o]), w(() => {
49
49
  i && E();
50
- }, [i]), w(() => {
51
- !i && o && p(o.map((e) => N(g({}, e), {
50
+ }, [i, r]), w(() => {
51
+ !i && r && p(r.map((e) => N(g({}, e), {
52
52
  createdAt: 0,
53
53
  updatedAt: 0
54
54
  })));
55
- }, [i, o]);
55
+ }, [i, r]);
56
56
  const E = () => {
57
57
  !i || !d || (T(!0), d.listLabels(i, {
58
58
  pageNo: 1,
@@ -67,13 +67,13 @@ const Ae = ({
67
67
  label: e
68
68
  }]
69
69
  }).then((t) => {
70
- p([...r, {
70
+ p([...o, {
71
71
  label: e,
72
72
  id: t[0],
73
- color: k[r.length % 40],
73
+ color: k[o.length % 40],
74
74
  createdAt: Date.now(),
75
75
  updatedAt: Date.now()
76
- }]), S(null), u && u([...r]);
76
+ }]), S(null), u && u([...o]);
77
77
  }).then(() => !0).catch(() => !1), Q = (e) => {
78
78
  let t = [];
79
79
  G === "multiple" ? n != null && n.some((l) => l.id === e.id) ? t = n == null ? void 0 : n.filter((l) => l.id !== e.id) : t = [...n, e] : n != null && n.some((l) => l.id === e.id) ? t = [] : t = [e], A(t), M && M(t);
@@ -82,8 +82,8 @@ const Ae = ({
82
82
  }, W = (e) => {
83
83
  if (!i || !d)
84
84
  return Promise.resolve(!1);
85
- const t = r.findIndex((l) => l.id === e.id);
86
- return d.patchLabel(i, e.id, e).then(() => (t < 0 || (r[t] = e, p([...r]), u && u([...r])), !0)).catch(() => !1);
85
+ const t = o.findIndex((l) => l.id === e.id);
86
+ return d.patchLabel(i, e.id, e).then(() => (t < 0 || (o[t] = e, p([...o]), u && u([...o])), !0)).catch(() => !1);
87
87
  }, X = (e) => {
88
88
  le.confirm({
89
89
  title: "确认要删除当前标签吗?",
@@ -91,13 +91,13 @@ const Ae = ({
91
91
  onOk: () => {
92
92
  if (!i || !d)
93
93
  return;
94
- const t = r.findIndex((c) => c.id === e), l = n.findIndex((c) => c.id === e);
94
+ const t = o.findIndex((c) => c.id === e), l = n.findIndex((c) => c.id === e);
95
95
  return d.deleteLabel(i, e).then(() => {
96
- l > -1 && (n.splice(l, 1), A([...n])), r.splice(t, 1), p([...r]), u && u([...r]), E();
96
+ l > -1 && (n.splice(l, 1), A([...n])), o.splice(t, 1), p([...o]), u && u([...o]), E();
97
97
  });
98
98
  }
99
99
  });
100
- }, b = (r == null ? void 0 : r.filter((e) => !j || e.label.includes(j))) || [];
100
+ }, b = (o == null ? void 0 : o.filter((e) => !j || e.label.includes(j))) || [];
101
101
  return /* @__PURE__ */ h("div", {
102
102
  className: "label-list-wrap",
103
103
  children: [/* @__PURE__ */ h(B, {
@@ -133,7 +133,7 @@ const Ae = ({
133
133
  disabled: x !== null || v,
134
134
  onClick: () => {
135
135
  S({
136
- color: k[r.length % 40],
136
+ color: k[o.length % 40],
137
137
  label: ""
138
138
  });
139
139
  }
@@ -173,7 +173,7 @@ const Ae = ({
173
173
  extra: F ? t < 10 ? /* @__PURE__ */ h("span", {
174
174
  className: "shortcut",
175
175
  children: ["快捷键", t]
176
- }) : null : ((l = o.find((c) => c.label === e.label)) == null ? void 0 : l.count) || 0,
176
+ }) : null : ((l = r.find((c) => c.label === e.label)) == null ? void 0 : l.count) || 0,
177
177
  label: e.label,
178
178
  color: e.color,
179
179
  onClick: () => {
@@ -604,7 +604,8 @@ const Pn = (I) => {
604
604
  current: 1
605
605
  })));
606
606
  },
607
- loadVersionData: Ee
607
+ loadVersionData: Ee,
608
+ markType: x.markType
608
609
  })]
609
610
  })
610
611
  }),
@@ -1,11 +1,21 @@
1
- import { MB as e } from "../../constant.mjs";
2
- const g = {
3
- maxImageSize: 14 * e,
1
+ var j = Object.defineProperty, l = Object.defineProperties;
2
+ var s = Object.getOwnPropertyDescriptors;
3
+ var i = Object.getOwnPropertySymbols;
4
+ var r = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
5
+ var n = (e, g, p) => g in e ? j(e, g, { enumerable: !0, configurable: !0, writable: !0, value: p }) : e[g] = p, m = (e, g) => {
6
+ for (var p in g || (g = {}))
7
+ r.call(g, p) && n(e, p, g[p]);
8
+ if (i)
9
+ for (var p of i(g))
10
+ d.call(g, p) && n(e, p, g[p]);
11
+ return e;
12
+ }, a = (e, g) => l(e, s(g));
13
+ import { MB as o } from "../../constant.mjs";
14
+ const t = {
15
+ maxImageSize: 14 * o,
4
16
  imageMimeTypes: ["image/jpeg", "image/jpg", "image/png", "image/bmp"],
5
17
  imageAccept: "image/png, image/jpeg, image/jpg, image/bmp",
6
18
  imageFormatsText: "jpg、png 、jpeg 、bmp",
7
- labeledExampleKey: "FileImportType.Pro.LabelType.Unlabeled",
8
- unlabeledExampleKey: "FileImportType.Pro.LabelType.Labeled",
9
19
  labelFormat: "json",
10
20
  zipUploadTexts: {
11
21
  labeled: {
@@ -15,16 +25,12 @@ const g = {
15
25
  description: ["压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"]
16
26
  }
17
27
  }
18
- }, a = {
19
- maxImageSize: 10 * e,
28
+ }, c = {
29
+ maxImageSize: 10 * o,
20
30
  // VLM 可能是 10M(可根据实际需求调整)
21
31
  imageMimeTypes: ["image/jpeg", "image/jpg", "image/png"],
22
32
  imageAccept: "image/png, image/jpeg, image/jpg",
23
33
  imageFormatsText: "jpg、png 、jpeg",
24
- labeledExampleKey: "FileImportType.Pro.LabelType.Unlabeled",
25
- // 暂时使用默认,如果不同可后续修改
26
- unlabeledExampleKey: "FileImportType.Pro.LabelType.Labeled",
27
- // 暂时使用默认,如果不同可后续修改
28
34
  labelFormat: "jsonl",
29
35
  // VLM 使用 jsonl 格式
30
36
  zipUploadTexts: {
@@ -41,7 +47,16 @@ const g = {
41
47
  ]
42
48
  }
43
49
  }
44
- }, l = (p) => p === "vlm" ? a : g;
50
+ }, b = a(m({}, t), {
51
+ zipUploadTexts: {
52
+ labeled: {
53
+ description: ["压缩包内每张图片(jpg、png 、jpeg 、bmp格式)需要对应一个json文件,名称需一致,位置处在一级目录下;", "json文件须符合labelme标注规范,仅支持矩形框,必须包含标签、标签类型和两点坐标,格式可参考样例。"]
54
+ },
55
+ unlabeled: {
56
+ description: ["压缩包内图片格式要求为:图片类型为jpg/png/bmp/jpeg,单张图片不超过14M;"]
57
+ }
58
+ }
59
+ }), u = (e) => e === "vlm" ? c : e === "detection" ? b : t;
45
60
  export {
46
- l as getImportConfig
61
+ u as getImportConfig
47
62
  };