@glodon-aiot/dataset-annotation 3.14.0-alpha.32 → 3.14.0-alpha.34

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.
Files changed (26) hide show
  1. package/dist/es/components/VLMAnnotation/RegionItem.mjs +1 -1
  2. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.mjs +193 -0
  3. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +300 -237
  4. package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +158 -56
  5. package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +424 -397
  6. package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/AIErrorTooltip.less.mjs +4 -0
  7. package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/index.mjs +24 -0
  8. package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +1 -1
  9. package/dist/es/components/VLMAnnotation/constants.mjs +1 -1
  10. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +217 -167
  11. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +114 -122
  12. package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +445 -0
  13. package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +249 -113
  14. package/dist/es/components/VLMAnnotationDetail/index.mjs +219 -213
  15. package/dist/es/index.mjs +1 -1
  16. package/dist/lib/index.js +4 -4
  17. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.d.ts +16 -0
  18. package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +2 -1
  19. package/dist/src/components/VLMAnnotation/components/AIErrorTooltip/index.d.ts +8 -0
  20. package/dist/src/components/VLMAnnotation/constants.d.ts +2 -2
  21. package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +1 -0
  22. package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +21 -0
  23. package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +11 -2
  24. package/package.json +2 -2
  25. package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +0 -455
  26. /package/dist/es/components/VLMAnnotationDetail/{MarkVLMBoxModal → VLMDetail}/style.less.mjs +0 -0
@@ -1,141 +1,131 @@
1
- var D = (f, u, i) => new Promise((m, a) => {
2
- var h = (n) => {
1
+ var R = (h, v, t) => new Promise((m, n) => {
2
+ var f = (a) => {
3
3
  try {
4
- d(i.next(n));
5
- } catch (o) {
6
- a(o);
4
+ c(t.next(a));
5
+ } catch (d) {
6
+ n(d);
7
7
  }
8
- }, l = (n) => {
8
+ }, o = (a) => {
9
9
  try {
10
- d(i.throw(n));
11
- } catch (o) {
12
- a(o);
10
+ c(t.throw(a));
11
+ } catch (d) {
12
+ n(d);
13
13
  }
14
- }, d = (n) => n.done ? m(n.value) : Promise.resolve(n.value).then(h, l);
15
- d((i = i.apply(f, u)).next());
14
+ }, c = (a) => a.done ? m(a.value) : Promise.resolve(a.value).then(f, o);
15
+ c((t = t.apply(h, v)).next());
16
16
  });
17
- import { jsx as e, jsxs as r, Fragment as b } from "react/jsx-runtime";
18
- import { forwardRef as z, useState as g, useRef as O, useContext as _, useImperativeHandle as j, useEffect as S } from "react";
17
+ import { jsx as e, jsxs as l } from "react/jsx-runtime";
18
+ import { forwardRef as L, useState as u, useRef as k, useContext as O, useImperativeHandle as _, useEffect as S } from "react";
19
19
  import "./style.less.mjs";
20
- import { Row as E, Col as G, Table as K, Spin as B, Input as R } from "antd";
21
- import F from "./QAGenerationConfig.mjs";
22
- import H from "../../../Iconfont/index.mjs";
23
- import { LoadingOutlined as V } from "@ant-design/icons";
24
- import J from "../../../../DatasetContext/index.mjs";
25
- const M = z((f, u) => {
26
- var w, A;
20
+ import { Table as b, Spin as j, Input as q } from "antd";
21
+ import E from "./QAGenerationConfig.mjs";
22
+ import K from "../../../Iconfont/index.mjs";
23
+ import { LoadingOutlined as H } from "@ant-design/icons";
24
+ import V from "../../../../DatasetContext/index.mjs";
25
+ const B = L((h, v) => {
27
26
  const {
28
- sample: i,
27
+ sample: t,
29
28
  visionId: m,
30
- labels: a,
31
- datasetId: h
32
- } = f, [l, d] = g([]), [n, o] = g([]), [L, p] = g(!1), v = O(null), {
29
+ labels: n,
30
+ datasetId: f
31
+ } = h, [o, c] = u([]), [a, d] = u([]), [C, p] = u(!1), [G, T] = u(0), N = k(null), {
33
32
  services: {
34
- cvforceDatahub: N
33
+ cvforceDatahub: g
35
34
  }
36
- } = _(J);
37
- j(u, () => ({
38
- checkDirtyAndConfirm: () => D(void 0, null, function* () {
39
- return v.current ? yield v.current.checkDirtyAndConfirm() : !0;
35
+ } = O(V);
36
+ _(v, () => ({
37
+ checkDirtyAndConfirm: () => R(void 0, null, function* () {
38
+ return N.current ? yield N.current.checkDirtyAndConfirm() : !0;
40
39
  })
41
40
  })), S(() => {
42
- const t = (i == null ? void 0 : i.labels) || [];
43
- if (t.length && (a != null && a.length)) {
44
- const s = t.map((c, I) => {
45
- var Q, q;
46
- const x = {
47
- id: (Q = c.id) != null ? Q : String(I),
48
- regionId: (q = c.id) != null ? q : String(I),
49
- shape: c.shape
50
- }, T = c.content || {};
51
- return a.forEach((C) => {
52
- x[C.id] = T[C.id] || "-";
53
- }), x;
41
+ const i = (t == null ? void 0 : t.labels) || [];
42
+ if (i.length && (n != null && n.length)) {
43
+ const s = i.map((r, y) => {
44
+ var A, w;
45
+ const I = {
46
+ id: (A = r.id) != null ? A : String(y),
47
+ regionId: (w = r.id) != null ? w : String(y),
48
+ shape: r.shape
49
+ }, D = r.content || {};
50
+ return n.forEach((Q) => {
51
+ I[Q.id] = D[Q.id] || "-";
52
+ }), I;
54
53
  });
55
- d(s);
54
+ c(s);
56
55
  } else
57
- d([]), o([]);
58
- }, [i == null ? void 0 : i.labels, a]), S(() => {
59
- l.length && y();
60
- }, [l]);
61
- const k = [{
56
+ c([]), d([]);
57
+ }, [t == null ? void 0 : t.labels, n]), S(() => {
58
+ o.length && x();
59
+ }, [o]);
60
+ const z = [{
62
61
  title: "序号",
63
62
  key: "index",
64
- width: 80,
63
+ width: 60,
65
64
  fixed: "left",
66
- render: (t, s, c) => c + 1
67
- }, ...(a || []).map((t) => ({
68
- title: t.name,
69
- dataIndex: t.id,
70
- key: t.id,
65
+ render: (i, s, r) => r + 1
66
+ }, ...(n || []).map((i) => ({
67
+ title: i.name,
68
+ dataIndex: i.id,
69
+ key: i.id,
71
70
  width: 150,
72
71
  render: (s) => /* @__PURE__ */ e("span", {
73
72
  children: s || "-"
74
73
  })
75
- }))], y = () => {
76
- p(!0), !(!h || !m || !(i != null && i.id)) && (N == null || N.postGenerateVlmKieQa(h, m, {
77
- sampleIds: [i.id]
78
- }).then((t) => {
79
- console.log("QA生成结果:", t), o(t), p(!1);
80
- }).catch((t) => {
81
- console.error("QA生成失败:", t), p(!1);
74
+ }))], x = () => {
75
+ p(!0), !(!f || !m || !(t != null && t.id)) && (g == null || g.postGenerateVlmKieQa(f, m, {
76
+ sampleIds: [t.id]
77
+ }).then((i) => {
78
+ console.log("QA生成结果:", i), d(i), p(!1);
79
+ }).catch((i) => {
80
+ console.error("QA生成失败:", i), p(!1);
82
81
  }));
83
82
  };
84
- return /* @__PURE__ */ r("div", {
83
+ return /* @__PURE__ */ l("div", {
85
84
  className: "qa-detail",
86
- children: [/* @__PURE__ */ r(E, {
87
- className: "infos",
88
- gutter: 48,
89
- children: [/* @__PURE__ */ e(G, {
90
- span: 12,
91
- children: /* @__PURE__ */ r("div", {
92
- className: "info-item",
93
- children: [/* @__PURE__ */ e("div", {
94
- className: "info-item-header",
95
- children: /* @__PURE__ */ e("div", {
96
- className: "info-item-title",
97
- children: "标注信息预览"
98
- })
99
- }), /* @__PURE__ */ e("div", {
100
- className: "info-item-content table-wrapper",
101
- children: /* @__PURE__ */ e(K, {
102
- columns: k,
103
- dataSource: l,
104
- rowKey: "id",
105
- pagination: !1,
106
- size: "small",
107
- scroll: {
108
- y: "100%"
109
- }
110
- })
111
- })]
85
+ children: [/* @__PURE__ */ l("div", {
86
+ className: "info-item infos",
87
+ children: [/* @__PURE__ */ e("div", {
88
+ className: "info-item-header",
89
+ children: /* @__PURE__ */ e("div", {
90
+ className: "info-item-title",
91
+ children: "标注信息预览"
112
92
  })
113
- }), /* @__PURE__ */ e(G, {
114
- span: 12,
115
- children: /* @__PURE__ */ e(F, {
116
- ref: v,
117
- datasetId: h,
118
- visionId: m,
119
- afterChangeTemplates: () => {
120
- l.length && y();
93
+ }), /* @__PURE__ */ e("div", {
94
+ className: "info-item-content table-wrapper",
95
+ children: /* @__PURE__ */ e(b, {
96
+ columns: z,
97
+ dataSource: o,
98
+ rowKey: "id",
99
+ pagination: !1,
100
+ size: "small",
101
+ scroll: {
102
+ y: 235
121
103
  }
122
104
  })
123
105
  })]
124
- }), /* @__PURE__ */ r("div", {
106
+ }), /* @__PURE__ */ e(E, {
107
+ ref: N,
108
+ datasetId: f,
109
+ visionId: m,
110
+ afterChangeTemplates: () => {
111
+ o.length && x();
112
+ },
113
+ onActiveIndexChange: T
114
+ }), /* @__PURE__ */ l("div", {
125
115
  className: "qa-result",
126
- children: [/* @__PURE__ */ r("div", {
116
+ children: [/* @__PURE__ */ l("div", {
127
117
  className: "info-item-header",
128
118
  children: [/* @__PURE__ */ e("div", {
129
119
  className: "info-item-title",
130
120
  children: "QA生成结果预览"
131
- }), L ? /* @__PURE__ */ e(B, {
132
- indicator: /* @__PURE__ */ e(V, {
121
+ }), C ? /* @__PURE__ */ e(j, {
122
+ indicator: /* @__PURE__ */ e(H, {
133
123
  spin: !0,
134
124
  style: {
135
125
  fontSize: 16
136
126
  }
137
127
  })
138
- }) : /* @__PURE__ */ e(H, {
128
+ }) : /* @__PURE__ */ e(K, {
139
129
  type: "icon-finish",
140
130
  style: {
141
131
  fontSize: 16,
@@ -144,58 +134,60 @@ const M = z((f, u) => {
144
134
  })]
145
135
  }), /* @__PURE__ */ e("div", {
146
136
  className: "result",
147
- children: n.length > 0 ? /* @__PURE__ */ e(b, {
148
- children: (A = (w = n[0]) == null ? void 0 : w.qas) != null && A.length ? n[0].qas.map((t, s) => /* @__PURE__ */ r("div", {
137
+ children: (() => {
138
+ var r;
139
+ const s = (((r = a[0]) == null ? void 0 : r.qas) || [])[G];
140
+ return s ? /* @__PURE__ */ l("div", {
149
141
  className: "result-item-container",
150
- style: {
151
- borderBottom: s === n[0].qas.length - 1 ? "none" : "1px solid #D8D8D8"
152
- },
153
142
  children: [/* @__PURE__ */ e("div", {
154
143
  className: "result-item-header",
155
144
  children: /* @__PURE__ */ e("div", {
156
145
  className: "result-item-title",
157
- children: t.name
146
+ children: s.name
158
147
  })
159
- }), /* @__PURE__ */ r("div", {
148
+ }), /* @__PURE__ */ l("div", {
160
149
  className: "result-item-content",
161
150
  children: [/* @__PURE__ */ e("div", {
162
151
  className: "label",
163
152
  children: "问题"
164
153
  }), /* @__PURE__ */ e("div", {
165
154
  className: "value",
166
- children: /* @__PURE__ */ e(R.TextArea, {
167
- value: t.q,
155
+ children: /* @__PURE__ */ e(q.TextArea, {
156
+ value: s.q,
168
157
  readOnly: !0,
169
- rows: 2
158
+ autoSize: {
159
+ minRows: 2,
160
+ maxRows: 20
161
+ }
170
162
  })
171
163
  })]
172
- }), /* @__PURE__ */ r("div", {
164
+ }), /* @__PURE__ */ l("div", {
173
165
  className: "result-item-content",
174
166
  children: [/* @__PURE__ */ e("div", {
175
167
  className: "label",
176
168
  children: "回答"
177
169
  }), /* @__PURE__ */ e("div", {
178
170
  className: "value",
179
- children: /* @__PURE__ */ e(R.TextArea, {
180
- value: t.a,
171
+ children: /* @__PURE__ */ e(q.TextArea, {
172
+ value: s.a,
181
173
  readOnly: !0,
182
- rows: 2
174
+ autoSize: {
175
+ minRows: 2,
176
+ maxRows: 100
177
+ }
183
178
  })
184
179
  })]
185
180
  })]
186
- }, s)) : /* @__PURE__ */ e("div", {
181
+ }) : /* @__PURE__ */ e("div", {
187
182
  className: "result-empty",
188
183
  children: "暂无结果"
189
- })
190
- }) : /* @__PURE__ */ e("div", {
191
- className: "result-empty",
192
- children: "暂无结果"
193
- })
184
+ });
185
+ })()
194
186
  })]
195
187
  })]
196
188
  });
197
189
  });
198
- M.displayName = "QADetail";
190
+ B.displayName = "QADetail";
199
191
  export {
200
- M as default
192
+ B as default
201
193
  };