forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcvat-core-wrapper.ts
119 lines (111 loc) · 3.43 KB
/
cvat-core-wrapper.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) 2023-2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import CVATCore from 'cvat-core/src';
import _cvat from 'cvat-core/src/api';
import ObjectState from 'cvat-core/src/object-state';
import Webhook from 'cvat-core/src/webhook';
import MLModel from 'cvat-core/src/ml-model';
import CloudStorage from 'cvat-core/src/cloud-storage';
import { ModelProvider } from 'cvat-core/src/lambda-manager';
import {
Label, Attribute,
} from 'cvat-core/src/labels';
import {
SerializedAttribute, SerializedLabel, SerializedAPISchema,
} from 'cvat-core/src/server-response-types';
import { Job, Task } from 'cvat-core/src/session';
import Project from 'cvat-core/src/project';
import QualityReport, { QualitySummary } from 'cvat-core/src/quality-report';
import QualityConflict, { AnnotationConflict, ConflictSeverity } from 'cvat-core/src/quality-conflict';
import QualitySettings from 'cvat-core/src/quality-settings';
import { FramesMetaData, FrameData } from 'cvat-core/src/frames';
import { ServerError, RequestError } from 'cvat-core/src/exceptions';
import {
ShapeType, LabelType, ModelKind, ModelProviders,
ModelReturnType, DimensionType, JobType,
JobStage, JobState, RQStatus,
} from 'cvat-core/src/enums';
import { Storage, StorageData } from 'cvat-core/src/storage';
import Issue from 'cvat-core/src/issue';
import Comment from 'cvat-core/src/comment';
import User from 'cvat-core/src/user';
import Organization, { Membership, Invitation } from 'cvat-core/src/organization';
import AnnotationGuide from 'cvat-core/src/guide';
import AnalyticsReport, { AnalyticsEntryViewType, AnalyticsEntry } from 'cvat-core/src/analytics-report';
import { Dumper } from 'cvat-core/src/annotation-formats';
import { Event } from 'cvat-core/src/event';
import { APIWrapperEnterOptions } from 'cvat-core/src/plugins';
import BaseSingleFrameAction, { ActionParameterType, FrameSelectionType } from 'cvat-core/src/annotations-actions';
import { Request } from 'cvat-core/src/request';
const cvat: CVATCore = _cvat;
cvat.config.backendAPI = '/api';
cvat.config.origin = window.location.origin;
// Set the TUS chunk size to 2 MB. A small value works better in case of a slow internet connection.
// A larger value may cause a server-side timeout errors in the current implementation.
cvat.config.uploadChunkSize = 2;
(globalThis as any).cvat = cvat;
function getCore(): typeof cvat {
return cvat;
}
type ProjectOrTaskOrJob = Project | Task | Job;
export {
getCore,
ObjectState,
Label,
Job,
Task,
Project,
AnnotationGuide,
Attribute,
ShapeType,
LabelType,
Storage,
Webhook,
Issue,
User,
CloudStorage,
Organization,
Membership,
Invitation,
Comment,
MLModel,
ModelKind,
ModelProviders,
ModelReturnType,
DimensionType,
Dumper,
JobType,
JobStage,
JobState,
RQStatus,
BaseSingleFrameAction,
QualityReport,
QualityConflict,
QualitySettings,
AnnotationConflict,
ConflictSeverity,
FramesMetaData,
AnalyticsReport,
AnalyticsEntry,
AnalyticsEntryViewType,
ServerError,
RequestError,
Event,
FrameData,
ActionParameterType,
FrameSelectionType,
Request,
};
export type {
SerializedAttribute,
SerializedLabel,
StorageData,
ModelProvider,
APIWrapperEnterOptions,
QualitySummary,
CVATCore,
SerializedAPISchema,
ProjectOrTaskOrJob,
};