denkproto 1.3.0__py3-none-any.whl
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.
- denkproto/ImageAnalysis_ProtobufMessages_pb2.py +139 -0
- denkproto/ImageAnalysis_ProtobufMessages_pb2.pyi +598 -0
- denkproto/ImageAnalysis_ProtobufMessages_pb2_grpc.py +24 -0
- denkproto/__about__.py +1 -0
- denkproto/__init__.py +0 -0
- denkproto/annotation_comparer_request_pb2.py +40 -0
- denkproto/annotation_comparer_request_pb2.pyi +38 -0
- denkproto/annotation_comparer_request_pb2_grpc.py +24 -0
- denkproto/denkcache_pb2.py +77 -0
- denkproto/denkcache_pb2.pyi +155 -0
- denkproto/denkcache_pb2_grpc.py +398 -0
- denkproto/geometry_pb2.py +45 -0
- denkproto/geometry_pb2.pyi +54 -0
- denkproto/geometry_pb2_grpc.py +24 -0
- denkproto/inference_graph_pb2.py +185 -0
- denkproto/inference_graph_pb2.pyi +272 -0
- denkproto/inference_graph_pb2_grpc.py +24 -0
- denkproto/json/__init__.py +3 -0
- denkproto/json/classification_markup_schema_.py +28 -0
- denkproto/json/geometry_schema.py +71 -0
- denkproto/json/inference_graph_recipe_schema.py +336 -0
- denkproto/json/instance_segmentation_markup_schema.py +35 -0
- denkproto/json/object_detection_markup_schema.py +43 -0
- denkproto/json/ocr_markup_schema.py +48 -0
- denkproto/json/segmentation_markup_schema.py +242 -0
- denkproto/markup_pb2.py +56 -0
- denkproto/markup_pb2.pyi +155 -0
- denkproto/markup_pb2_grpc.py +24 -0
- denkproto/materialized_markup_pb2.py +46 -0
- denkproto/materialized_markup_pb2.pyi +71 -0
- denkproto/materialized_markup_pb2_grpc.py +24 -0
- denkproto/modelfile_v1_pb2.py +57 -0
- denkproto/modelfile_v1_pb2.pyi +216 -0
- denkproto/modelfile_v1_pb2_grpc.py +24 -0
- denkproto/modelfile_v2_pb2.py +154 -0
- denkproto/modelfile_v2_pb2.pyi +307 -0
- denkproto/modelfile_v2_pb2_grpc.py +24 -0
- denkproto/prediction_pb2.py +48 -0
- denkproto/prediction_pb2.pyi +89 -0
- denkproto/prediction_pb2_grpc.py +24 -0
- denkproto/prediction_request_pb2.py +43 -0
- denkproto/prediction_request_pb2.pyi +56 -0
- denkproto/prediction_request_pb2_grpc.py +24 -0
- denkproto/py.typed +0 -0
- denkproto/request_pb2.py +51 -0
- denkproto/request_pb2.pyi +92 -0
- denkproto/request_pb2_grpc.py +24 -0
- denkproto/results_pb2.py +91 -0
- denkproto/results_pb2.pyi +528 -0
- denkproto/results_pb2_grpc.py +24 -0
- denkproto/validate_pb2.py +86 -0
- denkproto/validate_pb2.pyi +494 -0
- denkproto/validate_pb2_grpc.py +24 -0
- denkproto-1.3.0.dist-info/METADATA +5 -0
- denkproto-1.3.0.dist-info/RECORD +56 -0
- denkproto-1.3.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: inference_graph_recipe.schema.json
|
|
3
|
+
# timestamp: 2025-11-18T09:31:57+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Annotated, Literal, Optional, Union
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ConstTensorFloat64Data(BaseModel):
|
|
13
|
+
model_config = ConfigDict(
|
|
14
|
+
extra='forbid',
|
|
15
|
+
)
|
|
16
|
+
data_type: Literal['float64']
|
|
17
|
+
data: list[float]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ConstTensorInt64Data(BaseModel):
|
|
21
|
+
model_config = ConfigDict(
|
|
22
|
+
extra='forbid',
|
|
23
|
+
)
|
|
24
|
+
data_type: Literal['int64']
|
|
25
|
+
data: list[int]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ConstTensorUint64Data(BaseModel):
|
|
29
|
+
model_config = ConfigDict(
|
|
30
|
+
extra='forbid',
|
|
31
|
+
)
|
|
32
|
+
data_type: Literal['uint64']
|
|
33
|
+
data: list[int]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ImageSize(BaseModel):
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
extra='forbid',
|
|
39
|
+
)
|
|
40
|
+
height: Annotated[int, Field(ge=1)]
|
|
41
|
+
width: Annotated[int, Field(ge=1)]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class TargetSizeSourceTopic(BaseModel):
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
extra='forbid',
|
|
47
|
+
)
|
|
48
|
+
source_type: Literal['topic']
|
|
49
|
+
topic: Annotated[
|
|
50
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class TargetSizeSourceImageSize(BaseModel):
|
|
55
|
+
model_config = ConfigDict(
|
|
56
|
+
extra='forbid',
|
|
57
|
+
)
|
|
58
|
+
source_type: Literal['image_size']
|
|
59
|
+
size: ImageSize
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class ThresholdSourceTopic(BaseModel):
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
extra='forbid',
|
|
65
|
+
)
|
|
66
|
+
source_type: Literal['topic']
|
|
67
|
+
topic: Annotated[
|
|
68
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class ThresholdSourceValue(BaseModel):
|
|
73
|
+
model_config = ConfigDict(
|
|
74
|
+
extra='forbid',
|
|
75
|
+
)
|
|
76
|
+
source_type: Literal['value']
|
|
77
|
+
value: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class ImagePatchesNode(BaseModel):
|
|
81
|
+
model_config = ConfigDict(
|
|
82
|
+
extra='forbid',
|
|
83
|
+
)
|
|
84
|
+
node_type: Literal['image_patches']
|
|
85
|
+
name: str
|
|
86
|
+
input_image: Annotated[
|
|
87
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
88
|
+
]
|
|
89
|
+
input_bounding_boxes: Annotated[
|
|
90
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
91
|
+
]
|
|
92
|
+
input_target_size: Annotated[
|
|
93
|
+
Union[TargetSizeSourceTopic, TargetSizeSourceImageSize],
|
|
94
|
+
Field(
|
|
95
|
+
description='Source for the target size, either from a topic or a constant ImageSize.',
|
|
96
|
+
discriminator='source_type',
|
|
97
|
+
),
|
|
98
|
+
]
|
|
99
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class ImageResizeNode(BaseModel):
|
|
103
|
+
model_config = ConfigDict(
|
|
104
|
+
extra='forbid',
|
|
105
|
+
)
|
|
106
|
+
node_type: Literal['image_resize']
|
|
107
|
+
name: str
|
|
108
|
+
input_size: Annotated[
|
|
109
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
110
|
+
]
|
|
111
|
+
input_image: Annotated[
|
|
112
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
113
|
+
]
|
|
114
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ModelSourceFromNetworkExperimentId(BaseModel):
|
|
118
|
+
model_config = ConfigDict(
|
|
119
|
+
extra='forbid',
|
|
120
|
+
)
|
|
121
|
+
source_type: Literal['network_experiment_id']
|
|
122
|
+
network_experiment_id: Annotated[
|
|
123
|
+
str,
|
|
124
|
+
Field(
|
|
125
|
+
description='Model from a network experiment ID.',
|
|
126
|
+
pattern='^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$',
|
|
127
|
+
),
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class ModelSourceFromNetworkId(BaseModel):
|
|
132
|
+
model_config = ConfigDict(
|
|
133
|
+
extra='forbid',
|
|
134
|
+
)
|
|
135
|
+
source_type: Literal['network_id']
|
|
136
|
+
network_id: Annotated[
|
|
137
|
+
str,
|
|
138
|
+
Field(
|
|
139
|
+
description='Model from a network ID.',
|
|
140
|
+
pattern='^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$',
|
|
141
|
+
),
|
|
142
|
+
]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class VirtualCameraNode(BaseModel):
|
|
146
|
+
model_config = ConfigDict(
|
|
147
|
+
extra='forbid',
|
|
148
|
+
)
|
|
149
|
+
node_type: Literal['virtual_camera']
|
|
150
|
+
name: str
|
|
151
|
+
path: str
|
|
152
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class BoundingBoxFilterNode(BaseModel):
|
|
156
|
+
model_config = ConfigDict(
|
|
157
|
+
extra='forbid',
|
|
158
|
+
)
|
|
159
|
+
node_type: Literal['bounding_box_filter']
|
|
160
|
+
name: str
|
|
161
|
+
input_bounding_boxes: Annotated[
|
|
162
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
163
|
+
]
|
|
164
|
+
input_score_threshold: Annotated[
|
|
165
|
+
Optional[Union[ThresholdSourceTopic, ThresholdSourceValue]],
|
|
166
|
+
Field(
|
|
167
|
+
description='Source for a threshold value (0.0-1.0), either from a topic or a constant value.',
|
|
168
|
+
discriminator='source_type',
|
|
169
|
+
),
|
|
170
|
+
] = None
|
|
171
|
+
input_iou_threshold: Annotated[
|
|
172
|
+
Optional[Union[ThresholdSourceTopic, ThresholdSourceValue]],
|
|
173
|
+
Field(
|
|
174
|
+
description='Source for a threshold value (0.0-1.0), either from a topic or a constant value.',
|
|
175
|
+
discriminator='source_type',
|
|
176
|
+
),
|
|
177
|
+
] = None
|
|
178
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class ConstTensorNode(BaseModel):
|
|
182
|
+
model_config = ConfigDict(
|
|
183
|
+
extra='forbid',
|
|
184
|
+
)
|
|
185
|
+
node_type: Literal['const_tensor']
|
|
186
|
+
name: str
|
|
187
|
+
shape: list[int]
|
|
188
|
+
data: Annotated[
|
|
189
|
+
Union[ConstTensorUint64Data, ConstTensorInt64Data, ConstTensorFloat64Data],
|
|
190
|
+
Field(
|
|
191
|
+
description='Base type for constant tensor data.', discriminator='data_type'
|
|
192
|
+
),
|
|
193
|
+
]
|
|
194
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class ClassificationNode(BaseModel):
|
|
198
|
+
model_config = ConfigDict(
|
|
199
|
+
extra='forbid',
|
|
200
|
+
)
|
|
201
|
+
node_type: Literal['image_classification']
|
|
202
|
+
name: str
|
|
203
|
+
input_image: Annotated[
|
|
204
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
205
|
+
]
|
|
206
|
+
model_source: Annotated[
|
|
207
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
208
|
+
Field(
|
|
209
|
+
description='Base type for the source of the model.',
|
|
210
|
+
discriminator='source_type',
|
|
211
|
+
),
|
|
212
|
+
]
|
|
213
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
class ObjectDetectionNode(BaseModel):
|
|
217
|
+
model_config = ConfigDict(
|
|
218
|
+
extra='forbid',
|
|
219
|
+
)
|
|
220
|
+
node_type: Literal['image_object_detection']
|
|
221
|
+
name: str
|
|
222
|
+
input_image: Annotated[
|
|
223
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
224
|
+
]
|
|
225
|
+
model_source: Annotated[
|
|
226
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
227
|
+
Field(
|
|
228
|
+
description='Base type for the source of the model.',
|
|
229
|
+
discriminator='source_type',
|
|
230
|
+
),
|
|
231
|
+
]
|
|
232
|
+
scale_bounding_boxes: Optional[bool] = True
|
|
233
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class OcrNode(BaseModel):
|
|
237
|
+
model_config = ConfigDict(
|
|
238
|
+
extra='forbid',
|
|
239
|
+
)
|
|
240
|
+
node_type: Literal['image_ocr']
|
|
241
|
+
name: str
|
|
242
|
+
input_image: Annotated[
|
|
243
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
244
|
+
]
|
|
245
|
+
model_source: Annotated[
|
|
246
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
247
|
+
Field(
|
|
248
|
+
description='Base type for the source of the model.',
|
|
249
|
+
discriminator='source_type',
|
|
250
|
+
),
|
|
251
|
+
]
|
|
252
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class ImageSegmentationNode(BaseModel):
|
|
256
|
+
model_config = ConfigDict(
|
|
257
|
+
extra='forbid',
|
|
258
|
+
)
|
|
259
|
+
node_type: Literal['image_segmentation']
|
|
260
|
+
name: str
|
|
261
|
+
input_image: Annotated[
|
|
262
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
263
|
+
]
|
|
264
|
+
model_source: Annotated[
|
|
265
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
266
|
+
Field(
|
|
267
|
+
description='Base type for the source of the model.',
|
|
268
|
+
discriminator='source_type',
|
|
269
|
+
),
|
|
270
|
+
]
|
|
271
|
+
output_port_name: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
class ImageInstanceSegmentationNode(BaseModel):
|
|
275
|
+
model_config = ConfigDict(
|
|
276
|
+
extra='forbid',
|
|
277
|
+
)
|
|
278
|
+
node_type: Literal['image_instance_segmentation']
|
|
279
|
+
name: str
|
|
280
|
+
input_image: Annotated[
|
|
281
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
282
|
+
]
|
|
283
|
+
model_source: Annotated[
|
|
284
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
285
|
+
Field(
|
|
286
|
+
description='Base type for the source of the model.',
|
|
287
|
+
discriminator='source_type',
|
|
288
|
+
),
|
|
289
|
+
]
|
|
290
|
+
output_bounding_boxes: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
291
|
+
output_segmentations: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
class ImageAnomalyDetectionNode(BaseModel):
|
|
295
|
+
model_config = ConfigDict(
|
|
296
|
+
extra='forbid',
|
|
297
|
+
)
|
|
298
|
+
node_type: Literal['image_anomaly_detection']
|
|
299
|
+
name: str
|
|
300
|
+
input_image: Annotated[
|
|
301
|
+
str, Field(pattern='^[a-zA-Z0-9_]+\\/[a-zA-Z0-9_]+([?]timeout=\\d+)?$')
|
|
302
|
+
]
|
|
303
|
+
model_source: Annotated[
|
|
304
|
+
Union[ModelSourceFromNetworkId, ModelSourceFromNetworkExperimentId],
|
|
305
|
+
Field(
|
|
306
|
+
description='Base type for the source of the model.',
|
|
307
|
+
discriminator='source_type',
|
|
308
|
+
),
|
|
309
|
+
]
|
|
310
|
+
output_anomaly_scores: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
311
|
+
output_segmentations: Annotated[str, Field(pattern='^[a-zA-Z0-9_-]+$')]
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
class InferenceGraphRecipe(BaseModel):
|
|
315
|
+
model_config = ConfigDict(
|
|
316
|
+
extra='forbid',
|
|
317
|
+
)
|
|
318
|
+
nodes: list[
|
|
319
|
+
Union[
|
|
320
|
+
ConstTensorNode,
|
|
321
|
+
ImageResizeNode,
|
|
322
|
+
ImagePatchesNode,
|
|
323
|
+
VirtualCameraNode,
|
|
324
|
+
ClassificationNode,
|
|
325
|
+
ObjectDetectionNode,
|
|
326
|
+
OcrNode,
|
|
327
|
+
BoundingBoxFilterNode,
|
|
328
|
+
ImageSegmentationNode,
|
|
329
|
+
ImageInstanceSegmentationNode,
|
|
330
|
+
ImageAnomalyDetectionNode,
|
|
331
|
+
]
|
|
332
|
+
]
|
|
333
|
+
license_id: str
|
|
334
|
+
created_at: Annotated[
|
|
335
|
+
int, Field(description='Unix timestamp when the recipe was created')
|
|
336
|
+
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: instance_segmentation_markup.schema.json
|
|
3
|
+
# timestamp: 2025-11-10T14:10:34+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Annotated
|
|
8
|
+
from uuid import UUID
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
11
|
+
|
|
12
|
+
from . import geometry_schema
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Annotation(BaseModel):
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra='forbid',
|
|
18
|
+
)
|
|
19
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
20
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
21
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
22
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
23
|
+
mask: geometry_schema.BinaryMask
|
|
24
|
+
label_id: UUID
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class InstanceSegmentationMarkup(BaseModel):
|
|
28
|
+
model_config = ConfigDict(
|
|
29
|
+
extra='forbid',
|
|
30
|
+
)
|
|
31
|
+
height: Annotated[int, Field(ge=0)]
|
|
32
|
+
width: Annotated[int, Field(ge=0)]
|
|
33
|
+
annotations: Annotated[
|
|
34
|
+
list[Annotation], Field(description='Instance segmentation annotations')
|
|
35
|
+
]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: object_detection_markup.schema.json
|
|
3
|
+
# timestamp: 2025-11-18T09:31:57+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Annotated, Optional
|
|
9
|
+
from uuid import UUID
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AnnotationType(Enum):
|
|
15
|
+
POSITIVE = 'POSITIVE'
|
|
16
|
+
NEGATIVE = 'NEGATIVE'
|
|
17
|
+
IGNORE = 'IGNORE'
|
|
18
|
+
ROI = 'ROI'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Annotation(BaseModel):
|
|
22
|
+
model_config = ConfigDict(
|
|
23
|
+
extra='forbid',
|
|
24
|
+
)
|
|
25
|
+
id: UUID
|
|
26
|
+
label_id: UUID
|
|
27
|
+
annotation_type: AnnotationType
|
|
28
|
+
angle: Optional[float] = None
|
|
29
|
+
full_orientation: Optional[bool] = None
|
|
30
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
31
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
32
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
33
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
34
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ObjectDetectionMarkup(BaseModel):
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
extra='forbid',
|
|
40
|
+
)
|
|
41
|
+
height: Annotated[int, Field(ge=0)]
|
|
42
|
+
width: Annotated[int, Field(ge=0)]
|
|
43
|
+
annotations: list[Annotation]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: ocr_markup.schema.json
|
|
3
|
+
# timestamp: 2025-11-18T09:31:57+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Annotated, Optional, Union
|
|
8
|
+
from uuid import UUID
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
|
11
|
+
|
|
12
|
+
from . import geometry_schema
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Annotations(BaseModel):
|
|
16
|
+
model_config = ConfigDict(
|
|
17
|
+
extra='forbid',
|
|
18
|
+
)
|
|
19
|
+
id: UUID
|
|
20
|
+
label_id: UUID
|
|
21
|
+
text: str
|
|
22
|
+
bounding_box: geometry_schema.BoundingBox
|
|
23
|
+
polygon: Optional[geometry_schema.PolygonAnnotation] = None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Annotations1(BaseModel):
|
|
27
|
+
model_config = ConfigDict(
|
|
28
|
+
extra='forbid',
|
|
29
|
+
)
|
|
30
|
+
id: UUID
|
|
31
|
+
label_id: UUID
|
|
32
|
+
text: str
|
|
33
|
+
bounding_box: Optional[geometry_schema.BoundingBox] = None
|
|
34
|
+
polygon: geometry_schema.PolygonAnnotation
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class AverageObjectWidth(RootModel[float]):
|
|
38
|
+
root: Annotated[float, Field(ge=0.0)]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class OcrMarkup(BaseModel):
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
extra='forbid',
|
|
44
|
+
)
|
|
45
|
+
height: Annotated[int, Field(ge=0)]
|
|
46
|
+
width: Annotated[int, Field(ge=0)]
|
|
47
|
+
annotations: list[Union[Annotations, Annotations1]]
|
|
48
|
+
average_object_widths: list[AverageObjectWidth]
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# generated by datamodel-codegen:
|
|
2
|
+
# filename: segmentation_markup.schema.json
|
|
3
|
+
# timestamp: 2025-11-18T09:31:57+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Annotated, Optional, Union
|
|
9
|
+
from uuid import UUID
|
|
10
|
+
|
|
11
|
+
from pydantic import AnyUrl, BaseModel, ConfigDict, Field, RootModel
|
|
12
|
+
|
|
13
|
+
from . import geometry_schema
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class AnnotationType(Enum):
|
|
17
|
+
POSITIVE = 'POSITIVE'
|
|
18
|
+
NEGATIVE = 'NEGATIVE'
|
|
19
|
+
IGNORE = 'IGNORE'
|
|
20
|
+
ROI = 'ROI'
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AverageObjectWidth(RootModel[float]):
|
|
24
|
+
root: Annotated[float, Field(ge=0.0)]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CircleAnnotation(BaseModel):
|
|
28
|
+
model_config = ConfigDict(
|
|
29
|
+
extra='forbid',
|
|
30
|
+
)
|
|
31
|
+
center_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
32
|
+
center_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
33
|
+
radius: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Point(BaseModel):
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
extra='forbid',
|
|
39
|
+
)
|
|
40
|
+
x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
41
|
+
y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class MagicwandAnnotation(BaseModel):
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
extra='forbid',
|
|
47
|
+
)
|
|
48
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
49
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
50
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
51
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
52
|
+
center_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
53
|
+
center_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
54
|
+
dataURL: AnyUrl
|
|
55
|
+
points: list[Point]
|
|
56
|
+
threshold: Annotated[int, Field(ge=0)]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class PenAnnotation(BaseModel):
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
extra='forbid',
|
|
62
|
+
)
|
|
63
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
64
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
65
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
66
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
67
|
+
dataURL: AnyUrl
|
|
68
|
+
points: list[Point]
|
|
69
|
+
thickness: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class PixelAnnotation(BaseModel):
|
|
73
|
+
model_config = ConfigDict(
|
|
74
|
+
extra='forbid',
|
|
75
|
+
)
|
|
76
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
77
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
78
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
79
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
80
|
+
blob_id: UUID
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class RectangleAnnotation(BaseModel):
|
|
84
|
+
model_config = ConfigDict(
|
|
85
|
+
extra='forbid',
|
|
86
|
+
)
|
|
87
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
88
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
89
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
90
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class SausageAnnotation(BaseModel):
|
|
94
|
+
model_config = ConfigDict(
|
|
95
|
+
extra='forbid',
|
|
96
|
+
)
|
|
97
|
+
top_left_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
98
|
+
top_left_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
99
|
+
bottom_right_x: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
100
|
+
bottom_right_y: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
101
|
+
dataURL: AnyUrl
|
|
102
|
+
points: list[Point]
|
|
103
|
+
radius: Annotated[float, Field(ge=0.0, le=1.0)]
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class Annotations(BaseModel):
|
|
107
|
+
model_config = ConfigDict(
|
|
108
|
+
extra='forbid',
|
|
109
|
+
)
|
|
110
|
+
id: UUID
|
|
111
|
+
label_id: UUID
|
|
112
|
+
annotation_type: AnnotationType
|
|
113
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
114
|
+
circle_annotation: CircleAnnotation
|
|
115
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
116
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
117
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
118
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
119
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
120
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class Annotations3(BaseModel):
|
|
124
|
+
model_config = ConfigDict(
|
|
125
|
+
extra='forbid',
|
|
126
|
+
)
|
|
127
|
+
id: UUID
|
|
128
|
+
label_id: UUID
|
|
129
|
+
annotation_type: AnnotationType
|
|
130
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
131
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
132
|
+
magicwand_annotation: MagicwandAnnotation
|
|
133
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
134
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
135
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
136
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
137
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class Annotations4(BaseModel):
|
|
141
|
+
model_config = ConfigDict(
|
|
142
|
+
extra='forbid',
|
|
143
|
+
)
|
|
144
|
+
id: UUID
|
|
145
|
+
label_id: UUID
|
|
146
|
+
annotation_type: AnnotationType
|
|
147
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
148
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
149
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
150
|
+
pen_annotation: PenAnnotation
|
|
151
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
152
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
153
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
154
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class Annotations5(BaseModel):
|
|
158
|
+
model_config = ConfigDict(
|
|
159
|
+
extra='forbid',
|
|
160
|
+
)
|
|
161
|
+
id: UUID
|
|
162
|
+
label_id: UUID
|
|
163
|
+
annotation_type: AnnotationType
|
|
164
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
165
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
166
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
167
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
168
|
+
pixel_annotation: PixelAnnotation
|
|
169
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
170
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
171
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class Annotations6(BaseModel):
|
|
175
|
+
model_config = ConfigDict(
|
|
176
|
+
extra='forbid',
|
|
177
|
+
)
|
|
178
|
+
id: UUID
|
|
179
|
+
label_id: UUID
|
|
180
|
+
annotation_type: AnnotationType
|
|
181
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
182
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
183
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
184
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
185
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
186
|
+
polygon_annotation: geometry_schema.PolygonAnnotation
|
|
187
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
188
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class Annotations7(BaseModel):
|
|
192
|
+
model_config = ConfigDict(
|
|
193
|
+
extra='forbid',
|
|
194
|
+
)
|
|
195
|
+
id: UUID
|
|
196
|
+
label_id: UUID
|
|
197
|
+
annotation_type: AnnotationType
|
|
198
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
199
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
200
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
201
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
202
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
203
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
204
|
+
rectangle_annotation: RectangleAnnotation
|
|
205
|
+
sausage_annotation: Optional[SausageAnnotation] = None
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class Annotations8(BaseModel):
|
|
209
|
+
model_config = ConfigDict(
|
|
210
|
+
extra='forbid',
|
|
211
|
+
)
|
|
212
|
+
id: UUID
|
|
213
|
+
label_id: UUID
|
|
214
|
+
annotation_type: AnnotationType
|
|
215
|
+
average_width: Annotated[float, Field(ge=0.0)]
|
|
216
|
+
circle_annotation: Optional[CircleAnnotation] = None
|
|
217
|
+
magicwand_annotation: Optional[MagicwandAnnotation] = None
|
|
218
|
+
pen_annotation: Optional[PenAnnotation] = None
|
|
219
|
+
pixel_annotation: Optional[PixelAnnotation] = None
|
|
220
|
+
polygon_annotation: Optional[geometry_schema.PolygonAnnotation] = None
|
|
221
|
+
rectangle_annotation: Optional[RectangleAnnotation] = None
|
|
222
|
+
sausage_annotation: SausageAnnotation
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class SegmentationMarkup(BaseModel):
|
|
226
|
+
model_config = ConfigDict(
|
|
227
|
+
extra='forbid',
|
|
228
|
+
)
|
|
229
|
+
height: Annotated[int, Field(ge=0)]
|
|
230
|
+
width: Annotated[int, Field(ge=0)]
|
|
231
|
+
annotations: list[
|
|
232
|
+
Union[
|
|
233
|
+
Annotations,
|
|
234
|
+
Annotations3,
|
|
235
|
+
Annotations4,
|
|
236
|
+
Annotations5,
|
|
237
|
+
Annotations6,
|
|
238
|
+
Annotations7,
|
|
239
|
+
Annotations8,
|
|
240
|
+
]
|
|
241
|
+
]
|
|
242
|
+
average_object_widths: list[AverageObjectWidth]
|