-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathconstants.py
More file actions
147 lines (131 loc) · 3.77 KB
/
constants.py
File metadata and controls
147 lines (131 loc) · 3.77 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import re
SETTINGS_CONST_JOBS_CONFIGS = 'jobs_configs'
BRAND_DATA_CONFIG = 'brand_data_config'
INSTALLED_ADDONS_CONFIGS = 'installed_addons'
ImageSequenceType = "image-sequence"
VideoType = "video"
LargeImageType = "large-image"
DefaultVideoFPS = -1
JsonMetaCurrentVersion = 1
SettingsCurrentVersion = 1
AnnotationsCurrentVersion = 2
webValidImageFormats = {"png", "jpg", "jpeg"}
validImageFormats = {*webValidImageFormats, "sgi", "bmp", "pgm"}
validVideoFormats = {
"mp4",
"webm",
"avi",
"mov",
"wmv",
"mpg",
"mpeg",
"mp2",
"ogg",
"flv",
}
validLargeImageFormats = {
"nitf",
"tif",
"tiff",
"ntf",
"vrt",
"r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
}
allValidLargeImageFormats = {*validImageFormats, *validLargeImageFormats}
videoRegex = re.compile(r"(\." + r"|\.".join(validVideoFormats) + ')$', re.IGNORECASE)
imageRegex = re.compile(r"(\." + r"|\.".join(validImageFormats) + ')$', re.IGNORECASE)
largeImageRegEx = re.compile(r"(\." + r"|\.".join(validLargeImageFormats) + ')$', re.IGNORECASE)
allLargeImageRegEx = re.compile(
r"(\." + r"|\.".join(allValidLargeImageFormats) + ')$', re.IGNORECASE
)
safeImageRegex = re.compile(r"(\." + r"|\.".join(webValidImageFormats) + ')$', re.IGNORECASE)
csvRegex = re.compile(r"\.csv$", re.IGNORECASE)
jsonRegex = re.compile(r"\.json$", re.IGNORECASE)
ymlRegex = re.compile(r"\.ya?ml$", re.IGNORECASE)
zipRegex = re.compile(r"\.zip$", re.IGNORECASE)
metaRegex = re.compile(r"^.*\.?(meta|config)\.json$", re.IGNORECASE)
# .json or .csv file
possibleAnnotationRegex = re.compile(r"\.(json|csv)$", re.IGNORECASE)
ImageMimeTypes = {
"image/png",
"image/jpeg",
"image/tiff",
"image/bmp",
"image/x-portable-anymap",
"image/x-portable-bitmap",
"image/x-portable-graymap",
"image/x-rgb",
}
VideoMimeTypes = {
# web-safe
"video/webm",
"video/mp4",
# avi
"video/avi",
"video/msvideo",
"video/x-msvideo",
"video/x-ms-wmv",
# mov
"video/quicktime",
# mpeg
"video/mpeg",
"video/x-mpeg",
"video/x-mpeq2a"
# ogg
"video/ogg",
# flv
"video/x-flv",
}
LargeImageMimeTypes = {
"image/geotiff",
"image/tiff",
"image/x-tiff",
"image/nitf",
"image/ntf",
}
# Metadata markers
DatasetMarker = "annotate"
PublishedMarker = "published"
SharedMarker = "shared"
ProcessedMarker = "processed"
ForeignMediaIdMarker = "foreign_media_id"
TrainedPipelineMarker = "trained_pipeline"
TypeMarker = "type"
AssetstoreSourceMarker = "import_source"
AssetstoreSourcePathMarker = "import_path"
MarkForPostProcess = "MarkForPostProcess"
FPSMarker = "fps"
OriginalFPSMarker = "originalFps"
OriginalFPSStringMarker = "originalFpsString"
ConfidenceFiltersMarker = "confidenceFilters"
ImageEnhancementsMarker = "imageEnhancements"
AnnotationFileFutureProcessMarker = "importAnnotationFile"
# Other constants
TrainedPipelineCategory = "trained"
# The name of the folder where any user specific data should be stored
# (created as a folder of that user)
ViameDataFolderName = "VIAME"
# The name of the subfolder for training results
TrainingOutputFolderName = "VIAME Training Results"
# The name of the source folder holding zip backups
SourceFolderName = "source"
# The name of the auxiliary folder
AuxiliaryFolderName = "auxiliary"
# the name of the meta file
MetaFileName = "meta.json"
# job constants
JOBCONST_DATASET_ID = 'dataset_id'
JOBCONST_PARAMS = 'params'
JOBCONST_PRIVATE_QUEUE = 'private_queue'
JOBCONST_CREATOR = 'creator'
# User queue constants
UserPrivateQueueEnabledMarker = 'user_private_queue_enabled'
AddonsListURL = 'https://github.com/VIAME/VIAME/raw/main/cmake/download_viame_addons.csv'
TrainingModelExtensions = (".zip", ".pth", ".pt", ".py", ".weights", ".wt", ".ckpt")
MISALGINED_MARKER = "VideoMisaligned"