@glodon-aiot/dataset-annotation 3.15.0 → 3.15.5-alpha.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.
- package/dist/es/DatasetContext/index.mjs +6 -3
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +110 -107
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +129 -0
- package/dist/es/components/DetectionAnnotation/components/ImageModal/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +90 -33
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +236 -130
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +305 -204
- package/dist/es/components/DetectionAnnotation/index.mjs +477 -423
- package/dist/es/components/Iconfont/index.mjs +2 -2
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +43 -45
- package/dist/es/components/PicZipImportModal/config.mjs +47 -0
- package/dist/es/components/PicZipImportModal/index.mjs +308 -293
- package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +4 -0
- package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +4 -0
- package/dist/es/components/PreLabelOCR/index.mjs +1 -1
- package/dist/es/components/VLMAnnotation/RegionItem.mjs +170 -0
- package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +94 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.mjs +193 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +116 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +115 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +42 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +55 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +51 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +62 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +484 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.mjs +100 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +106 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +112 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.mjs +103 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +38 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +173 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +72 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +218 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +98 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +157 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/ai.svg.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/error.svg.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/loading.svg.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/star.svg.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +678 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +33 -0
- 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/DragButton.mjs +18 -0
- package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +16 -0
- package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +30 -0
- package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +40 -0
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +44 -0
- package/dist/es/components/VLMAnnotation/constants.mjs +57 -0
- package/dist/es/components/VLMAnnotation/index.mjs +279 -0
- package/dist/es/components/VLMAnnotation/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +343 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +290 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +193 -0
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/index.mjs +445 -0
- package/dist/es/components/VLMAnnotationDetail/VLMDetail/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +294 -0
- package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +4 -0
- package/dist/es/components/VLMAnnotationDetail/index.mjs +455 -0
- package/dist/es/components/VLMAnnotationDetail/style.less.mjs +4 -0
- package/dist/es/constant.mjs +3 -3
- package/dist/es/createVlmtasetAnnotation/index.mjs +131 -0
- package/dist/es/featuresConfig.mjs +13 -9
- package/dist/es/index.mjs +11 -7
- package/dist/lib/index.js +4 -3
- package/dist/src/DatasetContext/index.d.ts +2 -0
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +1 -0
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +34 -0
- package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
- package/dist/src/components/PicZipImportModal/config.d.ts +23 -0
- package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/RegionItem.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useAIButtonHover.d.ts +16 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +13 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +38 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +18 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +13 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +22 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +35 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.d.ts +16 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +11 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +29 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.d.ts +31 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +13 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +41 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +12 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +16 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +32 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +25 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +32 -0
- package/dist/src/components/VLMAnnotation/components/AIErrorTooltip/index.d.ts +8 -0
- package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +6 -0
- package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +7 -0
- package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +4 -0
- package/dist/src/components/VLMAnnotation/constants.d.ts +113 -0
- package/dist/src/components/VLMAnnotation/index.d.ts +6 -0
- package/dist/src/components/VLMAnnotation/types.d.ts +188 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +14 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +13 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/VLMDetail/index.d.ts +21 -0
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +26 -0
- package/dist/src/components/VLMAnnotationDetail/index.d.ts +6 -0
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/createVlmtasetAnnotation/index.d.ts +16 -0
- package/dist/src/featuresConfig.d.ts +4 -0
- package/dist/src/index.d.ts +3 -0
- package/package.json +2 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const a =
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
const a = e({
|
|
3
3
|
datasetId: "",
|
|
4
4
|
versionId: "",
|
|
5
5
|
no: "",
|
|
6
6
|
loading: !1,
|
|
7
|
-
services: {}
|
|
7
|
+
services: {},
|
|
8
|
+
token: "",
|
|
9
|
+
apiUrl: "",
|
|
10
|
+
featuresConfig: {}
|
|
8
11
|
});
|
|
9
12
|
export {
|
|
10
13
|
a as default
|
|
@@ -1,166 +1,169 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var _ = Object.defineProperty, $ = Object.defineProperties;
|
|
2
|
+
var V = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var M = Object.getOwnPropertySymbols;
|
|
4
|
+
var S = Object.prototype.hasOwnProperty, ee = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var A = (n, t, o) => t in n ? _(n, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[t] = o, b = (n, t) => {
|
|
6
|
+
for (var o in t || (t = {}))
|
|
7
|
+
S.call(t, o) && A(n, o, t[o]);
|
|
8
|
+
if (M)
|
|
9
|
+
for (var o of M(t))
|
|
10
|
+
ee.call(t, o) && A(n, o, t[o]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
import { jsxs as
|
|
14
|
-
import { useRef as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { useKeyPress as
|
|
12
|
+
}, u = (n, t) => $(n, V(t));
|
|
13
|
+
import { jsxs as m, jsx as f } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as B, useState as h, useEffect as g } from "react";
|
|
15
|
+
import { Button as H } from "antd";
|
|
16
|
+
import { useKeyPress as K } from "ahooks";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
22
|
-
var
|
|
18
|
+
import ie from "../Labels/index.mjs";
|
|
19
|
+
import se from "../LabelMaker/index.mjs";
|
|
20
|
+
import O from "../../../Iconfont/index.mjs";
|
|
21
|
+
const be = (n) => {
|
|
22
|
+
var D, E, F;
|
|
23
23
|
const {
|
|
24
24
|
datasetId: t,
|
|
25
|
-
isImageDetailVisible:
|
|
25
|
+
isImageDetailVisible: o = !0,
|
|
26
26
|
currentSample: e,
|
|
27
|
-
onNextClick:
|
|
28
|
-
onPrevClick:
|
|
27
|
+
onNextClick: v,
|
|
28
|
+
onPrevClick: L,
|
|
29
29
|
labels: d = [],
|
|
30
|
-
editing:
|
|
31
|
-
onRefresh:
|
|
32
|
-
onChange:
|
|
33
|
-
isPreLabel:
|
|
34
|
-
settingHide:
|
|
35
|
-
imgCount:
|
|
36
|
-
readonly:
|
|
37
|
-
showLabelList:
|
|
38
|
-
renderLabelItem:
|
|
39
|
-
|
|
40
|
-
B(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
editing: q,
|
|
31
|
+
onRefresh: N,
|
|
32
|
+
onChange: k,
|
|
33
|
+
isPreLabel: C,
|
|
34
|
+
settingHide: U,
|
|
35
|
+
imgCount: r,
|
|
36
|
+
readonly: G,
|
|
37
|
+
showLabelList: P = !0,
|
|
38
|
+
renderLabelItem: J,
|
|
39
|
+
onLoadingChange: w
|
|
40
|
+
} = n, Q = B(null), T = B({}), [z, W] = h({}), [p, x] = h(), [a, y] = h(), [X, Y] = h(!1), [I, R] = h(!1);
|
|
41
|
+
K("rightarrow", () => {
|
|
42
|
+
v && v();
|
|
43
|
+
}), K("leftarrow", () => {
|
|
44
|
+
L && L();
|
|
45
|
+
}), g(() => () => {
|
|
46
|
+
X && N && N();
|
|
47
|
+
}, []), g(() => {
|
|
48
|
+
var s, l;
|
|
49
|
+
if (x(void 0), (e == null ? void 0 : e.id) !== (a == null ? void 0 : a.id) && y(void 0), !o || !((s = e == null ? void 0 : e.labels) != null && s.length))
|
|
49
50
|
return;
|
|
50
|
-
const i = (
|
|
51
|
-
|
|
52
|
-
}, [
|
|
53
|
-
e != null && e.fileUrl &&
|
|
54
|
-
}, [e == null ? void 0 : e.fileUrl]),
|
|
55
|
-
|
|
51
|
+
const i = (l = a || e) == null ? void 0 : l.labels.reduce((c, j) => (c[j.id] ? ++c[j.id] : c[j.id] = 1, c), {});
|
|
52
|
+
W(i || {});
|
|
53
|
+
}, [o, e, a]), g(() => {
|
|
54
|
+
e != null && e.fileUrl && R(!0);
|
|
55
|
+
}, [e == null ? void 0 : e.fileUrl]), g(() => {
|
|
56
|
+
w && w(I);
|
|
57
|
+
}, [I, w]), g(() => {
|
|
58
|
+
if (a != null && a.labels) {
|
|
56
59
|
const i = [];
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
label:
|
|
60
|
+
a.labels.forEach((s) => {
|
|
61
|
+
const l = d.find((c) => c.id === s.id);
|
|
62
|
+
l && i.push(u(b({}, s), {
|
|
63
|
+
label: l.label
|
|
61
64
|
}));
|
|
62
|
-
}),
|
|
65
|
+
}), a.labels = i, y(b({}, a));
|
|
63
66
|
}
|
|
64
67
|
}, [d]);
|
|
65
|
-
const
|
|
66
|
-
|
|
68
|
+
const Z = () => {
|
|
69
|
+
Q.current && R(!1);
|
|
67
70
|
};
|
|
68
|
-
return window.onresize =
|
|
71
|
+
return window.onresize = Z, /* @__PURE__ */ m("div", {
|
|
69
72
|
className: "detection-image-detail",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ m("div", {
|
|
71
74
|
className: "detail-image",
|
|
72
|
-
children: [
|
|
75
|
+
children: [U ? /* @__PURE__ */ m("div", {
|
|
73
76
|
className: "img-detail-info",
|
|
74
|
-
children: ["第 ",
|
|
75
|
-
}) : /* @__PURE__ */
|
|
77
|
+
children: ["第 ", r == null ? void 0 : r.index, " 张 / 共 ", r == null ? void 0 : r.total, " 张"]
|
|
78
|
+
}) : /* @__PURE__ */ f("div", {
|
|
76
79
|
className: "img-detail-info",
|
|
77
|
-
children:
|
|
78
|
-
}), /* @__PURE__ */
|
|
80
|
+
children: r == null ? void 0 : r.index
|
|
81
|
+
}), /* @__PURE__ */ m("div", {
|
|
79
82
|
className: "detail-content",
|
|
80
|
-
children: [
|
|
83
|
+
children: [L && /* @__PURE__ */ f(H, {
|
|
81
84
|
className: "select-prev",
|
|
82
|
-
icon: /* @__PURE__ */
|
|
85
|
+
icon: /* @__PURE__ */ f(O, {
|
|
83
86
|
type: "icon-zuojiantou"
|
|
84
87
|
}),
|
|
85
88
|
type: "text",
|
|
86
|
-
disabled:
|
|
87
|
-
onClick: () =>
|
|
89
|
+
disabled: I,
|
|
90
|
+
onClick: () => L(),
|
|
88
91
|
tabIndex: 0
|
|
89
|
-
}), /* @__PURE__ */
|
|
92
|
+
}), /* @__PURE__ */ m("div", {
|
|
90
93
|
className: "select-main",
|
|
91
|
-
ref:
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
|
|
94
|
+
ref: T,
|
|
95
|
+
children: [((D = e == null ? void 0 : e.sampleFileName) == null ? void 0 : D.name) && /* @__PURE__ */ f("div", {
|
|
96
|
+
className: "img-detail-name-overlay",
|
|
97
|
+
children: e.sampleFileName.name
|
|
98
|
+
}), /* @__PURE__ */ f(se, {
|
|
99
|
+
disabled: G,
|
|
94
100
|
imageUrl: (e == null ? void 0 : e.fileUrl) || "",
|
|
95
|
-
pen:
|
|
96
|
-
labels: ((
|
|
97
|
-
var
|
|
98
|
-
return
|
|
99
|
-
color: ((
|
|
101
|
+
pen: p,
|
|
102
|
+
labels: ((E = a ? a.labels : e == null ? void 0 : e.labels) == null ? void 0 : E.map((i) => {
|
|
103
|
+
var s;
|
|
104
|
+
return u(b({}, i), {
|
|
105
|
+
color: ((s = d.find((l) => l.id === i.id)) == null ? void 0 : s.color) || ""
|
|
100
106
|
});
|
|
101
107
|
})) || [],
|
|
102
|
-
onImageLoad: () =>
|
|
108
|
+
onImageLoad: () => R(!1),
|
|
103
109
|
onChange: (i) => {
|
|
104
|
-
if (
|
|
110
|
+
if (x(void 0), !e)
|
|
105
111
|
return;
|
|
106
|
-
const
|
|
107
|
-
labels: i.map((
|
|
108
|
-
id:
|
|
109
|
-
label:
|
|
110
|
-
box:
|
|
112
|
+
const s = u(b({}, e), {
|
|
113
|
+
labels: i.map((l) => ({
|
|
114
|
+
id: l.id,
|
|
115
|
+
label: l.label,
|
|
116
|
+
box: l.box
|
|
111
117
|
}))
|
|
112
118
|
});
|
|
113
|
-
|
|
119
|
+
y(s), k && k(s);
|
|
114
120
|
},
|
|
115
|
-
isPreLabel:
|
|
116
|
-
renderLabelItem:
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
121
|
+
isPreLabel: C,
|
|
122
|
+
renderLabelItem: J
|
|
123
|
+
}, P ? "with-slide" : "no-slide")]
|
|
124
|
+
}), v && /* @__PURE__ */ f(H, {
|
|
119
125
|
className: "select-next",
|
|
120
|
-
icon: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ f(O, {
|
|
121
127
|
type: "icon-youjiantou"
|
|
122
128
|
}),
|
|
123
129
|
type: "text",
|
|
124
|
-
disabled:
|
|
125
|
-
onClick: () =>
|
|
130
|
+
disabled: I,
|
|
131
|
+
onClick: () => v()
|
|
126
132
|
})]
|
|
127
|
-
}), ((z = e == null ? void 0 : e.sampleFileName) == null ? void 0 : z.name) && /* @__PURE__ */ r("div", {
|
|
128
|
-
className: "img-detail-info",
|
|
129
|
-
children: e.sampleFileName.name
|
|
130
133
|
})]
|
|
131
|
-
}), (!!(d != null && d.length) ||
|
|
134
|
+
}), (!!(d != null && d.length) || q) && P && /* @__PURE__ */ f("div", {
|
|
132
135
|
className: "detail-slide",
|
|
133
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ f(ie, {
|
|
134
137
|
datasetId: t,
|
|
135
138
|
selectMode: "single",
|
|
136
|
-
data: ((
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
return
|
|
139
|
+
data: ((F = Object.keys(z)) == null ? void 0 : F.map((i) => {
|
|
140
|
+
const s = d.find((l) => l.id === i);
|
|
141
|
+
if (s)
|
|
142
|
+
return s.count = z[i], s;
|
|
140
143
|
}).filter((i) => !!i)) || [],
|
|
141
144
|
shortcut: !0,
|
|
142
|
-
selected:
|
|
145
|
+
selected: p ? [p] : [],
|
|
143
146
|
onSelectedChange: (i) => {
|
|
144
147
|
if (i.length > 2) {
|
|
145
148
|
console.warn("不支持选中多个标签");
|
|
146
149
|
return;
|
|
147
150
|
}
|
|
148
151
|
if (!i.length) {
|
|
149
|
-
|
|
152
|
+
x(void 0);
|
|
150
153
|
return;
|
|
151
154
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
155
|
+
const s = d == null ? void 0 : d.find((l) => i[0].label === l.label);
|
|
156
|
+
x(s);
|
|
154
157
|
},
|
|
155
158
|
onListChange: () => {
|
|
156
|
-
|
|
159
|
+
Y(!0), N && N();
|
|
157
160
|
},
|
|
158
|
-
isPreLabel:
|
|
159
|
-
settingHide:
|
|
161
|
+
isPreLabel: C,
|
|
162
|
+
settingHide: U
|
|
160
163
|
})
|
|
161
164
|
})]
|
|
162
165
|
});
|
|
163
166
|
};
|
|
164
167
|
export {
|
|
165
|
-
|
|
168
|
+
be as default
|
|
166
169
|
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P } from "react";
|
|
3
|
+
import { Modal as E, Tabs as j, Space as K, Button as a } from "antd";
|
|
4
|
+
import { useKeyPress as b } from "ahooks";
|
|
5
|
+
import V from "../ImageDetail/index.mjs";
|
|
6
|
+
import "./style.less.mjs";
|
|
7
|
+
import B from "../../../DataEmpty/index.mjs";
|
|
8
|
+
const G = (u) => {
|
|
9
|
+
const {
|
|
10
|
+
datasetId: v,
|
|
11
|
+
setIsImageDetailVisible: s,
|
|
12
|
+
isImageDetailVisible: c = !0,
|
|
13
|
+
currentSample: o,
|
|
14
|
+
onNextClick: t,
|
|
15
|
+
onPrevClick: r,
|
|
16
|
+
onSave: N,
|
|
17
|
+
onDeleteSample: m,
|
|
18
|
+
labels: y = [],
|
|
19
|
+
onRefresh: k,
|
|
20
|
+
onChange: I,
|
|
21
|
+
isPreLabel: n,
|
|
22
|
+
settingHide: L,
|
|
23
|
+
imgCount: F,
|
|
24
|
+
showLabelList: w = !0,
|
|
25
|
+
renderLabelItem: D,
|
|
26
|
+
onEnterEdit: f,
|
|
27
|
+
filterItems: h,
|
|
28
|
+
filterMode: S,
|
|
29
|
+
onFilterChange: p,
|
|
30
|
+
previewMode: i = !0,
|
|
31
|
+
canLabel: d = !1,
|
|
32
|
+
canDelete: g = !1
|
|
33
|
+
} = u, [C, x] = P(!1);
|
|
34
|
+
return b("rightarrow", () => {
|
|
35
|
+
i || t && t();
|
|
36
|
+
}), b("leftarrow", () => {
|
|
37
|
+
i || r && r();
|
|
38
|
+
}), /* @__PURE__ */ l(E, {
|
|
39
|
+
title: /* @__PURE__ */ e("div", {
|
|
40
|
+
className: "detection-sample-detail-title",
|
|
41
|
+
children: /* @__PURE__ */ e("span", {
|
|
42
|
+
children: i ? "详情" : "标注"
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
width: "100%",
|
|
46
|
+
open: c,
|
|
47
|
+
onCancel: () => s(!1),
|
|
48
|
+
footer: null,
|
|
49
|
+
centered: !0,
|
|
50
|
+
wrapClassName: "detection-modal-wrap",
|
|
51
|
+
className: "detection-modal",
|
|
52
|
+
bodyStyle: {
|
|
53
|
+
padding: 0
|
|
54
|
+
},
|
|
55
|
+
destroyOnClose: !1,
|
|
56
|
+
children: [/* @__PURE__ */ e("div", {
|
|
57
|
+
className: "detail-tabs",
|
|
58
|
+
children: !i && h && /* @__PURE__ */ e(j, {
|
|
59
|
+
activeKey: S,
|
|
60
|
+
items: h,
|
|
61
|
+
onChange: (M) => p && p(M)
|
|
62
|
+
})
|
|
63
|
+
}), o ? /* @__PURE__ */ e(V, {
|
|
64
|
+
datasetId: v,
|
|
65
|
+
isImageDetailVisible: c,
|
|
66
|
+
setIsImageDetailVisible: s,
|
|
67
|
+
currentSample: o,
|
|
68
|
+
onNextClick: i ? t : void 0,
|
|
69
|
+
onPrevClick: i ? r : void 0,
|
|
70
|
+
labels: y,
|
|
71
|
+
editing: !i,
|
|
72
|
+
onRefresh: k,
|
|
73
|
+
onChange: I,
|
|
74
|
+
isPreLabel: n,
|
|
75
|
+
settingHide: L,
|
|
76
|
+
readonly: i || !d,
|
|
77
|
+
showLabelList: i ? !1 : w,
|
|
78
|
+
renderLabelItem: D,
|
|
79
|
+
onLoadingChange: x
|
|
80
|
+
}) : /* @__PURE__ */ e(B, {}), o && /* @__PURE__ */ e("div", {
|
|
81
|
+
className: "detail-footer",
|
|
82
|
+
children: i ? /* @__PURE__ */ l(K, {
|
|
83
|
+
children: [f && d && /* @__PURE__ */ e("div", {
|
|
84
|
+
className: "detail-actions",
|
|
85
|
+
children: /* @__PURE__ */ e(a, {
|
|
86
|
+
type: "primary",
|
|
87
|
+
onClick: f,
|
|
88
|
+
children: "标注"
|
|
89
|
+
})
|
|
90
|
+
}), g && /* @__PURE__ */ e(a, {
|
|
91
|
+
danger: !0,
|
|
92
|
+
onClick: m,
|
|
93
|
+
children: "删除数据"
|
|
94
|
+
})]
|
|
95
|
+
}) : /* @__PURE__ */ l("div", {
|
|
96
|
+
className: "footer-bar",
|
|
97
|
+
children: [/* @__PURE__ */ e("div", {
|
|
98
|
+
className: "footer-left"
|
|
99
|
+
}), /* @__PURE__ */ l("div", {
|
|
100
|
+
className: "footer-center",
|
|
101
|
+
children: [/* @__PURE__ */ e(a, {
|
|
102
|
+
onClick: r,
|
|
103
|
+
disabled: C,
|
|
104
|
+
children: "上一张"
|
|
105
|
+
}), /* @__PURE__ */ e(a, {
|
|
106
|
+
onClick: t,
|
|
107
|
+
disabled: C,
|
|
108
|
+
children: "下一张"
|
|
109
|
+
})]
|
|
110
|
+
}), /* @__PURE__ */ l("div", {
|
|
111
|
+
className: "footer-right",
|
|
112
|
+
children: [d && /* @__PURE__ */ e(a, {
|
|
113
|
+
type: "primary",
|
|
114
|
+
onClick: N,
|
|
115
|
+
disabled: n,
|
|
116
|
+
children: "保存标注"
|
|
117
|
+
}), g && /* @__PURE__ */ e(a, {
|
|
118
|
+
onClick: m,
|
|
119
|
+
disabled: n,
|
|
120
|
+
children: "删除数据"
|
|
121
|
+
})]
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
export {
|
|
128
|
+
G as default
|
|
129
|
+
};
|
|
@@ -1,45 +1,102 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
let
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (s === -1 && h === -1)
|
|
1
|
+
function A(t, w) {
|
|
2
|
+
I(t);
|
|
3
|
+
let s = -1, p = -1, b = 0, T = 0, x = !1;
|
|
4
|
+
t.on("mouse:down:before", (l) => {
|
|
5
|
+
const i = l.target, n = t.getActiveObject(), g = t.getPointer(l.e), c = t.backgroundImage, m = c == null ? void 0 : c.aCoords;
|
|
6
|
+
let o = !1;
|
|
7
|
+
if (m && (o = g.x >= m.tl.x && g.x <= m.br.x && g.y >= m.tl.y && g.y <= m.br.y), !o) {
|
|
8
|
+
n && (t.discardActiveObject(), t.renderAll()), t.skipTargetFind = !0;
|
|
10
9
|
return;
|
|
11
|
-
|
|
12
|
-
if (
|
|
10
|
+
}
|
|
11
|
+
if (i && i !== t.backgroundImage) {
|
|
12
|
+
n !== i && (t.setActiveObject(i), t.requestRenderAll()), t.skipTargetFind = !1;
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
}
|
|
15
|
+
n && (t.discardActiveObject(), t.renderAll()), t.skipTargetFind = !0;
|
|
16
|
+
}), t.on("mouse:down", (l) => {
|
|
17
|
+
if (!t.skipTargetFind)
|
|
18
|
+
return;
|
|
19
|
+
x = !0, s = -1, p = -1, b = 0, T = 0;
|
|
20
|
+
const i = t.getZoom();
|
|
21
|
+
p = l.e.offsetX / i, s = l.e.offsetY / i;
|
|
22
|
+
}), t.on("mouse:up:before", (l) => {
|
|
23
|
+
if (x) {
|
|
24
|
+
const i = t.selection;
|
|
25
|
+
t.selection = !1, setTimeout(() => {
|
|
26
|
+
t.selection = i;
|
|
27
|
+
}, 0);
|
|
28
|
+
}
|
|
29
|
+
}), t.on("mouse:up", (l) => {
|
|
30
|
+
if (!x) {
|
|
31
|
+
t.skipTargetFind && setTimeout(() => {
|
|
32
|
+
t.skipTargetFind = !1;
|
|
33
|
+
}, 0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (x = !1, p === -1 && s === -1) {
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
t.skipTargetFind = !1;
|
|
39
|
+
}, 0);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const i = t.getZoom(), n = l.e.offsetX > t.getWidth() ? t.getWidth() / i : l.e.offsetX / i, g = l.e.offsetY > t.getHeight() ? t.getHeight() / i : l.e.offsetY / i;
|
|
43
|
+
if (b = Math.abs(n - p), T = Math.abs(g - s), b === 0 || T === 0) {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
t.skipTargetFind = !1;
|
|
46
|
+
}, 0);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const c = t.viewportTransform ? t.viewportTransform[4] / i : 0, m = t.viewportTransform ? t.viewportTransform[5] / i : 0;
|
|
50
|
+
let o = s > g ? g : s, r = p > n ? n : p, d = b, h = T;
|
|
51
|
+
o = o - m, r = r - c;
|
|
52
|
+
const F = () => {
|
|
53
|
+
var f, k;
|
|
54
|
+
const e = t.backgroundImage;
|
|
55
|
+
if (e && typeof e != "string" && ((f = e.aCoords) != null && f.tl.x, (k = e.aCoords) != null && k.tl.y), e && typeof e != "string" && e.top !== void 0 && e.height !== void 0 && e.left !== void 0 && e.width !== void 0) {
|
|
56
|
+
if (o < e.top) {
|
|
57
|
+
const u = e.top - o;
|
|
58
|
+
h = Math.max(0, h - u), o = e.top;
|
|
59
|
+
}
|
|
60
|
+
if (o + h > e.top + e.height) {
|
|
61
|
+
const u = e.top + e.height - o;
|
|
62
|
+
h = Math.max(0, Math.min(h, u)), o + h > e.top + e.height && (o = e.top + e.height - h);
|
|
63
|
+
}
|
|
64
|
+
if (r < e.left) {
|
|
65
|
+
const u = e.left - r;
|
|
66
|
+
d = Math.max(0, d - u), r = e.left;
|
|
67
|
+
}
|
|
68
|
+
if (r + d > e.left + e.width) {
|
|
69
|
+
const u = e.left + e.width - r;
|
|
70
|
+
d = Math.max(0, Math.min(d, u)), r + d > e.left + e.width && (r = e.left + e.width - d);
|
|
71
|
+
}
|
|
72
|
+
o = Math.max(e.top, Math.min(o, e.top + e.height)), r = Math.max(e.left, Math.min(r, e.left + e.width)), d = Math.max(0, Math.min(d, e.left + e.width - r)), h = Math.max(0, Math.min(h, e.top + e.height - o));
|
|
73
|
+
}
|
|
74
|
+
}, y = (e) => {
|
|
75
|
+
const f = t.backgroundImage;
|
|
76
|
+
return !(f && typeof f != "string" && f.top !== void 0 && f.height !== void 0 && f.left !== void 0 && f.width !== void 0 && (e[0] < f.left - 0.01 || e[1] < f.top - 0.01 || e[0] > f.left + f.width + 0.01 || e[1] > f.top + f.height + 0.01));
|
|
24
77
|
};
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
78
|
+
F();
|
|
79
|
+
const M = [[r, o], [r + d, o], [r + d, o + h], [r, o + h]];
|
|
80
|
+
w && M.every((e) => y(e)) ? (w({
|
|
28
81
|
id: "",
|
|
29
82
|
color: "#cccccc",
|
|
30
83
|
label: "未知",
|
|
31
|
-
box:
|
|
32
|
-
}),
|
|
84
|
+
box: M
|
|
85
|
+
}), setTimeout(() => {
|
|
86
|
+
t.skipTargetFind = !1;
|
|
87
|
+
}, 0)) : (t.discardActiveObject(), t.renderAll(), setTimeout(() => {
|
|
88
|
+
t.skipTargetFind = !1;
|
|
89
|
+
}, 0));
|
|
33
90
|
});
|
|
34
91
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
92
|
+
const I = (t) => {
|
|
93
|
+
t.off("mouse:down"), t.off("mouse:down:before"), t.off("mouse:up"), t.skipTargetFind = !1;
|
|
37
94
|
};
|
|
38
|
-
function
|
|
39
|
-
if (!
|
|
40
|
-
return
|
|
95
|
+
function O(t, w, s) {
|
|
96
|
+
if (!s)
|
|
97
|
+
return A(t, w), t;
|
|
41
98
|
}
|
|
42
99
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
100
|
+
O as drawable,
|
|
101
|
+
I as stopDraw
|
|
45
102
|
};
|