@glodon-aiot/dataset-annotation 3.25.1-alpha.7 → 3.26.0-alpha.4
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/dataset-annotation.js +123598 -0
- package/dist/dataset-annotation.umd.cjs +1017 -0
- package/dist/es/components/DetectionAnnotation/index.mjs +529 -535
- package/dist/es/components/OCRImageViewer/index.mjs +117 -130
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +65 -65
- package/dist/es/components/OcrAnnotation/OCRBoxDetail/index.mjs +92 -94
- package/dist/es/index.mjs +15 -21
- package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
- package/dist/example/DemoTabs.d.ts +3 -0
- package/dist/example/DetectionDatasetDemo.d.ts +5 -0
- package/dist/example/DetectionImageDemo.d.ts +5 -0
- package/dist/example/OcrDatasetDemo.d.ts +5 -0
- package/dist/example/OcrImageDemo.d.ts +5 -0
- package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
- package/dist/example/constant.local.d.ts +6 -0
- package/dist/example/index.d.ts +1 -0
- package/dist/lib/index.js +4 -37
- package/dist/src/components/OCRImageViewer/index.d.ts +0 -1
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/ImageDetail/index.d.ts +16 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +21 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LableEditor.d.ts +16 -0
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/index.d.ts +19 -0
- package/dist/src/index.d.ts +0 -6
- package/dist/src/utils/reactCompatibility.d.ts +5 -0
- package/package.json +2 -2
- package/dist/es/_virtual/_commonjsHelpers.mjs +0 -8
- package/dist/es/_virtual/dayjs.min.mjs +0 -4
- package/dist/es/components/VersionCompare/VersionCompareSelectModal/index.mjs +0 -122
- package/dist/es/components/VersionCompare/adapter.mjs +0 -215
- package/dist/es/components/VersionCompare/components/DataChangeStatsCard.mjs +0 -68
- package/dist/es/components/VersionCompare/components/DiffValue.mjs +0 -31
- package/dist/es/components/VersionCompare/components/LabelComparisonCard.mjs +0 -130
- package/dist/es/components/VersionCompare/components/ModifiedSampleCompareModal.mjs +0 -207
- package/dist/es/components/VersionCompare/components/SampleChangeDetailsCard.mjs +0 -160
- package/dist/es/components/VersionCompare/components/SingleSampleDetailModal.mjs +0 -165
- package/dist/es/components/VersionCompare/components/VersionCompareHeader.mjs +0 -106
- package/dist/es/components/VersionCompare/components/VersionOverviewCard.mjs +0 -70
- package/dist/es/components/VersionCompare/index.mjs +0 -416
- package/dist/es/components/VersionCompare/mock.mjs +0 -571
- package/dist/es/components/VersionCompare/style.less.mjs +0 -4
- package/dist/es/components/VersionCompare/utils/labelColors.mjs +0 -45
- package/dist/es/createDatasetVersionCompare/index.mjs +0 -124
- package/dist/es/node_modules/dayjs/dayjs.min.mjs +0 -324
- package/dist/src/components/VersionCompare/VersionCompareSelectModal/index.d.ts +0 -16
- package/dist/src/components/VersionCompare/adapter.d.ts +0 -50
- package/dist/src/components/VersionCompare/components/DataChangeStatsCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/components/DiffValue.d.ts +0 -23
- package/dist/src/components/VersionCompare/components/LabelComparisonCard.d.ts +0 -12
- package/dist/src/components/VersionCompare/components/ModifiedSampleCompareModal.d.ts +0 -48
- package/dist/src/components/VersionCompare/components/SampleChangeDetailsCard.d.ts +0 -21
- package/dist/src/components/VersionCompare/components/SingleSampleDetailModal.d.ts +0 -46
- package/dist/src/components/VersionCompare/components/VersionCompareHeader.d.ts +0 -13
- package/dist/src/components/VersionCompare/components/VersionOverviewCard.d.ts +0 -9
- package/dist/src/components/VersionCompare/index.d.ts +0 -34
- package/dist/src/components/VersionCompare/mock.d.ts +0 -25
- package/dist/src/components/VersionCompare/types.d.ts +0 -75
- package/dist/src/components/VersionCompare/utils/labelColors.d.ts +0 -13
- package/dist/src/createDatasetVersionCompare/index.d.ts +0 -26
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Category, ILabel, ISample } from '@glodon-aiot/apis';
|
|
3
|
+
import { LabelItem } from '../../../DetectionImageAnnotation';
|
|
4
|
+
interface ImageDetailProps {
|
|
5
|
+
currentSample?: ISample;
|
|
6
|
+
onNextClick?: VoidFunction;
|
|
7
|
+
onPrevClick?: VoidFunction;
|
|
8
|
+
labels?: ILabel[];
|
|
9
|
+
onRefresh?: VoidFunction;
|
|
10
|
+
onChange?: (sample: ISample) => void;
|
|
11
|
+
readonly?: boolean;
|
|
12
|
+
categories: Category[];
|
|
13
|
+
renderLabelItem?: (label: LabelItem) => string;
|
|
14
|
+
}
|
|
15
|
+
declare const ImageDetail: React.FC<ImageDetailProps>;
|
|
16
|
+
export default ImageDetail;
|
package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorInput.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { OCRLabel } from './LabelEditorItem';
|
|
3
|
+
interface LabelEditorInputProps {
|
|
4
|
+
value?: Partial<OCRLabel>;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
holdingLabel?: OCRLabel;
|
|
7
|
+
clearHoldingLabel?: VoidFunction;
|
|
8
|
+
onChange?: (value: OCRLabel) => void;
|
|
9
|
+
onSelect?: (value?: Partial<OCRLabel>) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const LabelEditorInput: FC<LabelEditorInputProps>;
|
|
12
|
+
export default LabelEditorInput;
|
package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/OCRBoxMaker/LabelEditorItem.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface OCRLabel {
|
|
3
|
+
uuid: string;
|
|
4
|
+
box: [number, number][];
|
|
5
|
+
words: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
catagoryId?: string;
|
|
8
|
+
}
|
|
9
|
+
interface LabelEditorItemProps {
|
|
10
|
+
name: string;
|
|
11
|
+
catagoryId: string;
|
|
12
|
+
values: OCRLabel[];
|
|
13
|
+
selectedLabel?: OCRLabel;
|
|
14
|
+
holdingLabel?: OCRLabel;
|
|
15
|
+
clearHoldingLabel?: VoidFunction;
|
|
16
|
+
onChange: (values: OCRLabel[]) => void;
|
|
17
|
+
onRemove: (label: OCRLabel) => void;
|
|
18
|
+
onSelect?: (value?: Partial<OCRLabel>) => void;
|
|
19
|
+
}
|
|
20
|
+
declare const LabelEditorItem: FC<LabelEditorItemProps>;
|
|
21
|
+
export default LabelEditorItem;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { OCRLabel } from './LabelEditorItem';
|
|
3
|
+
import { Category } from '@glodon-aiot/apis';
|
|
4
|
+
interface LabelEditorProps {
|
|
5
|
+
category: Category;
|
|
6
|
+
selectedLabel?: OCRLabel;
|
|
7
|
+
holdingLabel?: OCRLabel;
|
|
8
|
+
type?: OCRLabel[];
|
|
9
|
+
value?: OCRLabel[];
|
|
10
|
+
clearHoldingLabel?: VoidFunction;
|
|
11
|
+
onChange: (type: OCRLabel[], value: OCRLabel[]) => void;
|
|
12
|
+
onRemove: (label: OCRLabel) => void;
|
|
13
|
+
onSelect?: (value?: Partial<OCRLabel>) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const LabelEditor: FC<LabelEditorProps>;
|
|
16
|
+
export default LabelEditor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { OCRLabel } from './LabelEditorItem';
|
|
3
|
+
import { LabelItem } from '../../../DetectionImageAnnotation';
|
|
4
|
+
interface Category {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
interface OCRBoxMakerProps {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
id: string;
|
|
11
|
+
imageUrl: string;
|
|
12
|
+
canvasElement: HTMLCanvasElement | null;
|
|
13
|
+
categories: Category[];
|
|
14
|
+
labels: OCRLabel[];
|
|
15
|
+
onChange: (labels: OCRLabel[]) => void;
|
|
16
|
+
renderLabelItem?: (label: LabelItem) => string;
|
|
17
|
+
}
|
|
18
|
+
declare const OCRBoxMaker: FC<OCRBoxMakerProps>;
|
|
19
|
+
export default OCRBoxMaker;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,9 +11,3 @@ export { default as VLMAnnotation } from './components/VLMAnnotation';
|
|
|
11
11
|
export type { VLMAnnotationProps, VLMLabel, VLMSample } from './components/VLMAnnotation';
|
|
12
12
|
export { default as VQAAnnotation } from './components/VQAAnnotation';
|
|
13
13
|
export type { VQAAnnotationRef, VQASample, VQAConversation } from './components/VQAAnnotation';
|
|
14
|
-
export { default as VersionCompareSelectModal } from './components/VersionCompare/VersionCompareSelectModal';
|
|
15
|
-
export type { VersionCompareSelectModalProps } from './components/VersionCompare/VersionCompareSelectModal';
|
|
16
|
-
export { default as DatasetVersionCompare } from './components/VersionCompare';
|
|
17
|
-
export type { DatasetVersionCompareProps } from './components/VersionCompare';
|
|
18
|
-
export { default as createDatasetVersionCompare } from './createDatasetVersionCompare';
|
|
19
|
-
export type { DatasetVersionCompareConfig } from './createDatasetVersionCompare';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/dataset-annotation",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0-alpha.4",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/icons": "^5.3.4",
|
|
39
39
|
"@aws-crypto/sha256-js": "^3.0.0",
|
|
40
|
-
"@glodon-aiot/apis": "^3.
|
|
40
|
+
"@glodon-aiot/apis": "^3.26.0-alpha.4",
|
|
41
41
|
"@glodon-aiot/minio": "^0.1.6",
|
|
42
42
|
"@reduxjs/toolkit": "^1.9.5",
|
|
43
43
|
"@types/fabric": "^5.3.2",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var o = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
2
|
-
function l(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
o as commonjsGlobal,
|
|
7
|
-
l as getDefaultExportFromCjs
|
|
8
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as L } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as M, useState as C, useEffect as k } from "react";
|
|
3
|
-
import { Form as r, Modal as B, Button as F, Select as S } from "antd";
|
|
4
|
-
import E from "../../../DatasetContext/index.mjs";
|
|
5
|
-
import { MOCK_DATASET_VERSIONS as O } from "../mock.mjs";
|
|
6
|
-
const R = (x) => {
|
|
7
|
-
var b, g;
|
|
8
|
-
const s = M(E), {
|
|
9
|
-
open: l,
|
|
10
|
-
datasetId: d = s.datasetId,
|
|
11
|
-
datasetName: y = (b = s.dataset) == null ? void 0 : b.name,
|
|
12
|
-
initialBaseVersionId: f,
|
|
13
|
-
initialTargetVersionId: u,
|
|
14
|
-
versions: n,
|
|
15
|
-
cvforceDatahub: c = (g = s.services) == null ? void 0 : g.cvforceDatahub,
|
|
16
|
-
useMock: h = !1,
|
|
17
|
-
onCancel: p,
|
|
18
|
-
onConfirm: T
|
|
19
|
-
} = x, [o] = r.useForm(), [i, a] = C([]), [V, I] = C(!1), v = r.useWatch("baseVersionId", o), D = r.useWatch("targetVersionId", o);
|
|
20
|
-
return k(() => {
|
|
21
|
-
if (l) {
|
|
22
|
-
if (o.setFieldsValue({
|
|
23
|
-
baseVersionId: f,
|
|
24
|
-
targetVersionId: u
|
|
25
|
-
}), n && n.length > 0) {
|
|
26
|
-
a(n);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (h) {
|
|
30
|
-
a(O);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!d || !c) {
|
|
34
|
-
a(s.versions || []);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
I(!0), c.getDatasetsIdVersions(d, 1, 1e3).then((e) => {
|
|
38
|
-
a((e == null ? void 0 : e.recordList) || []);
|
|
39
|
-
}).catch(() => {
|
|
40
|
-
a([]);
|
|
41
|
-
}).finally(() => {
|
|
42
|
-
I(!1);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}, [l, d, f, u, n, c, h, s.versions, o]), /* @__PURE__ */ t(B, {
|
|
46
|
-
title: "选择对比版本",
|
|
47
|
-
open: l,
|
|
48
|
-
width: 400,
|
|
49
|
-
destroyOnClose: !0,
|
|
50
|
-
maskClosable: !1,
|
|
51
|
-
centered: !0,
|
|
52
|
-
focusTriggerAfterClose: !1,
|
|
53
|
-
onCancel: p,
|
|
54
|
-
footer: [/* @__PURE__ */ t(F, {
|
|
55
|
-
onClick: p,
|
|
56
|
-
children: "取消"
|
|
57
|
-
}, "cancel"), /* @__PURE__ */ t(F, {
|
|
58
|
-
type: "primary",
|
|
59
|
-
htmlType: "submit",
|
|
60
|
-
form: "versionCompareSelectForm",
|
|
61
|
-
children: "开始对比"
|
|
62
|
-
}, "confirm")],
|
|
63
|
-
children: /* @__PURE__ */ L(r, {
|
|
64
|
-
form: o,
|
|
65
|
-
preserve: !1,
|
|
66
|
-
name: "versionCompareSelectForm",
|
|
67
|
-
labelAlign: "right",
|
|
68
|
-
labelCol: {
|
|
69
|
-
style: {
|
|
70
|
-
width: 90
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
onFinish: (e) => {
|
|
74
|
-
const w = i.find((m) => m.id === e.baseVersionId), A = i.find((m) => m.id === e.targetVersionId);
|
|
75
|
-
T(e.baseVersionId, e.targetVersionId, w, A);
|
|
76
|
-
},
|
|
77
|
-
children: [/* @__PURE__ */ t(r.Item, {
|
|
78
|
-
label: "数据集",
|
|
79
|
-
children: /* @__PURE__ */ t("span", {
|
|
80
|
-
children: y || "-"
|
|
81
|
-
})
|
|
82
|
-
}), /* @__PURE__ */ t(r.Item, {
|
|
83
|
-
name: "baseVersionId",
|
|
84
|
-
label: "基准版本",
|
|
85
|
-
rules: [{
|
|
86
|
-
required: !0,
|
|
87
|
-
message: "请选择基准版本"
|
|
88
|
-
}],
|
|
89
|
-
children: /* @__PURE__ */ t(S, {
|
|
90
|
-
allowClear: !0,
|
|
91
|
-
placeholder: "请选择基准版本",
|
|
92
|
-
loading: V,
|
|
93
|
-
options: i.map((e) => ({
|
|
94
|
-
label: e.no,
|
|
95
|
-
value: e.id,
|
|
96
|
-
disabled: e.id === D
|
|
97
|
-
}))
|
|
98
|
-
})
|
|
99
|
-
}), /* @__PURE__ */ t(r.Item, {
|
|
100
|
-
name: "targetVersionId",
|
|
101
|
-
label: "目标版本",
|
|
102
|
-
rules: [{
|
|
103
|
-
required: !0,
|
|
104
|
-
message: "请选择目标版本"
|
|
105
|
-
}],
|
|
106
|
-
children: /* @__PURE__ */ t(S, {
|
|
107
|
-
allowClear: !0,
|
|
108
|
-
placeholder: "请选择目标版本",
|
|
109
|
-
loading: V,
|
|
110
|
-
options: i.map((e) => ({
|
|
111
|
-
label: e.no,
|
|
112
|
-
value: e.id,
|
|
113
|
-
disabled: e.id === v
|
|
114
|
-
}))
|
|
115
|
-
})
|
|
116
|
-
})]
|
|
117
|
-
})
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
export {
|
|
121
|
-
R as default
|
|
122
|
-
};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
var h = (e, o, t) => new Promise((s, i) => {
|
|
2
|
-
var u = (a) => {
|
|
3
|
-
try {
|
|
4
|
-
r(t.next(a));
|
|
5
|
-
} catch (l) {
|
|
6
|
-
i(l);
|
|
7
|
-
}
|
|
8
|
-
}, c = (a) => {
|
|
9
|
-
try {
|
|
10
|
-
r(t.throw(a));
|
|
11
|
-
} catch (l) {
|
|
12
|
-
i(l);
|
|
13
|
-
}
|
|
14
|
-
}, r = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(u, c);
|
|
15
|
-
r((t = t.apply(e, o)).next());
|
|
16
|
-
});
|
|
17
|
-
import U from "../../node_modules/dayjs/dayjs.min.mjs";
|
|
18
|
-
import { buildCompareLabelColorMap as $, injectSampleLabelColors as X } from "./utils/labelColors.mjs";
|
|
19
|
-
import { getMockVersionCompareSummary as Z, getMockVersionCompareSamples as _ } from "./mock.mjs";
|
|
20
|
-
import { tagColors as g } from "../../utils/index.mjs";
|
|
21
|
-
const ee = (e) => {
|
|
22
|
-
if (!e)
|
|
23
|
-
return "-";
|
|
24
|
-
if (typeof e == "string") {
|
|
25
|
-
const t = U(e);
|
|
26
|
-
return t.isValid() ? t.format("YYYY-MM-DD HH:mm:ss") : e;
|
|
27
|
-
}
|
|
28
|
-
const o = e < 1e12 ? e * 1e3 : e;
|
|
29
|
-
return U(o).format("YYYY-MM-DD HH:mm:ss");
|
|
30
|
-
}, k = (e, o = []) => {
|
|
31
|
-
var b, n, m, p, f, V, d, S, I, N, T, x, D, M, v, B, L, Y, z, E, R, H, O, A, F;
|
|
32
|
-
const t = (n = (b = e == null ? void 0 : e.overview) == null ? void 0 : b.baseVersion) != null ? n : {
|
|
33
|
-
totalSampleCount: 0,
|
|
34
|
-
labeledSampleCount: 0,
|
|
35
|
-
totalBoxCount: 0
|
|
36
|
-
}, s = (p = (m = e == null ? void 0 : e.overview) == null ? void 0 : m.targetVersion) != null ? p : {
|
|
37
|
-
totalSampleCount: 0,
|
|
38
|
-
labeledSampleCount: 0,
|
|
39
|
-
totalBoxCount: 0
|
|
40
|
-
}, i = [{
|
|
41
|
-
key: "totalSampleCount",
|
|
42
|
-
metricLabel: "数据总量",
|
|
43
|
-
baseValue: (f = t.totalSampleCount) != null ? f : 0,
|
|
44
|
-
targetValue: (V = s.totalSampleCount) != null ? V : 0,
|
|
45
|
-
diff: ((d = s.totalSampleCount) != null ? d : 0) - ((S = t.totalSampleCount) != null ? S : 0)
|
|
46
|
-
}, {
|
|
47
|
-
key: "labeledSampleCount",
|
|
48
|
-
metricLabel: "已标注数据量",
|
|
49
|
-
baseValue: (I = t.labeledSampleCount) != null ? I : 0,
|
|
50
|
-
targetValue: (N = s.labeledSampleCount) != null ? N : 0,
|
|
51
|
-
diff: ((T = s.labeledSampleCount) != null ? T : 0) - ((x = t.labeledSampleCount) != null ? x : 0)
|
|
52
|
-
}, {
|
|
53
|
-
key: "totalBoxCount",
|
|
54
|
-
metricLabel: "标注框总数",
|
|
55
|
-
baseValue: (D = t.totalBoxCount) != null ? D : 0,
|
|
56
|
-
targetValue: (M = s.totalBoxCount) != null ? M : 0,
|
|
57
|
-
diff: ((v = s.totalBoxCount) != null ? v : 0) - ((B = t.totalBoxCount) != null ? B : 0)
|
|
58
|
-
}], u = (L = e == null ? void 0 : e.labelComparisons) != null ? L : [], c = [...u.map((C) => C.label), ...o], r = $(c), a = u.map((C, w) => {
|
|
59
|
-
var q, G, J, Q;
|
|
60
|
-
const K = (q = C.baseBoxCount) != null ? q : 0, j = (G = C.baseSampleCount) != null ? G : 0, P = (J = C.targetBoxCount) != null ? J : 0, W = (Q = C.targetSampleCount) != null ? Q : 0;
|
|
61
|
-
return {
|
|
62
|
-
label: C.label,
|
|
63
|
-
color: r.get(C.label) || g[w % g.length],
|
|
64
|
-
baseBoxCount: K,
|
|
65
|
-
baseSampleCount: j,
|
|
66
|
-
targetBoxCount: P,
|
|
67
|
-
targetSampleCount: W,
|
|
68
|
-
boxDiff: P - K,
|
|
69
|
-
sampleDiff: W - j
|
|
70
|
-
};
|
|
71
|
-
}), l = (e == null ? void 0 : e.markType) === "ocr" && (!(e != null && e.ocrMarkTmpl) || e.ocrMarkTmpl === "DetectionOCR");
|
|
72
|
-
return {
|
|
73
|
-
datasetId: e.datasetId,
|
|
74
|
-
datasetName: e.datasetName || "",
|
|
75
|
-
markType: e.markType || "detection",
|
|
76
|
-
ocrMarkTmpl: e.ocrMarkTmpl,
|
|
77
|
-
isOcrDetection: l,
|
|
78
|
-
baseVersionId: e.baseVersionId,
|
|
79
|
-
baseVersionNo: e.baseVersionNo || e.baseVersionId,
|
|
80
|
-
targetVersionId: e.targetVersionId,
|
|
81
|
-
targetVersionNo: e.targetVersionNo || e.targetVersionId,
|
|
82
|
-
compareTime: e.compareTime,
|
|
83
|
-
formattedCompareTime: ee(e.compareTime),
|
|
84
|
-
overview: {
|
|
85
|
-
baseVersion: t,
|
|
86
|
-
targetVersion: s
|
|
87
|
-
},
|
|
88
|
-
overviewRows: i,
|
|
89
|
-
changeStats: {
|
|
90
|
-
addedCount: (z = (Y = e == null ? void 0 : e.changeStats) == null ? void 0 : Y.addedCount) != null ? z : 0,
|
|
91
|
-
deletedCount: (R = (E = e == null ? void 0 : e.changeStats) == null ? void 0 : E.deletedCount) != null ? R : 0,
|
|
92
|
-
modifiedCount: (O = (H = e == null ? void 0 : e.changeStats) == null ? void 0 : H.modifiedCount) != null ? O : 0,
|
|
93
|
-
unchangedCount: (F = (A = e == null ? void 0 : e.changeStats) == null ? void 0 : A.unchangedCount) != null ? F : 0
|
|
94
|
-
},
|
|
95
|
-
labelComparisons: a,
|
|
96
|
-
labelColorMap: r,
|
|
97
|
-
taskId: e.taskId,
|
|
98
|
-
taskStatus: e.taskStatus,
|
|
99
|
-
progress: e.progress
|
|
100
|
-
};
|
|
101
|
-
}, te = (e, o) => {
|
|
102
|
-
var i, u, c, r, a, l, b, n, m, p;
|
|
103
|
-
const t = o != null ? o : $([], [e.sample, (i = e.baseSample) != null ? i : void 0]);
|
|
104
|
-
[e.baseSample, e.sample].forEach((f) => {
|
|
105
|
-
var V;
|
|
106
|
-
(V = f == null ? void 0 : f.labels) == null || V.forEach((d) => {
|
|
107
|
-
const S = (d.label || d.id || "").trim();
|
|
108
|
-
S && !t.has(S) && t.set(S, g[t.size % g.length]);
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
const s = ((c = (u = e.sample) == null ? void 0 : u.sampleFileName) == null ? void 0 : c.name) || ((r = e.sample) == null ? void 0 : r.fileName) || ((l = (a = e.sample) == null ? void 0 : a.metadata) == null ? void 0 : l.fileName) || ((n = (b = e.baseSample) == null ? void 0 : b.sampleFileName) == null ? void 0 : n.name) || ((m = e.baseSample) == null ? void 0 : m.fileName) || e.fileKey || "未命名图片";
|
|
112
|
-
return {
|
|
113
|
-
fileKey: e.fileKey,
|
|
114
|
-
changeType: e.changeType,
|
|
115
|
-
sample: e.sample,
|
|
116
|
-
baseSample: (p = e.baseSample) != null ? p : null,
|
|
117
|
-
displayFileName: s,
|
|
118
|
-
targetColorLabels: X(e.sample, t),
|
|
119
|
-
baseColorLabels: X(e.baseSample, t)
|
|
120
|
-
};
|
|
121
|
-
}, y = (e, o) => {
|
|
122
|
-
var s, i, u, c, r, a;
|
|
123
|
-
const t = (i = (s = e == null ? void 0 : e.recordList) != null ? s : e == null ? void 0 : e.items) != null ? i : [];
|
|
124
|
-
return {
|
|
125
|
-
items: t.map((l) => te(l, o)),
|
|
126
|
-
total: (c = (u = e == null ? void 0 : e.totalResults) != null ? u : e == null ? void 0 : e.total) != null ? c : t.length,
|
|
127
|
-
pageNo: (r = e == null ? void 0 : e.pageNo) != null ? r : 1,
|
|
128
|
-
pageSize: (a = e == null ? void 0 : e.pageSize) != null ? a : 20
|
|
129
|
-
};
|
|
130
|
-
}, re = (s, i, ...u) => h(void 0, [s, i, ...u], function* (e, o, t = {}) {
|
|
131
|
-
const {
|
|
132
|
-
cvforceDatahub: c,
|
|
133
|
-
useMock: r = !1,
|
|
134
|
-
fallbackToMockOnError: a = !1,
|
|
135
|
-
mockScene: l,
|
|
136
|
-
mockDatasetName: b
|
|
137
|
-
} = t;
|
|
138
|
-
if (r) {
|
|
139
|
-
const n = Z({
|
|
140
|
-
datasetId: e,
|
|
141
|
-
baseVersionId: o.baseVersionId,
|
|
142
|
-
targetVersionId: o.targetVersionId,
|
|
143
|
-
scene: l,
|
|
144
|
-
datasetName: b
|
|
145
|
-
});
|
|
146
|
-
return k(n);
|
|
147
|
-
}
|
|
148
|
-
if (!c)
|
|
149
|
-
throw new Error("版本对比缺少数据接口客户端");
|
|
150
|
-
try {
|
|
151
|
-
const n = yield c.getDatasetVersionCompareSummary(e, o);
|
|
152
|
-
return k(n);
|
|
153
|
-
} catch (n) {
|
|
154
|
-
if ((n == null ? void 0 : n.name) === "AbortError")
|
|
155
|
-
throw n;
|
|
156
|
-
if (a) {
|
|
157
|
-
const m = Z({
|
|
158
|
-
datasetId: e,
|
|
159
|
-
baseVersionId: o.baseVersionId,
|
|
160
|
-
targetVersionId: o.targetVersionId,
|
|
161
|
-
scene: l,
|
|
162
|
-
datasetName: b
|
|
163
|
-
});
|
|
164
|
-
return k(m);
|
|
165
|
-
}
|
|
166
|
-
throw n;
|
|
167
|
-
}
|
|
168
|
-
}), me = (i, u, c, ...r) => h(void 0, [i, u, c, ...r], function* (e, o, t, s = {}) {
|
|
169
|
-
const {
|
|
170
|
-
cvforceDatahub: a,
|
|
171
|
-
useMock: l = !1,
|
|
172
|
-
fallbackToMockOnError: b = !1,
|
|
173
|
-
mockScene: n
|
|
174
|
-
} = s;
|
|
175
|
-
if (l) {
|
|
176
|
-
const m = _({
|
|
177
|
-
datasetId: e,
|
|
178
|
-
baseVersionId: o.baseVersionId,
|
|
179
|
-
targetVersionId: o.targetVersionId,
|
|
180
|
-
changeType: o.changeType,
|
|
181
|
-
pageNo: o.pageNo,
|
|
182
|
-
pageSize: o.pageSize,
|
|
183
|
-
scene: n
|
|
184
|
-
});
|
|
185
|
-
return y(m, t);
|
|
186
|
-
}
|
|
187
|
-
if (!a)
|
|
188
|
-
throw new Error("版本对比缺少数据接口客户端");
|
|
189
|
-
try {
|
|
190
|
-
const m = yield a.getDatasetVersionCompareSamples(e, o);
|
|
191
|
-
return y(m, t);
|
|
192
|
-
} catch (m) {
|
|
193
|
-
if (b) {
|
|
194
|
-
const p = _({
|
|
195
|
-
datasetId: e,
|
|
196
|
-
baseVersionId: o.baseVersionId,
|
|
197
|
-
targetVersionId: o.targetVersionId,
|
|
198
|
-
changeType: o.changeType,
|
|
199
|
-
pageNo: o.pageNo,
|
|
200
|
-
pageSize: o.pageSize,
|
|
201
|
-
scene: n
|
|
202
|
-
});
|
|
203
|
-
return y(p, t);
|
|
204
|
-
}
|
|
205
|
-
throw m;
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
export {
|
|
209
|
-
te as adaptVersionCompareSampleItem,
|
|
210
|
-
y as adaptVersionCompareSamples,
|
|
211
|
-
k as adaptVersionCompareSummary,
|
|
212
|
-
me as fetchVersionCompareSamplesWithAdapter,
|
|
213
|
-
re as fetchVersionCompareSummaryWithAdapter,
|
|
214
|
-
ee as formatCompareTimestamp
|
|
215
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { Tooltip as m } from "antd";
|
|
3
|
-
import { InfoCircleOutlined as u } from "@ant-design/icons";
|
|
4
|
-
const b = (r) => {
|
|
5
|
-
var s, i, c, t;
|
|
6
|
-
const {
|
|
7
|
-
baseVersionNo: o,
|
|
8
|
-
targetVersionNo: v,
|
|
9
|
-
changeStats: e
|
|
10
|
-
} = r, n = [{
|
|
11
|
-
key: "added",
|
|
12
|
-
label: "新增图片数",
|
|
13
|
-
value: (s = e == null ? void 0 : e.addedCount) != null ? s : 0,
|
|
14
|
-
valueClassName: "is-added"
|
|
15
|
-
}, {
|
|
16
|
-
key: "deleted",
|
|
17
|
-
label: "删除图片数",
|
|
18
|
-
value: (i = e == null ? void 0 : e.deletedCount) != null ? i : 0,
|
|
19
|
-
valueClassName: "is-deleted"
|
|
20
|
-
}, {
|
|
21
|
-
key: "modified",
|
|
22
|
-
label: "修改图片数",
|
|
23
|
-
value: (c = e == null ? void 0 : e.modifiedCount) != null ? c : 0,
|
|
24
|
-
valueClassName: "is-modified"
|
|
25
|
-
}, {
|
|
26
|
-
key: "unchanged",
|
|
27
|
-
label: "无变动图片数",
|
|
28
|
-
value: (t = e == null ? void 0 : e.unchangedCount) != null ? t : 0,
|
|
29
|
-
valueClassName: "is-unchanged",
|
|
30
|
-
tooltip: "图片标注信息无变动"
|
|
31
|
-
}];
|
|
32
|
-
return /* @__PURE__ */ d("div", {
|
|
33
|
-
className: "vc-card vc-stats-card",
|
|
34
|
-
children: [/* @__PURE__ */ d("div", {
|
|
35
|
-
className: "vc-card-header",
|
|
36
|
-
children: [/* @__PURE__ */ l("h3", {
|
|
37
|
-
className: "vc-card-title",
|
|
38
|
-
children: "数据变动统计"
|
|
39
|
-
}), /* @__PURE__ */ d("span", {
|
|
40
|
-
className: "vc-card-subtitle",
|
|
41
|
-
children: ["(", o || "-", " → ", v || "-", ")"]
|
|
42
|
-
})]
|
|
43
|
-
}), /* @__PURE__ */ l("div", {
|
|
44
|
-
className: "vc-stats-grid",
|
|
45
|
-
children: n.map((a) => /* @__PURE__ */ d("div", {
|
|
46
|
-
className: "vc-stat-item-card",
|
|
47
|
-
children: [/* @__PURE__ */ d("div", {
|
|
48
|
-
className: "vc-stat-item-label",
|
|
49
|
-
children: [/* @__PURE__ */ l("span", {
|
|
50
|
-
children: a.label
|
|
51
|
-
}), a.tooltip && /* @__PURE__ */ l(m, {
|
|
52
|
-
title: a.tooltip,
|
|
53
|
-
children: /* @__PURE__ */ l(u, {
|
|
54
|
-
className: "vc-stat-info-icon",
|
|
55
|
-
"aria-label": "无变动说明"
|
|
56
|
-
})
|
|
57
|
-
})]
|
|
58
|
-
}), /* @__PURE__ */ l("div", {
|
|
59
|
-
className: `vc-stat-item-value ${a.valueClassName}`,
|
|
60
|
-
children: a.value
|
|
61
|
-
})]
|
|
62
|
-
}, a.key))
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
export {
|
|
67
|
-
b as default
|
|
68
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import o from "classnames";
|
|
3
|
-
const N = (d) => {
|
|
4
|
-
const {
|
|
5
|
-
value: a,
|
|
6
|
-
diff: i,
|
|
7
|
-
baseValue: f,
|
|
8
|
-
targetValue: e,
|
|
9
|
-
gap: l = 8,
|
|
10
|
-
className: n
|
|
11
|
-
} = d, c = a != null ? a : e, s = i !== void 0 ? i : e !== void 0 && f !== void 0 ? e - f : 0, r = s !== 0 && !Number.isNaN(s), m = s > 0 ? `+${s}` : `${s}`;
|
|
12
|
-
return /* @__PURE__ */ p("span", {
|
|
13
|
-
className: o("vc-diff-value-wrapper", n),
|
|
14
|
-
style: {
|
|
15
|
-
gap: l
|
|
16
|
-
},
|
|
17
|
-
children: [c !== void 0 && /* @__PURE__ */ t("span", {
|
|
18
|
-
className: "vc-diff-main-value",
|
|
19
|
-
children: c
|
|
20
|
-
}), r && /* @__PURE__ */ t("span", {
|
|
21
|
-
className: o("vc-diff-badge", {
|
|
22
|
-
"is-positive": s > 0,
|
|
23
|
-
"is-negative": s < 0
|
|
24
|
-
}),
|
|
25
|
-
children: m
|
|
26
|
-
})]
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
N as default
|
|
31
|
-
};
|