@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.
- package/dist/es/components/VLMAnnotation/RegionItem.mjs +1 -1
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.mjs +193 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +300 -237
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +158 -56
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +424 -397
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/AIErrorTooltip.less.mjs +4 -0
- package/dist/es/components/VLMAnnotation/components/AIErrorTooltip/index.mjs +24 -0
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +1 -1
- package/dist/es/components/VLMAnnotation/constants.mjs +1 -1
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +217 -167
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +114 -122
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +445 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +249 -113
- package/dist/es/components/VLMAnnotationDetail/index.mjs +219 -213
- package/dist/es/index.mjs +1 -1
- package/dist/lib/index.js +4 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.d.ts +16 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +2 -1
- package/dist/src/components/VLMAnnotation/components/AIErrorTooltip/index.d.ts +8 -0
- package/dist/src/components/VLMAnnotation/constants.d.ts +2 -2
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +1 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +21 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +11 -2
- package/package.json +2 -2
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +0 -455
- /package/dist/es/components/VLMAnnotationDetail/{MarkVLMBoxModal → VLMDetail}/style.less.mjs +0 -0
|
@@ -1,141 +1,131 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var R = (h, v, t) => new Promise((m, n) => {
|
|
2
|
+
var f = (a) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
c(t.next(a));
|
|
5
|
+
} catch (d) {
|
|
6
|
+
n(d);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, o = (a) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
c(t.throw(a));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
n(d);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
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
|
|
18
|
-
import { forwardRef as
|
|
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 {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { LoadingOutlined as
|
|
24
|
-
import
|
|
25
|
-
const
|
|
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:
|
|
27
|
+
sample: t,
|
|
29
28
|
visionId: m,
|
|
30
|
-
labels:
|
|
31
|
-
datasetId:
|
|
32
|
-
} =
|
|
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:
|
|
33
|
+
cvforceDatahub: g
|
|
35
34
|
}
|
|
36
|
-
} =
|
|
37
|
-
|
|
38
|
-
checkDirtyAndConfirm: () =>
|
|
39
|
-
return
|
|
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
|
|
43
|
-
if (
|
|
44
|
-
const s =
|
|
45
|
-
var
|
|
46
|
-
const
|
|
47
|
-
id: (
|
|
48
|
-
regionId: (
|
|
49
|
-
shape:
|
|
50
|
-
},
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
}),
|
|
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
|
-
|
|
54
|
+
c(s);
|
|
56
55
|
} else
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const
|
|
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:
|
|
63
|
+
width: 60,
|
|
65
64
|
fixed: "left",
|
|
66
|
-
render: (
|
|
67
|
-
}, ...(
|
|
68
|
-
title:
|
|
69
|
-
dataIndex:
|
|
70
|
-
key:
|
|
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
|
-
}))],
|
|
76
|
-
p(!0), !(!
|
|
77
|
-
sampleIds: [
|
|
78
|
-
}).then((
|
|
79
|
-
console.log("QA生成结果:",
|
|
80
|
-
}).catch((
|
|
81
|
-
console.error("QA生成失败:",
|
|
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__ */
|
|
83
|
+
return /* @__PURE__ */ l("div", {
|
|
85
84
|
className: "qa-detail",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
87
|
-
className: "infos",
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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(
|
|
114
|
-
|
|
115
|
-
children: /* @__PURE__ */ e(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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__ */
|
|
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__ */
|
|
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
|
-
}),
|
|
132
|
-
indicator: /* @__PURE__ */ e(
|
|
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(
|
|
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:
|
|
148
|
-
|
|
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:
|
|
146
|
+
children: s.name
|
|
158
147
|
})
|
|
159
|
-
}), /* @__PURE__ */
|
|
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(
|
|
167
|
-
value:
|
|
155
|
+
children: /* @__PURE__ */ e(q.TextArea, {
|
|
156
|
+
value: s.q,
|
|
168
157
|
readOnly: !0,
|
|
169
|
-
|
|
158
|
+
autoSize: {
|
|
159
|
+
minRows: 2,
|
|
160
|
+
maxRows: 20
|
|
161
|
+
}
|
|
170
162
|
})
|
|
171
163
|
})]
|
|
172
|
-
}), /* @__PURE__ */
|
|
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(
|
|
180
|
-
value:
|
|
171
|
+
children: /* @__PURE__ */ e(q.TextArea, {
|
|
172
|
+
value: s.a,
|
|
181
173
|
readOnly: !0,
|
|
182
|
-
|
|
174
|
+
autoSize: {
|
|
175
|
+
minRows: 2,
|
|
176
|
+
maxRows: 100
|
|
177
|
+
}
|
|
183
178
|
})
|
|
184
179
|
})]
|
|
185
180
|
})]
|
|
186
|
-
}
|
|
181
|
+
}) : /* @__PURE__ */ e("div", {
|
|
187
182
|
className: "result-empty",
|
|
188
183
|
children: "暂无结果"
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
className: "result-empty",
|
|
192
|
-
children: "暂无结果"
|
|
193
|
-
})
|
|
184
|
+
});
|
|
185
|
+
})()
|
|
194
186
|
})]
|
|
195
187
|
})]
|
|
196
188
|
});
|
|
197
189
|
});
|
|
198
|
-
|
|
190
|
+
B.displayName = "QADetail";
|
|
199
191
|
export {
|
|
200
|
-
|
|
192
|
+
B as default
|
|
201
193
|
};
|