generated from stac-extensions/template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
schema.json
472 lines (471 loc) · 12.2 KB
/
schema.json
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.stacspec.org/v1.0.0-beta.2/extensions/dl-model/json-schema/schema.json#",
"title": "DL Model Item",
"description": "This object represents the metadata for a Deep Learning (DL) model item in a DL Catalog.",
"allOf": [
{
"$ref": "../../../item-spec/json-schema/item.json"
},
{
"$ref": "#/definitions/dl-model"
},
{
"$ref": "../../../item-spec/json-schema/instrument.json"
},
{
"$ref": "../../../item-spec/json-schema/licensing.json"
},
{
"$ref": "../../../item-spec/json-schema/provider.json"
},
{
"$ref": "../../../item-spec/json-schema/datetime.json"
}
],
"definitions": {
"dl-model": {
"type": "object",
"required": [
"stac_extensions",
"properties",
"assets"
],
"properties": {
"stac_extensions": {
"type": "object",
"required": [
"stac_extensions"
],
"properties": {
"stac_extensions": {
"type": "array",
"contains": {
"enum": [
"dl-model",
"https://schemas.stacspec.org/v1.0.0-beta.2/extensions/dl-model/json-schema/schema.json"
]
}
}
}
},
"properties": {
"type": "object",
"required": [
"dlm:inputs",
"dlm:outputs",
"dlm:runtime",
"dlm:archive",
"dlm:data"
],
"properties": {
"dlm:runtime": {
"title": "Execution environement",
"description": "Describe the execution environement",
"type": "object",
"required": [
"framework",
"version",
"model_handler",
"model_src_url",
"requirement_file"
],
"properties": {
"framework": {
"title": "Name of the deep learning framework used",
"type": "string"
},
"framework_version": {
"title": "Framework version",
"type": "string"
},
"model_handler": {
"title": "Model handling function",
"type": "string"
},
"model_src_url": {
"title": "Model source repository",
"type": "string"
},
"model_commit_hash": {
"title": "Hash value for the Model source",
"type": "string"
},
"requirement_file": {
"title": "Requirement file",
"type": "string"
},
"docker": {
"title": "Docker runtime specifications",
"type": "object",
"anyOf": [
{"required": ["docker_file","gpu","working_dir","run"]},
{"required": ["image_name","gpu","working_dir","run"]}
],
"properties": {
"docker_runtime": {
"anyOf": [{
"docker_file": {
"title": "Docker file url",
"type": "string"
},
"docker_image": {
"title": "Docker image url",
"type": "string"
}}
]},
"gpu": {
"title": "Docker runtime requires a gpu",
"type": "boolean"
},
"image_name": {
"title": "Docker image name",
"type": "string"
},
"tag": {
"title": "Docker image tag",
"type": "string"
},
"working_dir": {
"title": "Docker container working dir",
"type": "string"
},
"run": {
"title": "Docker run parameters",
"type": "string"
}
}
}
}
},
"dlm:architecture": {
"title": "Model architecture description",
"description": "Describe the model architecture",
"type": "object",
"required": [
"total_nb_parameters",
"estimated_total_size_mb",
"type",
"pretrained"
],
"properties": {
"total_nb_parameters": {
"title": "Total number of parameters",
"type": "integer"
},
"estimated_total_size_mb": {
"title": "Estimated memory size in MB",
"type": "number"
},
"type": {
"title": "Type of architecture",
"type": "string"
},
"summary": {
"title": "Summary of the architecture",
"type": "string"
},
"pretrained": {
"title": "Pre-training",
"type": "string"
}
}
},
"dlm:inputs": {
"title": "Description of the input tensor",
"type": "object",
"description": "Describe the inputs required by the model",
"required": [
"name",
"scaling_factor",
"normalization:mean",
"normalization:std",
"selected_bands",
"input_tensors"
],
"properties": {
"name": {
"title": "Python name of the tensor",
"type": "string"
},
"scaling_factor": {
"title": "Scaling factor",
"description": "Scaling factor to be applied on the data in order to bring the range of values between 0 and 1",
"type": "number",
"exclusiveMinimum": 0
},
"normalization:mean": {
"title": "Statistical mean",
"type": "array",
"minItems": 1,
"items": {
"type": "number"
}
},
"normalization:std": {
"title": "Statistical standard-deviation",
"type": "array",
"minItems": 1,
"items": {
"type": "number",
"exclusiveMinimum": 0
}
},
"selected_bands": {
"title": "Selected bands",
"type": "array",
"minItems": 1,
"items": {
"type": "integer"
}
},
"pre_processing_function": {
"title": "Pre-processing function",
"description": "Pre-processing Python function transforming the EO data to a ML-ready tensor",
"type": "string"
},
"input_tensors": {
"title": "Shape of the input tensor",
"description": "Describe the dimensions of the input tensors",
"type": "array",
"minItems": 1,
"items": {
"properties": {
"batch": {
"title": "Batch size",
"type": "integer",
"minimum": 1
},
"dim": {
"title": "Number of channels",
"type": "integer",
"minimum": 1
},
"height": {
"title": "Height",
"type": "integer",
"minimum": 1
},
"width": {
"title": "Width",
"type": "integer",
"minimum": 1
}
}
}
}
}
},
"dlm:outputs": {
"title": "Description of the outputs of the model",
"type": "object",
"description": "Describe the outputs of the model",
"required": [
"task",
"number_of_classes",
"final_layer_size",
"class_name_mapping"
],
"properties": {
"task": {
"title": "Task name",
"type": "string",
"enum": [
"semantic segmentation",
"classification",
"object detection",
"object segmentation"
]
},
"number_of_classes": {
"title": "number of classes",
"type": "integer",
"minimum": 1
},
"final_layer_size": {
"title": "Output size",
"description": "Size of the tensor from the top layer",
"type": "array",
"minItems": 1,
"items": {
"type": "integer",
"exclusiveMinimum": 0
}
},
"dont_care_index": {
"title": "dont care index",
"description": "In case a dont care class is used",
"type": "integer"
},
"post_processing_function": {
"title": "Name of the post processing file",
"description": "Name of the python file containing a post-processing function",
"type": "string"
},
"class_name_mapping": {
"title": "Output size",
"description": "This is a lookup table mapping the model output (index) to a class name",
"type": "array",
"minItems": 1,
"items": {
"properties": {
"index": {
"title": "Class index",
"type": "integer",
"minimum": 0
},
"class_name": {
"title": "Class name",
"type": "string"
}
}
}
}
}
},
"dlm:data": {
"title": "Description of the data requirements",
"type": "object",
"description": "Describe the eo data compatible with the model",
"required": [
"process_level",
"dtype",
"number_of_bands",
"class_name_mapping"
],
"properties": {
"process_ level": {
"title": "Data processing level",
"description": "Describe the processing level expected",
"type": "string",
"enum": [
"raw",
"ortho",
"L0",
"L1",
"L2",
"L3"
]
},
"nodata_value": {
"title": "no data value",
"description": "Sometimes datasets have no data value, this value should be ignored",
"type": "number"
},
"item_examples": {
"title": "item examples",
"description": "Link to additional data records or stac items",
"type": "array",
"minItems": 1,
"items": {
"properties": {
"url": {
"title": "Link toward an item",
"type": "string"
},
"title": {
"title": "item description",
"type": "string"
}
}
}
},
"number_of_bands": {
"title": "number of bands",
"description": "Number of spectral bands expected in the eo data",
"type": "number",
"minimum": 1
},
"useful_bands": {
"title": "Useful bands",
"description": "Describe the spectral bands required by the model",
"type": "array",
"minItems": 1,
"items": {
"properties": {
"index": {
"title": "Index of the spectral band",
"description": "Index of the band in the original dataset",
"type": "integer",
"minimum": 0
},
"name": {
"title": "Short name of the band",
"type": "string"
}
}
}
},
"dtype": {
"title": "Data type",
"description": "Data type according to numpy",
"type": "string",
"enum": [
"byte",
"short",
"intc",
"int_",
"longlong",
"int8",
"int16",
"int32",
"int64",
"ubyte",
"ushort",
"uintc",
"uint",
"ulonglong",
"uint8",
"uint16",
"uint32",
"uint64",
"half",
"double",
"float_",
"longfloat",
"float16",
"float32",
"float64",
"float96",
"float128"
]
},
"test_file": {
"title": "Test file",
"type": "string",
"description": "this test file is a data sample",
}
}
},
"dlm:archive": {
"title": "Description of the archive content",
"description": "Describe the model archive content",
"type": "array",
"minItems": 1,
"items": {
"properties": {
"name": {
"title": "File name",
"type": "string"
},
"role": {
"title": "Role of the file",
"type": "string",
"enum": [
"dependency",
"handling function",
"model weight",
"config file",
"test set",
"other"
]
}
}
}
}
}
}
}
}
}
}