@glodon-aiot/dataset-annotation 3.15.0-alpha.3 → 3.16.0-alpha.35
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 -101
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +153 -0
- package/dist/es/components/DetectionAnnotation/components/ImageModal/style.less.mjs +4 -0
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +37 -28
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +145 -101
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +276 -196
- package/dist/es/components/DetectionAnnotation/index.mjs +595 -480
- package/dist/es/components/DetectionStatus/index.mjs +44 -0
- package/dist/es/components/DetectionStatus/style.less.mjs +4 -0
- 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/PreLabelModal.mjs +171 -180
- package/dist/es/components/PreLabelOCR/index.mjs +14 -12
- package/dist/es/components/PreLableTable/index.mjs +93 -0
- package/dist/es/components/PreLableTable/style.less.mjs +4 -0
- 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 +101 -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 +156 -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 +285 -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/DetectionAnnotation/index.d.ts +6 -0
- package/dist/src/components/DetectionStatus/index.d.ts +7 -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/PreLabelOCR/index.d.ts +1 -0
- package/dist/src/components/PreLableTable/index.d.ts +7 -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 +187 -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 +5 -1
- 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,175 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var a in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var a of
|
|
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, l, a) => l in n ? _(n, l, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[l] = a, m = (n, l) => {
|
|
6
|
+
for (var a in l || (l = {}))
|
|
7
|
+
S.call(l, a) && A(n, a, l[a]);
|
|
8
|
+
if (M)
|
|
9
|
+
for (var a of M(l))
|
|
10
|
+
ee.call(l, a) && A(n, a, l[a]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
import { jsxs as
|
|
14
|
-
import { useRef as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { useKeyPress as
|
|
12
|
+
}, x = (n, l) => $(n, V(l));
|
|
13
|
+
import { jsxs as b, jsx as d } 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
|
-
|
|
22
|
-
|
|
18
|
+
import ie from "../Labels/index.mjs";
|
|
19
|
+
import te from "../LabelMaker/index.mjs";
|
|
20
|
+
import O from "../../../Iconfont/index.mjs";
|
|
21
|
+
import se from "../../../DetectionStatus/index.mjs";
|
|
22
|
+
const he = (n) => {
|
|
23
|
+
var z, E, F;
|
|
23
24
|
const {
|
|
24
|
-
datasetId:
|
|
25
|
+
datasetId: l,
|
|
25
26
|
isImageDetailVisible: a = !0,
|
|
26
27
|
currentSample: e,
|
|
27
|
-
onNextClick:
|
|
28
|
-
onPrevClick:
|
|
29
|
-
labels:
|
|
30
|
-
editing:
|
|
31
|
-
onRefresh:
|
|
32
|
-
onChange:
|
|
33
|
-
isPreLabel:
|
|
34
|
-
settingHide:
|
|
28
|
+
onNextClick: v,
|
|
29
|
+
onPrevClick: p,
|
|
30
|
+
labels: r = [],
|
|
31
|
+
editing: q,
|
|
32
|
+
onRefresh: L,
|
|
33
|
+
onChange: k,
|
|
34
|
+
isPreLabel: C,
|
|
35
|
+
settingHide: U,
|
|
35
36
|
imgCount: c,
|
|
36
|
-
readonly:
|
|
37
|
-
showLabelList:
|
|
38
|
-
renderLabelItem:
|
|
39
|
-
|
|
40
|
-
B(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
readonly: G,
|
|
38
|
+
showLabelList: D = !0,
|
|
39
|
+
renderLabelItem: J,
|
|
40
|
+
onLoadingChange: w
|
|
41
|
+
} = n, Q = B(null), T = B({}), [P, W] = h({}), [I, N] = h(), [o, y] = h(), [X, Y] = h(!1), [u, R] = h(!1);
|
|
42
|
+
K("rightarrow", () => {
|
|
43
|
+
v && v();
|
|
44
|
+
}), K("leftarrow", () => {
|
|
45
|
+
p && p();
|
|
46
|
+
}), g(() => () => {
|
|
47
|
+
X && L && L();
|
|
48
|
+
}, []), g(() => {
|
|
49
|
+
var t, s;
|
|
50
|
+
if (N(void 0), y(void 0), !a || !((t = e == null ? void 0 : e.labels) != null && t.length))
|
|
49
51
|
return;
|
|
50
|
-
const i = (s = o || e) == null ? void 0 : s.labels.reduce((f,
|
|
51
|
-
|
|
52
|
-
}, [a, e, o]),
|
|
53
|
-
e != null && e.fileUrl &&
|
|
54
|
-
}, [e == null ? void 0 : e.fileUrl]),
|
|
52
|
+
const i = (s = o || e) == null ? void 0 : s.labels.reduce((f, j) => (f[j.id] ? ++f[j.id] : f[j.id] = 1, f), {});
|
|
53
|
+
W(i || {});
|
|
54
|
+
}, [a, e, o]), g(() => {
|
|
55
|
+
e != null && e.fileUrl && R(!0);
|
|
56
|
+
}, [e == null ? void 0 : e.fileUrl]), g(() => {
|
|
57
|
+
w && w(u);
|
|
58
|
+
}, [u, w]), g(() => {
|
|
55
59
|
if (o != null && o.labels) {
|
|
56
60
|
const i = [];
|
|
57
|
-
o.labels.forEach((
|
|
58
|
-
const s =
|
|
59
|
-
s && i.push(
|
|
61
|
+
o.labels.forEach((t) => {
|
|
62
|
+
const s = r.find((f) => f.id === t.id);
|
|
63
|
+
s && i.push(x(m({}, t), {
|
|
60
64
|
label: s.label
|
|
61
65
|
}));
|
|
62
|
-
}), o.labels = i,
|
|
66
|
+
}), o.labels = i, y(m({}, o));
|
|
63
67
|
}
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
|
|
68
|
+
}, [r]);
|
|
69
|
+
const Z = () => {
|
|
70
|
+
Q.current && R(!1);
|
|
67
71
|
};
|
|
68
|
-
return window.onresize =
|
|
72
|
+
return window.onresize = Z, /* @__PURE__ */ b("div", {
|
|
69
73
|
className: "detection-image-detail",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ b("div", {
|
|
71
75
|
className: "detail-image",
|
|
72
|
-
children: [
|
|
76
|
+
children: [U ? /* @__PURE__ */ b("div", {
|
|
73
77
|
className: "img-detail-info",
|
|
74
78
|
children: ["第 ", c == null ? void 0 : c.index, " 张 / 共 ", c == null ? void 0 : c.total, " 张"]
|
|
75
|
-
}) : /* @__PURE__ */
|
|
79
|
+
}) : /* @__PURE__ */ d("div", {
|
|
76
80
|
className: "img-detail-info",
|
|
77
81
|
children: c == null ? void 0 : c.index
|
|
78
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ b("div", {
|
|
79
83
|
className: "detail-content",
|
|
80
|
-
children: [
|
|
84
|
+
children: [p && /* @__PURE__ */ d(H, {
|
|
81
85
|
className: "select-prev",
|
|
82
|
-
icon: /* @__PURE__ */
|
|
86
|
+
icon: /* @__PURE__ */ d(O, {
|
|
83
87
|
type: "icon-zuojiantou"
|
|
84
88
|
}),
|
|
85
89
|
type: "text",
|
|
86
|
-
disabled:
|
|
87
|
-
onClick: () =>
|
|
90
|
+
disabled: u,
|
|
91
|
+
onClick: () => p(),
|
|
88
92
|
tabIndex: 0
|
|
89
|
-
}), /* @__PURE__ */
|
|
93
|
+
}), /* @__PURE__ */ b("div", {
|
|
90
94
|
className: "select-main",
|
|
91
|
-
ref:
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
|
|
95
|
+
ref: T,
|
|
96
|
+
children: [((z = e == null ? void 0 : e.sampleFileName) == null ? void 0 : z.name) && /* @__PURE__ */ d("div", {
|
|
97
|
+
className: "img-detail-name-overlay",
|
|
98
|
+
children: e.sampleFileName.name
|
|
99
|
+
}), /* @__PURE__ */ d("div", {
|
|
100
|
+
className: "detection-status-wrapper",
|
|
101
|
+
children: /* @__PURE__ */ d(se, {
|
|
102
|
+
sample: e
|
|
103
|
+
})
|
|
104
|
+
}), /* @__PURE__ */ d(te, {
|
|
105
|
+
disabled: G,
|
|
94
106
|
imageUrl: (e == null ? void 0 : e.fileUrl) || "",
|
|
95
|
-
pen:
|
|
96
|
-
labels: ((
|
|
97
|
-
var
|
|
98
|
-
return
|
|
99
|
-
color: ((
|
|
107
|
+
pen: I,
|
|
108
|
+
labels: ((E = o ? o.labels : e == null ? void 0 : e.labels) == null ? void 0 : E.map((i) => {
|
|
109
|
+
var t;
|
|
110
|
+
return x(m({}, i), {
|
|
111
|
+
color: ((t = r.find((s) => s.id === i.id)) == null ? void 0 : t.color) || ""
|
|
100
112
|
});
|
|
101
113
|
})) || [],
|
|
102
|
-
onImageLoad: () =>
|
|
114
|
+
onImageLoad: () => R(!1),
|
|
103
115
|
onChange: (i) => {
|
|
104
|
-
if (
|
|
116
|
+
if (N(void 0), !e)
|
|
105
117
|
return;
|
|
106
|
-
const
|
|
118
|
+
const t = x(m({}, e), {
|
|
107
119
|
labels: i.map((s) => ({
|
|
108
120
|
id: s.id,
|
|
109
121
|
label: s.label,
|
|
110
122
|
box: s.box
|
|
111
123
|
}))
|
|
112
124
|
});
|
|
113
|
-
|
|
125
|
+
y(t), k && k(t);
|
|
114
126
|
},
|
|
115
|
-
isPreLabel:
|
|
116
|
-
renderLabelItem:
|
|
117
|
-
})
|
|
118
|
-
}),
|
|
127
|
+
isPreLabel: C,
|
|
128
|
+
renderLabelItem: J
|
|
129
|
+
}, D ? "with-slide" : "no-slide")]
|
|
130
|
+
}), v && /* @__PURE__ */ d(H, {
|
|
119
131
|
className: "select-next",
|
|
120
|
-
icon: /* @__PURE__ */
|
|
132
|
+
icon: /* @__PURE__ */ d(O, {
|
|
121
133
|
type: "icon-youjiantou"
|
|
122
134
|
}),
|
|
123
135
|
type: "text",
|
|
124
|
-
disabled:
|
|
125
|
-
onClick: () =>
|
|
136
|
+
disabled: u,
|
|
137
|
+
onClick: () => v()
|
|
126
138
|
})]
|
|
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
139
|
})]
|
|
131
|
-
}), (!!(
|
|
140
|
+
}), (!!(r != null && r.length) || q) && D && /* @__PURE__ */ d("div", {
|
|
132
141
|
className: "detail-slide",
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
-
datasetId:
|
|
142
|
+
children: /* @__PURE__ */ d(ie, {
|
|
143
|
+
datasetId: l,
|
|
135
144
|
selectMode: "single",
|
|
136
|
-
data: ((
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
return
|
|
145
|
+
data: ((F = Object.keys(P)) == null ? void 0 : F.map((i) => {
|
|
146
|
+
const t = r.find((s) => s.id === i);
|
|
147
|
+
if (t)
|
|
148
|
+
return t.count = P[i], t;
|
|
140
149
|
}).filter((i) => !!i)) || [],
|
|
141
150
|
shortcut: !0,
|
|
142
|
-
selected:
|
|
151
|
+
selected: I ? [I] : [],
|
|
143
152
|
onSelectedChange: (i) => {
|
|
144
153
|
if (i.length > 2) {
|
|
145
154
|
console.warn("不支持选中多个标签");
|
|
146
155
|
return;
|
|
147
156
|
}
|
|
148
157
|
if (!i.length) {
|
|
149
|
-
|
|
158
|
+
N(void 0);
|
|
150
159
|
return;
|
|
151
160
|
}
|
|
152
|
-
const
|
|
153
|
-
|
|
161
|
+
const t = r == null ? void 0 : r.find((s) => i[0].label === s.label);
|
|
162
|
+
N(t);
|
|
154
163
|
},
|
|
155
164
|
onListChange: () => {
|
|
156
|
-
|
|
165
|
+
Y(!0), L && L();
|
|
157
166
|
},
|
|
158
|
-
isPreLabel:
|
|
159
|
-
settingHide:
|
|
167
|
+
isPreLabel: C,
|
|
168
|
+
settingHide: U
|
|
160
169
|
})
|
|
161
170
|
})]
|
|
162
171
|
});
|
|
163
172
|
};
|
|
164
173
|
export {
|
|
165
|
-
|
|
174
|
+
he as default
|
|
166
175
|
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as K } from "react";
|
|
3
|
+
import { Modal as C, Tabs as O, Space as V, Button as l, Tooltip as x } from "antd";
|
|
4
|
+
import { useKeyPress as I } from "ahooks";
|
|
5
|
+
import B from "../ImageDetail/index.mjs";
|
|
6
|
+
import "./style.less.mjs";
|
|
7
|
+
import F from "../../../DataEmpty/index.mjs";
|
|
8
|
+
import { ISampleActionType as u } from "../../index.mjs";
|
|
9
|
+
const W = (L) => {
|
|
10
|
+
const {
|
|
11
|
+
datasetId: N,
|
|
12
|
+
setIsImageDetailVisible: c,
|
|
13
|
+
isImageDetailVisible: m = !0,
|
|
14
|
+
currentSample: e,
|
|
15
|
+
onNextClick: a,
|
|
16
|
+
onPrevClick: o,
|
|
17
|
+
onSave: s,
|
|
18
|
+
onDeleteSample: f,
|
|
19
|
+
labels: v = [],
|
|
20
|
+
onRefresh: w,
|
|
21
|
+
onChange: D,
|
|
22
|
+
isPreLabel: r,
|
|
23
|
+
settingHide: k,
|
|
24
|
+
imgCount: H,
|
|
25
|
+
showLabelList: M = !0,
|
|
26
|
+
renderLabelItem: E,
|
|
27
|
+
onEnterEdit: h,
|
|
28
|
+
filterItems: g,
|
|
29
|
+
filterMode: T,
|
|
30
|
+
onFilterChange: p,
|
|
31
|
+
previewMode: t = !0,
|
|
32
|
+
canLabel: n = !1,
|
|
33
|
+
canDelete: b = !1
|
|
34
|
+
} = L, [y, j] = K(!1);
|
|
35
|
+
return I("rightarrow", () => {
|
|
36
|
+
t || a && a(e == null ? void 0 : e.confirmStatus);
|
|
37
|
+
}), I("leftarrow", () => {
|
|
38
|
+
t || o && o(e == null ? void 0 : e.confirmStatus);
|
|
39
|
+
}), /* @__PURE__ */ d(C, {
|
|
40
|
+
title: /* @__PURE__ */ i("div", {
|
|
41
|
+
className: "detection-sample-detail-title",
|
|
42
|
+
children: /* @__PURE__ */ i("span", {
|
|
43
|
+
children: t ? "详情" : "标注"
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
width: "100%",
|
|
47
|
+
open: m,
|
|
48
|
+
onCancel: () => c(!1),
|
|
49
|
+
footer: null,
|
|
50
|
+
centered: !0,
|
|
51
|
+
wrapClassName: "detection-modal-wrap",
|
|
52
|
+
className: "detection-modal",
|
|
53
|
+
bodyStyle: {
|
|
54
|
+
padding: 0
|
|
55
|
+
},
|
|
56
|
+
destroyOnClose: !1,
|
|
57
|
+
children: [/* @__PURE__ */ i("div", {
|
|
58
|
+
className: "detail-tabs",
|
|
59
|
+
children: !t && g && /* @__PURE__ */ i(O, {
|
|
60
|
+
activeKey: T,
|
|
61
|
+
items: g,
|
|
62
|
+
onChange: (A) => p && p(A)
|
|
63
|
+
})
|
|
64
|
+
}), e ? /* @__PURE__ */ i(B, {
|
|
65
|
+
datasetId: N,
|
|
66
|
+
isImageDetailVisible: m,
|
|
67
|
+
setIsImageDetailVisible: c,
|
|
68
|
+
currentSample: e,
|
|
69
|
+
onNextClick: t ? () => a == null ? void 0 : a(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
70
|
+
onPrevClick: t ? () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus) : void 0,
|
|
71
|
+
labels: v,
|
|
72
|
+
editing: !t,
|
|
73
|
+
onRefresh: w,
|
|
74
|
+
onChange: D,
|
|
75
|
+
isPreLabel: r,
|
|
76
|
+
settingHide: k,
|
|
77
|
+
readonly: t || !n,
|
|
78
|
+
showLabelList: t ? !1 : M,
|
|
79
|
+
renderLabelItem: E,
|
|
80
|
+
onLoadingChange: j
|
|
81
|
+
}) : /* @__PURE__ */ i(F, {}), e && /* @__PURE__ */ i("div", {
|
|
82
|
+
className: "detail-footer",
|
|
83
|
+
children: t ? /* @__PURE__ */ d(V, {
|
|
84
|
+
children: [h && n && /* @__PURE__ */ i("div", {
|
|
85
|
+
className: "detail-actions",
|
|
86
|
+
children: /* @__PURE__ */ i(l, {
|
|
87
|
+
type: "primary",
|
|
88
|
+
onClick: h,
|
|
89
|
+
children: "标注"
|
|
90
|
+
})
|
|
91
|
+
}), b && /* @__PURE__ */ i(l, {
|
|
92
|
+
danger: !0,
|
|
93
|
+
onClick: f,
|
|
94
|
+
children: "删除数据"
|
|
95
|
+
})]
|
|
96
|
+
}) : /* @__PURE__ */ d("div", {
|
|
97
|
+
className: "footer-bar",
|
|
98
|
+
children: [/* @__PURE__ */ i("div", {
|
|
99
|
+
className: "footer-left"
|
|
100
|
+
}), /* @__PURE__ */ d("div", {
|
|
101
|
+
className: "footer-center",
|
|
102
|
+
children: [/* @__PURE__ */ i(l, {
|
|
103
|
+
onClick: () => o == null ? void 0 : o(e == null ? void 0 : e.confirmStatus),
|
|
104
|
+
disabled: y,
|
|
105
|
+
children: "上一张"
|
|
106
|
+
}), /* @__PURE__ */ i(l, {
|
|
107
|
+
onClick: () => a == null ? void 0 : a(e == null ? void 0 : e.confirmStatus),
|
|
108
|
+
disabled: y,
|
|
109
|
+
children: "下一张"
|
|
110
|
+
})]
|
|
111
|
+
}), /* @__PURE__ */ d("div", {
|
|
112
|
+
className: "footer-right",
|
|
113
|
+
children: [n && /* @__PURE__ */ i(x, {
|
|
114
|
+
title: /* @__PURE__ */ i("span", {
|
|
115
|
+
style: {
|
|
116
|
+
color: "#ff9800"
|
|
117
|
+
},
|
|
118
|
+
children: 'AI预标注数据,请"确认标注"完成审核'
|
|
119
|
+
}),
|
|
120
|
+
placement: "top",
|
|
121
|
+
children: /* @__PURE__ */ i(l, {
|
|
122
|
+
type: "primary",
|
|
123
|
+
onClick: () => {
|
|
124
|
+
C.confirm({
|
|
125
|
+
title: "确认",
|
|
126
|
+
content: "是否确认当前标注?",
|
|
127
|
+
onOk: () => {
|
|
128
|
+
s == null || s(0, u.Confirm);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
disabled: r,
|
|
133
|
+
className: "confirm-label-btn",
|
|
134
|
+
children: "确认标注"
|
|
135
|
+
})
|
|
136
|
+
}), n && e.confirmStatus === 1 && /* @__PURE__ */ i(l, {
|
|
137
|
+
type: "primary",
|
|
138
|
+
onClick: () => s == null ? void 0 : s(1, u.Save),
|
|
139
|
+
disabled: r,
|
|
140
|
+
children: "保存标注"
|
|
141
|
+
}), b && /* @__PURE__ */ i(l, {
|
|
142
|
+
onClick: f,
|
|
143
|
+
disabled: r,
|
|
144
|
+
children: "删除数据"
|
|
145
|
+
})]
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
W as default
|
|
153
|
+
};
|
|
@@ -1,45 +1,54 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
let h = -1, s = -1,
|
|
4
|
-
e.on("mouse:down", (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}), e.on("mouse:up", (g) => {
|
|
9
|
-
if (s === -1 && h === -1)
|
|
1
|
+
function X(e, n) {
|
|
2
|
+
T(e);
|
|
3
|
+
let h = -1, s = -1, p = 0, m = 0, w = !1;
|
|
4
|
+
e.on("mouse:down:before", (d) => {
|
|
5
|
+
const f = d.target, u = e.getActiveObject();
|
|
6
|
+
if (f && f !== e.backgroundImage) {
|
|
7
|
+
u !== f && (e.setActiveObject(f), e.requestRenderAll()), e.skipTargetFind = !1;
|
|
10
8
|
return;
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
}
|
|
10
|
+
u && (e.discardActiveObject(), e.renderAll()), e.skipTargetFind = !0;
|
|
11
|
+
}), e.on("mouse:down", (d) => {
|
|
12
|
+
if (!e.skipTargetFind)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
w = !0, h = -1, s = -1, p = 0, m = 0;
|
|
15
|
+
const f = e.getZoom();
|
|
16
|
+
s = d.e.offsetX / f, h = d.e.offsetY / f;
|
|
17
|
+
}), e.on("mouse:up", (d) => {
|
|
18
|
+
if (e.skipTargetFind = !1, !w || (w = !1, s === -1 && h === -1))
|
|
19
|
+
return;
|
|
20
|
+
const f = e.getZoom(), u = d.e.offsetX > e.getWidth() ? e.getWidth() / f : d.e.offsetX / f, b = d.e.offsetY > e.getHeight() ? e.getHeight() / f : d.e.offsetY / f;
|
|
21
|
+
if (p = Math.abs(u - s), m = Math.abs(b - h), p === 0 || m === 0)
|
|
22
|
+
return;
|
|
23
|
+
const y = e.viewportTransform ? e.viewportTransform[4] / f : 0, A = e.viewportTransform ? e.viewportTransform[5] / f : 0;
|
|
24
|
+
let r = h > b ? b : h, i = s > u ? u : s, l = p, g = m;
|
|
25
|
+
r = r - A, i = i - y;
|
|
26
|
+
const F = () => {
|
|
27
|
+
var o, k;
|
|
19
28
|
const t = e.backgroundImage;
|
|
20
|
-
t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (
|
|
21
|
-
},
|
|
29
|
+
t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (k = t.aCoords) != null && k.tl.y), t && typeof t != "string" && t.top !== void 0 && t.height !== void 0 && t.left !== void 0 && t.width !== void 0 && (r < t.top && (g = g - (t.top - r), r = t.top), r + g > t.top + t.height && (g = t.top + t.height - r + g - g, r = t.height + t.top - g), i < t.left && (l = l - (t.left - i), i = t.left), i + l > t.left + t.width && (l = t.left + t.width - i + l - l, i = t.width + t.left - l));
|
|
30
|
+
}, I = (t) => {
|
|
22
31
|
const o = e.backgroundImage;
|
|
23
32
|
return !(o && typeof o != "string" && o.top !== void 0 && o.height !== void 0 && o.left !== void 0 && o.width !== void 0 && (t[0] < o.left || t[1] < o.top || t[0] > o.left + o.width || t[1] > o.top + o.height));
|
|
24
33
|
};
|
|
25
|
-
|
|
26
|
-
const c = [[
|
|
27
|
-
|
|
34
|
+
F();
|
|
35
|
+
const c = [[i, r], [i + l, r], [i + l, r + g], [i, r + g]];
|
|
36
|
+
n && c.every((t) => I(t)) && n({
|
|
28
37
|
id: "",
|
|
29
38
|
color: "#cccccc",
|
|
30
39
|
label: "未知",
|
|
31
40
|
box: c
|
|
32
|
-
}),
|
|
41
|
+
}), T(e);
|
|
33
42
|
});
|
|
34
43
|
}
|
|
35
|
-
const
|
|
36
|
-
e.off("mouse:down"), e.off("mouse:up");
|
|
44
|
+
const T = (e) => {
|
|
45
|
+
e.off("mouse:down"), e.off("mouse:down:before"), e.off("mouse:up"), e.skipTargetFind = !1;
|
|
37
46
|
};
|
|
38
|
-
function
|
|
47
|
+
function Y(e, n, h) {
|
|
39
48
|
if (!h)
|
|
40
|
-
return
|
|
49
|
+
return X(e, n), e;
|
|
41
50
|
}
|
|
42
51
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
Y as drawable,
|
|
53
|
+
T as stopDraw
|
|
45
54
|
};
|