@glodon-aiot/dataset-annotation 3.0.5-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.git.md +73 -0
  2. package/README.lib.md +262 -0
  3. package/dist/dataset-annotation.js +123598 -0
  4. package/dist/dataset-annotation.umd.cjs +1017 -0
  5. package/dist/example/DatasetAnnotationDemo.d.ts +3 -0
  6. package/dist/example/DemoTabs.d.ts +3 -0
  7. package/dist/example/DetectionDatasetDemo.d.ts +5 -0
  8. package/dist/example/DetectionImageDemo.d.ts +5 -0
  9. package/dist/example/OcrDatasetDemo.d.ts +5 -0
  10. package/dist/example/OcrImageDemo.d.ts +5 -0
  11. package/dist/example/OcrkvcDatasetDemo.d.ts +5 -0
  12. package/dist/example/constant.local.d.ts +6 -0
  13. package/dist/example/index.d.ts +1 -0
  14. package/dist/src/Common/Page/index.d.ts +9 -0
  15. package/dist/src/Common/PageContent/index.d.ts +6 -0
  16. package/dist/src/Common/PageHeader/index.d.ts +12 -0
  17. package/dist/src/DatasetContext/index.d.ts +22 -0
  18. package/dist/src/api.d.ts +2 -0
  19. package/dist/src/components/CompositionInput/index.d.ts +7 -0
  20. package/dist/src/components/DataEmpty/index.d.ts +14 -0
  21. package/dist/src/components/DetectionAnnotation/PreSamplesPage/index.d.ts +13 -0
  22. package/dist/src/components/DetectionAnnotation/components/DetailPageHeader/index.d.ts +5 -0
  23. package/dist/src/components/DetectionAnnotation/components/DisabledTooltip/index.d.ts +8 -0
  24. package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +27 -0
  25. package/dist/src/components/DetectionAnnotation/components/LabelMaker/Drawable.d.ts +8 -0
  26. package/dist/src/components/DetectionAnnotation/components/LabelMaker/FabricCustomize.d.ts +2 -0
  27. package/dist/src/components/DetectionAnnotation/components/LabelMaker/RectLabel.d.ts +63 -0
  28. package/dist/src/components/DetectionAnnotation/components/LabelMaker/index.d.ts +33 -0
  29. package/dist/src/components/DetectionAnnotation/components/Labels/index.d.ts +19 -0
  30. package/dist/src/components/DetectionAnnotation/components/TagItem/index.d.ts +21 -0
  31. package/dist/src/components/DetectionAnnotation/components/TagList/index.d.ts +8 -0
  32. package/dist/src/components/DetectionAnnotation/index.d.ts +7 -0
  33. package/dist/src/components/DetectionImageAnnotation/index.d.ts +22 -0
  34. package/dist/src/components/Iconfont/index.d.ts +3 -0
  35. package/dist/src/components/MarkDescriptions/index.d.ts +9 -0
  36. package/dist/src/components/OCRImageViewer/index.d.ts +36 -0
  37. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/CategoryDrawer.d.ts +8 -0
  38. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorInput.d.ts +12 -0
  39. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LabelEditorItem.d.ts +22 -0
  40. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/LableEditor.d.ts +17 -0
  41. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.d.ts +16 -0
  42. package/dist/src/components/OcrAnnotation/MarkKVOCRModal/index.d.ts +14 -0
  43. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/ImageDetail/index.d.ts +17 -0
  44. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorInput.d.ts +12 -0
  45. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LabelEditorItem.d.ts +22 -0
  46. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/LableEditor.d.ts +17 -0
  47. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.d.ts +20 -0
  48. package/dist/src/components/OcrAnnotation/MarkOCRBoxModal/index.d.ts +14 -0
  49. package/dist/src/components/OcrAnnotation/OcrModal/index.d.ts +18 -0
  50. package/dist/src/components/OcrAnnotation/PreLabelOCR/PreLabelModal.d.ts +18 -0
  51. package/dist/src/components/OcrAnnotation/PreLabelOCR/index.d.ts +13 -0
  52. package/dist/src/components/OcrAnnotation/constant.d.ts +2 -0
  53. package/dist/src/components/OcrAnnotation/index.d.ts +7 -0
  54. package/dist/src/components/OcrImageAnnotation/index.d.ts +20 -0
  55. package/dist/src/components/PageNav/index.d.ts +10 -0
  56. package/dist/src/components/PicZipImportModal/index.d.ts +43 -0
  57. package/dist/src/components/PreLabelOCR/PreLabelModal.d.ts +18 -0
  58. package/dist/src/components/PreLabelOCR/index.d.ts +13 -0
  59. package/dist/src/components/ScanTable/index.d.ts +10 -0
  60. package/dist/src/components/Thumbnail/index.d.ts +10 -0
  61. package/dist/src/components/hooks/Prompt.d.ts +6 -0
  62. package/dist/src/components/hooks/useBlocker.d.ts +2 -0
  63. package/dist/src/constant.d.ts +14 -0
  64. package/dist/src/createDatasetAnnotation/index.d.ts +16 -0
  65. package/dist/src/createDetectionDatasetAnnotation/index.d.ts +16 -0
  66. package/dist/src/createDetectionImageAnnotation/index.d.ts +18 -0
  67. package/dist/src/createOcrDatasetAnnotation/index.d.ts +16 -0
  68. package/dist/src/createOcrImageAnnotation/index.d.ts +19 -0
  69. package/dist/src/featuresConfig.d.ts +50 -0
  70. package/dist/src/index.d.ts +5 -0
  71. package/dist/src/utils/color.d.ts +15 -0
  72. package/dist/src/utils/index.d.ts +18 -0
  73. package/dist/src/utils/sign.d.ts +8 -0
  74. package/package.json +128 -0
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DatasetAnnotationDemo: React.FC;
3
+ export default DatasetAnnotationDemo;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const DemoTabs: () => JSX.Element;
3
+ export default DemoTabs;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface DetectionDatasetDemoProps {
3
+ }
4
+ declare const DetectionDatasetDemo: React.FC<DetectionDatasetDemoProps>;
5
+ export default DetectionDatasetDemo;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface DetectionImageDemoProps {
3
+ }
4
+ declare const DetectionImageDemo: React.FC<DetectionImageDemoProps>;
5
+ export default DetectionImageDemo;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface OcrDatasetDemoProps {
3
+ }
4
+ declare const OcrDatasetDemo: React.FC<OcrDatasetDemoProps>;
5
+ export default OcrDatasetDemo;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface OcrImageDemoProps {
3
+ }
4
+ declare const OcrImageDemo: React.FC<OcrImageDemoProps>;
5
+ export default OcrImageDemo;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ interface OcrkvcDatasetDemoProps {
3
+ }
4
+ declare const OcrkvcDatasetDemo: React.FC<OcrkvcDatasetDemoProps>;
5
+ export default OcrkvcDatasetDemo;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 重要提示
3
+ * 必须替换自己的token, 可以是user token, 也可以是resource token
4
+ */
5
+ export declare const TEST_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MzkzNDc5NjksImlhdCI6MTczOTM0MzQzOCwicm8iOiJ1c2VyIiwidGVuIjoiZ2xkY3YiLCJ1aWQiOiIxOSJ9.au9CgObfa7LPvb7ZiwSqH1Eqbp0NdR3r0D9ea1-C4oo";
6
+ export declare const TEST_API_URL = "https://aiot-dev.glodon.com/api/aecpilotdev/data";
@@ -0,0 +1 @@
1
+ import './style.less';
@@ -0,0 +1,9 @@
1
+ import React, { ReactElement } from 'react';
2
+ import './style.less';
3
+ interface PageProps {
4
+ className?: string;
5
+ title?: string;
6
+ header?: ReactElement;
7
+ }
8
+ declare const Page: React.FC<PageProps>;
9
+ export default Page;
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface PageContentProps {
3
+ }
4
+ export interface State {
5
+ }
6
+ export default function PageContent(props: PropsWithChildren<PageContentProps>): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { PropsWithChildren, ReactNode } from 'react';
2
+ import './style.less';
3
+ export interface PageHeaderProps {
4
+ breadcrumb?: ReactNode;
5
+ title: ReactNode;
6
+ icon?: ReactNode;
7
+ actions?: ReactNode;
8
+ className?: string;
9
+ }
10
+ export interface State {
11
+ }
12
+ export default function PageHeader(props: PropsWithChildren<PageHeaderProps>): JSX.Element;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { AIShopApi, CVForceDatahubApi, IDataSet, IPagination, ISample, IVersion, ModelServiceApi } from "@glodon-aiot/apis";
3
+ import { FeaturesConfig } from "../featuresConfig";
4
+ interface DatasetDetails {
5
+ datasetId: string;
6
+ versionId: string;
7
+ no: string;
8
+ loading: boolean;
9
+ dataset?: IDataSet;
10
+ version?: IVersion;
11
+ versions?: IVersion[];
12
+ samples?: ISample[];
13
+ pagination?: IPagination;
14
+ services: {
15
+ cvforceDatahub?: CVForceDatahubApi;
16
+ cvforceModelService?: ModelServiceApi;
17
+ aiShop?: AIShopApi;
18
+ };
19
+ featuresConfig?: FeaturesConfig;
20
+ }
21
+ declare const DatasetContext: import("react").Context<DatasetDetails>;
22
+ export default DatasetContext;
@@ -0,0 +1,2 @@
1
+ import { CVForceDatahubApi } from '@glodon-aiot/apis';
2
+ export declare function getCVForceDatahubService(apiBase: string, token: string, errorHandler: (status: number, message: string) => void): CVForceDatahubApi;
@@ -0,0 +1,7 @@
1
+ import { InputProps } from "antd";
2
+ import React from "react";
3
+ interface ICompositionInputProps extends Omit<InputProps, "onChange"> {
4
+ onChange?: (value: string) => void;
5
+ }
6
+ declare const _default: React.MemoExoticComponent<(props: ICompositionInputProps) => JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ interface DataEmptyProps {
4
+ emptyClassName?: string;
5
+ emptyStyle?: React.CSSProperties;
6
+ image?: React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ showBtn?: boolean;
9
+ btnText?: string;
10
+ handleClick?: () => void;
11
+ children?: React.ReactNode;
12
+ }
13
+ declare const DataEmpty: React.FC<DataEmptyProps>;
14
+ export default DataEmpty;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ import { ILabel, ISample } from '@glodon-aiot/apis';
4
+ interface IPreSamplesProps {
5
+ datasetId: string;
6
+ versionId: string;
7
+ onClose: VoidFunction;
8
+ samples: ISample[];
9
+ labels: ILabel[];
10
+ fetchLength: VoidFunction;
11
+ }
12
+ declare const PreSamplesPage: React.FC<IPreSamplesProps>;
13
+ export default PreSamplesPage;
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ interface DetailPageHeaderProps {
3
+ }
4
+ declare const DetailPageHeader: FC<DetailPageHeaderProps>;
5
+ export default DetailPageHeader;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { TooltipPlacement } from "antd/es/tooltip";
3
+ interface ImageDetailProps {
4
+ isPreLabel: boolean;
5
+ placement?: TooltipPlacement;
6
+ }
7
+ declare const DisabledTooltip: React.FC<ImageDetailProps>;
8
+ export default DisabledTooltip;
@@ -0,0 +1,27 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import './style.less';
3
+ import { ILabel, ISample } from '@glodon-aiot/apis';
4
+ import { LabelItem } from '../../../DetectionImageAnnotation';
5
+ interface ImageDetailProps {
6
+ datasetId: string;
7
+ isImageDetailVisible: boolean;
8
+ setIsImageDetailVisible: Dispatch<SetStateAction<boolean>>;
9
+ currentSample?: ISample;
10
+ onNextClick?: VoidFunction;
11
+ onPrevClick?: VoidFunction;
12
+ labels?: ILabel[];
13
+ editing?: boolean;
14
+ onRefresh?: VoidFunction;
15
+ onChange?: (sample: ISample) => void;
16
+ isPreLabel?: boolean;
17
+ settingHide?: boolean;
18
+ imgCount?: {
19
+ total: number;
20
+ index: number;
21
+ };
22
+ readonly?: boolean;
23
+ showLabelList?: boolean | ILabel[];
24
+ renderLabelItem?: (label: LabelItem) => string;
25
+ }
26
+ declare const ImageDetail: React.FC<ImageDetailProps>;
27
+ export default ImageDetail;
@@ -0,0 +1,8 @@
1
+ import { LabelBox } from ".";
2
+ import { fabric } from "fabric";
3
+ /**
4
+ * @name stopDraw 停止绘制
5
+ * @param canvas fabric Canvas
6
+ */
7
+ export declare const stopDraw: (canvas: fabric.Canvas) => void;
8
+ export declare function drawable(canvas: fabric.Canvas, onCreate: (rect: LabelBox) => void, disabled?: boolean): fabric.Canvas | undefined;
@@ -0,0 +1,2 @@
1
+ declare function fabricCustomize(fabric: any): void;
2
+ export default fabricCustomize;
@@ -0,0 +1,63 @@
1
+ import { fabric } from "fabric";
2
+ import { Color } from "../../../../utils/color";
3
+ type ControlName = "TL" | "BL" | "TR" | "BR" | "ML" | "MB" | "MR" | "MT" | "MTR";
4
+ interface RectLabelConfig {
5
+ id: string;
6
+ name: string;
7
+ color: Color;
8
+ points: [number, number][];
9
+ borderWidth?: number;
10
+ controls?: ControlName[];
11
+ cornerColor?: string;
12
+ cornerStrokeColor?: string;
13
+ cornerSize?: number;
14
+ visible?: boolean;
15
+ active?: boolean;
16
+ hideDelete?: boolean;
17
+ extra?: any;
18
+ renderExtra?: (extra: any) => string;
19
+ }
20
+ declare class RectLabel {
21
+ private _canvas;
22
+ handlers: {
23
+ onChange?: (v: RectLabel) => void;
24
+ onDelete?: (v: RectLabel) => void;
25
+ renderLabelItem?: (config: RectLabelConfig) => string;
26
+ };
27
+ config: RectLabelConfig;
28
+ private color;
29
+ private _active;
30
+ private _fabricRect;
31
+ private _label;
32
+ private _hover;
33
+ private _strokeRect;
34
+ constructor(labelConfig: RectLabelConfig, _canvas: fabric.Canvas, handlers: {
35
+ onChange?: (v: RectLabel) => void;
36
+ onDelete?: (v: RectLabel) => void;
37
+ renderLabelItem?: (config: RectLabelConfig) => string;
38
+ });
39
+ get object(): fabric.Rect | null;
40
+ get active(): boolean;
41
+ set active(v: boolean);
42
+ get hover(): boolean;
43
+ set hover(v: boolean);
44
+ get canvas(): fabric.Canvas;
45
+ set canvas(v: fabric.Canvas);
46
+ get normalStyle(): fabric.IPolylineOptions;
47
+ get activeStyle(): fabric.IPolylineOptions;
48
+ get hoverStyle(): fabric.IPolylineOptions;
49
+ createRect(): fabric.Rect;
50
+ scaledNumber(v: number): number;
51
+ createLabelName(): fabric.Group;
52
+ renderLabel(): void;
53
+ setLabelPosition(): void;
54
+ addToCanvas(canvas: any): void;
55
+ render(canvas: any): void;
56
+ set labelConfig(config: {
57
+ id: string;
58
+ name: string;
59
+ color: string;
60
+ });
61
+ destroy(): void;
62
+ }
63
+ export default RectLabel;
@@ -0,0 +1,33 @@
1
+ import { FC } from 'react';
2
+ import { fabric } from 'fabric';
3
+ import './style.less';
4
+ import { ILabel } from '@glodon-aiot/apis';
5
+ import { LabelItem } from '../../../DetectionImageAnnotation';
6
+ interface Point {
7
+ x: number;
8
+ y: number;
9
+ }
10
+ export interface LabelBox {
11
+ id: string;
12
+ label: string;
13
+ color: string;
14
+ box: [number, number][];
15
+ }
16
+ interface LabelMakerProps {
17
+ imageUrl: string;
18
+ labels: LabelBox[];
19
+ pen?: ILabel;
20
+ onImageLoad?: VoidFunction;
21
+ onChange?: (labelBoxes: LabelBox[]) => void;
22
+ isPreLabel?: boolean;
23
+ disabled?: boolean;
24
+ renderLabelItem?: (label: LabelItem) => string;
25
+ }
26
+ type RGBColor = [r: number, g: number, b: number];
27
+ /**
28
+ * @name createPolygon 绘制矩形
29
+ * @param canvas fabric Canvas
30
+ */
31
+ export declare const createPolygon: (points: Point[], [r, g, b]: RGBColor) => fabric.Polygon;
32
+ declare const LabelMaker: FC<LabelMakerProps>;
33
+ export default LabelMaker;
@@ -0,0 +1,19 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ import { ILabel, Label } from '@glodon-aiot/apis';
4
+ interface LabelsProps {
5
+ datasetId: string;
6
+ data: ILabel[];
7
+ selected?: ILabel[];
8
+ showZero?: boolean;
9
+ selectMode?: 'multiple' | 'single';
10
+ shortcut?: boolean;
11
+ onItemClick?: (label: Label) => VoidFunction;
12
+ onSelectedChange?: (selected: Label[]) => void;
13
+ onRefresh?: VoidFunction;
14
+ onListChange?: (labels: Label[]) => void;
15
+ isPreLabel?: boolean;
16
+ settingHide?: boolean;
17
+ }
18
+ declare const Labels: FC<LabelsProps>;
19
+ export default Labels;
@@ -0,0 +1,21 @@
1
+ import React, { ReactNode } from 'react';
2
+ import './style.less';
3
+ import { KeyFilter } from 'ahooks/lib/useKeyPress';
4
+ export interface Tag {
5
+ }
6
+ export interface TagItemProps {
7
+ label: string;
8
+ color: string;
9
+ isActive?: boolean;
10
+ extra?: ReactNode;
11
+ editMode?: boolean;
12
+ editable?: boolean;
13
+ shortcut?: KeyFilter;
14
+ onClick?: VoidFunction;
15
+ onSave?: (v: string) => Promise<boolean>;
16
+ onCancel?: VoidFunction;
17
+ onDelete?: VoidFunction;
18
+ onCheckDuplication?: (v: string) => Promise<boolean>;
19
+ }
20
+ declare const TagItem: React.FC<TagItemProps>;
21
+ export default TagItem;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface CategoryListProps {
3
+ datasetId: string;
4
+ visible: boolean;
5
+ onClose: (update: boolean) => void;
6
+ }
7
+ declare const CategoryList: FC<CategoryListProps>;
8
+ export default CategoryList;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ import { AnnotationProps } from '../../featuresConfig';
4
+ interface DetectionAnnotationProps extends AnnotationProps {
5
+ }
6
+ declare const DetectionAnnotation: React.FC<DetectionAnnotationProps>;
7
+ export default DetectionAnnotation;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import './style.less';
3
+ import { ILabel, TInfer } from '@glodon-aiot/apis';
4
+ export interface LabelExtra {
5
+ [key: string]: any;
6
+ }
7
+ export type LabelItem = TInfer & LabelExtra;
8
+ export interface DetectionLabelmakerValue {
9
+ fileUrl: string;
10
+ labels: LabelItem[];
11
+ }
12
+ export interface DetectionLabelmakerProps {
13
+ value: DetectionLabelmakerValue;
14
+ onChange?: (value: DetectionLabelmakerValue) => void;
15
+ readonly?: boolean;
16
+ onNextClick?: VoidFunction;
17
+ onPrevClick?: VoidFunction;
18
+ showLabelList?: boolean | ILabel[];
19
+ renderLabelItem?: (label: LabelItem) => string;
20
+ }
21
+ declare const DetectionLabelmaker: (props: DetectionLabelmakerProps) => JSX.Element;
22
+ export default DetectionLabelmaker;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Iconfont: import("react").FC<import("@ant-design/icons/lib/components/IconFont").IconFontProps<string>>;
3
+ export default Iconfont;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ import { Category, TInfer } from '@glodon-aiot/apis';
4
+ interface MarkDescriptionsProps {
5
+ labels: TInfer[];
6
+ catagories: Category[];
7
+ }
8
+ declare const MarkDescriptions: FC<MarkDescriptionsProps>;
9
+ export default MarkDescriptions;
@@ -0,0 +1,36 @@
1
+ import React, { CSSProperties, ReactNode } from 'react';
2
+ import './style.less';
3
+ import { TInfer } from '@glodon-aiot/apis';
4
+ interface OCRImageViewerProps {
5
+ url: string;
6
+ pointSize?: number;
7
+ direction?: number;
8
+ activePointId?: string;
9
+ lineStyle?: CSSProperties;
10
+ pointStyle?: CSSProperties;
11
+ directionStyle?: CSSProperties;
12
+ trackEditable?: boolean;
13
+ trackEditing?: boolean;
14
+ keepRatio?: boolean;
15
+ passes?: any;
16
+ activePassId?: number;
17
+ passStyle?: CSSProperties;
18
+ activePassStyle?: CSSProperties;
19
+ marks?: any;
20
+ draggable?: boolean;
21
+ zoomable?: boolean;
22
+ zoomStep?: number;
23
+ offsetEdge?: number[];
24
+ zoomMax?: number;
25
+ zoomMin?: number;
26
+ children?: ReactNode;
27
+ labels?: TInfer[];
28
+ onImageLoad?: (img: HTMLImageElement) => void;
29
+ }
30
+ export interface OCRImageViewerRefProps {
31
+ onImageLoad?: (img: HTMLImageElement) => void;
32
+ zoomIn: (zoom?: number) => void;
33
+ zoomOut: (zoom?: number) => void;
34
+ }
35
+ declare const OCRImageViewer: React.ForwardRefExoticComponent<OCRImageViewerProps & React.RefAttributes<OCRImageViewerRefProps>>;
36
+ export default OCRImageViewer;
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ interface CatagoryDrawerProps {
3
+ datasetId: string;
4
+ visible: boolean;
5
+ onClose: (update: boolean) => void;
6
+ }
7
+ declare const CatagoryDrawer: FC<CatagoryDrawerProps>;
8
+ export default CatagoryDrawer;
@@ -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;
@@ -0,0 +1,22 @@
1
+ import { FC } from "react";
2
+ import "./style.less";
3
+ export interface OCRLabel {
4
+ uuid: string;
5
+ box: [number, number][];
6
+ words: string;
7
+ type?: string;
8
+ catagoryId?: string;
9
+ }
10
+ interface LabelEditorItemProps {
11
+ name: string;
12
+ catagoryId: string;
13
+ values: OCRLabel[];
14
+ selectedLabel?: OCRLabel;
15
+ holdingLabel?: OCRLabel;
16
+ clearHoldingLabel?: VoidFunction;
17
+ onChange: (values: OCRLabel[]) => void;
18
+ onRemove: (label: OCRLabel) => void;
19
+ onSelect?: (value?: Partial<OCRLabel>) => void;
20
+ }
21
+ declare const LabelEditorItem: FC<LabelEditorItemProps>;
22
+ export default LabelEditorItem;
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ import { OCRLabel } from './LabelEditorItem';
4
+ import { Category } from '@glodon-aiot/apis';
5
+ interface LabelEditorProps {
6
+ category: Category;
7
+ selectedLabel?: OCRLabel;
8
+ holdingLabel?: OCRLabel;
9
+ type?: OCRLabel[];
10
+ value?: OCRLabel[];
11
+ clearHoldingLabel?: VoidFunction;
12
+ onChange: (type: OCRLabel[], value: OCRLabel[]) => void;
13
+ onRemove: (label: OCRLabel) => void;
14
+ onSelect?: (value?: Partial<OCRLabel>) => void;
15
+ }
16
+ declare const LabelEditor: FC<LabelEditorProps>;
17
+ export default LabelEditor;
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ import { OCRLabel } from './LabelEditorItem';
3
+ interface Category {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ interface KVOCRLabelMakerProps {
8
+ id: string;
9
+ imageUrl: string;
10
+ canvasElement: HTMLCanvasElement | null;
11
+ categories: Category[];
12
+ labels: OCRLabel[];
13
+ onChange: (labels: OCRLabel[]) => void;
14
+ }
15
+ declare const KVOCRLabelMaker: FC<KVOCRLabelMakerProps>;
16
+ export default KVOCRLabelMaker;
@@ -0,0 +1,14 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ import { ISample } from '@glodon-aiot/apis';
4
+ interface MarkKVOCRModalProps {
5
+ visible: boolean;
6
+ selectSampleId?: string;
7
+ datasetId?: string;
8
+ versionId?: string;
9
+ ocrMarkTmpl?: string;
10
+ onClose: VoidFunction;
11
+ onSave: (record: ISample) => Promise<boolean>;
12
+ }
13
+ declare const MarkKVOCRModal: FC<MarkKVOCRModalProps>;
14
+ export default MarkKVOCRModal;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ import { Category, ILabel, ISample } from '@glodon-aiot/apis';
4
+ import { LabelItem } from '../../../DetectionImageAnnotation';
5
+ interface ImageDetailProps {
6
+ currentSample?: ISample;
7
+ onNextClick?: VoidFunction;
8
+ onPrevClick?: VoidFunction;
9
+ labels?: ILabel[];
10
+ onRefresh?: VoidFunction;
11
+ onChange?: (sample: ISample) => void;
12
+ readonly?: boolean;
13
+ categories: Category[];
14
+ renderLabelItem?: (label: LabelItem) => string;
15
+ }
16
+ declare const ImageDetail: React.FC<ImageDetailProps>;
17
+ export default ImageDetail;
@@ -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;
@@ -0,0 +1,22 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ export interface OCRLabel {
4
+ uuid: string;
5
+ box: [number, number][];
6
+ words: string;
7
+ type?: string;
8
+ catagoryId?: string;
9
+ }
10
+ interface LabelEditorItemProps {
11
+ name: string;
12
+ catagoryId: string;
13
+ values: OCRLabel[];
14
+ selectedLabel?: OCRLabel;
15
+ holdingLabel?: OCRLabel;
16
+ clearHoldingLabel?: VoidFunction;
17
+ onChange: (values: OCRLabel[]) => void;
18
+ onRemove: (label: OCRLabel) => void;
19
+ onSelect?: (value?: Partial<OCRLabel>) => void;
20
+ }
21
+ declare const LabelEditorItem: FC<LabelEditorItemProps>;
22
+ export default LabelEditorItem;
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ import './style.less';
3
+ import { OCRLabel } from './LabelEditorItem';
4
+ import { Category } from '@glodon-aiot/apis';
5
+ interface LabelEditorProps {
6
+ category: Category;
7
+ selectedLabel?: OCRLabel;
8
+ holdingLabel?: OCRLabel;
9
+ type?: OCRLabel[];
10
+ value?: OCRLabel[];
11
+ clearHoldingLabel?: VoidFunction;
12
+ onChange: (type: OCRLabel[], value: OCRLabel[]) => void;
13
+ onRemove: (label: OCRLabel) => void;
14
+ onSelect?: (value?: Partial<OCRLabel>) => void;
15
+ }
16
+ declare const LabelEditor: FC<LabelEditorProps>;
17
+ export default LabelEditor;
@@ -0,0 +1,20 @@
1
+ import { FC } from 'react';
2
+ import { OCRLabel } from './LabelEditorItem';
3
+ import './style.less';
4
+ import { LabelItem } from '../../../DetectionImageAnnotation';
5
+ interface Category {
6
+ id: string;
7
+ name: string;
8
+ }
9
+ interface OCRBoxMakerProps {
10
+ disabled?: boolean;
11
+ id: string;
12
+ imageUrl: string;
13
+ canvasElement: HTMLCanvasElement | null;
14
+ categories: Category[];
15
+ labels: OCRLabel[];
16
+ onChange: (labels: OCRLabel[]) => void;
17
+ renderLabelItem?: (label: LabelItem) => string;
18
+ }
19
+ declare const OCRBoxMaker: FC<OCRBoxMakerProps>;
20
+ export default OCRBoxMaker;