-
Notifications
You must be signed in to change notification settings - Fork 9
/
config_schema.json
318 lines (318 loc) · 14 KB
/
config_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
{
"$schema": "http://json-schema.org/draft-04/schema#",
"self": {
"vendor": "modelhub",
"name": "config_schema.json",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"description": "The config file holds information about the model and associated publication. This file ins required with every contribution to modelhub.",
"properties": {
"id": {
"type": "string",
"description": "randomly generated UUID",
"uniqueValue": true
},
"meta": {
"type": "object",
"description": "Meta information about the model itself.",
"properties": {
"name": {
"type": "string",
"description": "Model name. This should match the repository name: all small caps with '-' spacers. This should be unique.",
"uniqueValue": true
},
"application_area": {
"type": "string",
"description": "Free text explaining the application area. Examples: Imagnet, Cardiac MRI, Lung CT."
},
"task": {
"type": "string",
"description": "Free text explaining the task preformed by the model. Examples: Segmentation, Classification."
},
"task_extended": {
"type": "string",
"description": "Extended version of the 'task' property. Gives more information."
},
"data_type": {
"type": "string",
"description": "Free text explaining the type of input data to the model. Examples: Photos, CT Dicom, Vectors."
},
"data_source": {
"type": "string",
"description": "If the model has been trained on public data, this property is a url link to the data. Otherwise does not exist. Not required."
}
},
"required": [
"name",
"application_area",
"task",
"task_extended",
"data_type"
],
"additionalProperties": false
},
"publication": {
"type": "object",
"description": "Holds all information regarding the publication. If the 'publication' key does not exist, then there is no publication associated with this model.",
"properties": {
"title": {
"type": "string",
"description": "Publication title as it appears."
},
"source": {
"type": "string",
"description": "Source name. This could be the name of the journal or conference. If preprint, then the name of the platform. Example: Nature, IEEE, Arxiv."
},
"year": {
"type": "number",
"description": "Publication year."
},
"authors": {
"type": "string",
"description": "Authors in the same order they appear on the publication. Full first name, middle initial with dot, Full last name. Preserve this as much as possible for best exposure for contributors."
},
"email": {
"type": "string",
"description": "If contributor is ok with email being shared with users for future questions and communictions, this property is an email. Otherwise does not exist. Not required."
},
"abstract": {
"type": "string",
"description": "Publication abstract. Make sure this is pure text without newline funky characters..etc."
},
"url": {
"type": "string",
"description": "URL to the publication wherever it lives. If the paper is behind a paywall, this link should be public."
},
"google_scholar": {
"type": "string",
"description": "Link to google scholar page that lists all other works that have cited this publication. Get this link by clicking on the number of citation of this publication on the google scholar website. This will help us in the future for undertsanding the 'impact' of models in modelhub. Number of citations is a horrible metric.. but it's the only thing we have ¯\\_(ツ)_//¯"
},
"bibtex": {
"type": "string",
"description": "A BibTeX style citation for the publication. Make sure it includes a DOI if available."
}
},
"required": [
"title",
"source",
"year",
"authors",
"abstract",
"url",
"google_scholar",
"bibtex"
],
"additionalProperties": false
},
"model": {
"type": "object",
"description": "Holds all information regarding the model itself.",
"properties": {
"description": {
"type": "string",
"description": "Free text explaining the model architecture."
},
"provenance": {
"type": "string",
"description": "URL to where the model originated - or 'contributed by author'"
},
"architecture": {
"type": "string",
"description": "Architecture type + acronym in parenthesis if available. Example: Convolutional Neural Network (CNN). "
},
"learning_type": {
"type": "string",
"description": "Choice of Supervised Learning, Unsupervised Learning, Self-Supervised Learning, or one of the other types they keep coming up with these days. "
},
"format": {
"type": "string",
"description": "File format of the model with the preceeding dot. This could be .h5, .caffemodel, .onnx ...etc. This is used by the viewer to grab and view the model file if it is served on Github."
},
"io": {
"type": "object",
"description": "Inputs this model expects and outputs you should be expecting.",
"properties": {
"input": {
"type": "object",
"description": "Input properties. For inputs, we dictate the file formats that can be absorbed by modelhub. In the backend, these are converted to numpy arrays and fed into the model. Also for inputs, we define the dimension limits.",
"patternProperties":{
"(/^format$/)":{
"type":"array",
"description": "The overall input file type as MIME type. For multiple inputs, this is always application/json. If only a single input is needed, you can either leave json or use the actual datatype of your input file.",
"items": {
"type": "string"
},
"minItems": 1,
"maxItems": 1,
"uniqueItems": true
},
"(/^description$/)":{
"type":"string",
"description": "Optional description for the overall inputs."
},
"^(((?!format)(?!description)).)*$":{
"type":"object",
"description": "Each additional key will be treated as an individual input file and has to be matched in the input configuration. e.g. if you need 4 input sequences for a MRI segmentation, you would add 4 keys t1, flair, t1c and t2 here with dim_limits and an appropriate file type. If you only have a single input for your model, use the key single",
"properties":{
"format": {
"type": "array",
"description": "An array of acceptable file formats according to python MIME type. Example: image/jpeg, application/dicom. For medical images, our non-standard types are: application/nii-gzip, application/nii, application/nrrd. ",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"dim_limits": {
"type": "array",
"description": "An array of objects. The array can have varying length depending on the input data size. ( array length == 1 : vector ) ( array length == 3 : 2d ) ( array length == 4 : 3d ). First item in array is always a channel, the second is width, the third is length, and the forth is height. We only deal with a inference on a single image at once, so it is unlikely that there will be a fifth item.",
"items": {
"properties": {
"min": {
"type": "number",
"description": "Minimum size of that dimension."
},
"max": {
"type": "number",
"description": "Maximum size of the dimension. Not Required."
}
},
"required": ["min"],
"additionalProperties": false
},
"minItems": 1
},
"description": {
"type": "string",
"description": "Optional string to describe the input beyond the required format and dim_limits properties."
}
}
}
},
"properties": {
"format": {
"type": "array",
"description": "An array of acceptable file formats according to python MIME type. Example: image/jpeg, application/dicom.",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
},
"description": {
"type": "string",
"description": "Optional string to describe the input beyond the required format and dim_limits properties."
}
},
"required": ["format"],
"additionalProperties": false
},
"output": {
"type": "array",
"description": "An array of objects. Output properties. For outputs, we do not dictate the size. We do however identify the name and type. The ordering is important here. The model infer function will give outputs in the same order as defined here.",
"items": {
"properties": {
"name": {
"type": "string",
"description": "Output name."
},
"type": {
"type": "string",
"enum": [
"label_list",
"contour",
"vector",
"mask_image",
"heatmap",
"image",
"custom"
],
"description": "This could be one of the 6 types. See the 'options' property of this object for a full list of types. Each model can have at least one or more output type(s).",
"options": [
{
"name": "label_list",
"overlaid": false,
"description": "probabilities",
"file_type": "json"
},
{
"name": "contour",
"overlaid": false,
"description": "A list (or lists) of coordinates identifying the contour of a mask.",
"file_type": "json"
},
{
"name": "vector",
"overlaid": false,
"description": "1d",
"file_type": "h5"
},
{
"name": "mask_image",
"overlaid": true,
"description": ">=2 dimensions. Single- or multi-channel. Discrete values.",
"file_type": "h5"
},
{
"name": "heatmap",
"overlaid": true,
"description": ">=2 dimensions. Single- or multi-channel. Continuous values.",
"file_type": "h5"
},
{
"name": "image",
"overlaid": false,
"description": ">=2 dimensions. Single- or multi-channel. Continuous values.",
"file_type": "h5"
},
{
"name": "custom",
"description": "Alien format we are not able to deal with yet.",
"file_type": "h5"
}
]
},
"description": {
"type": "string",
"description": "Optional string to describe the output beyond the required name and type properties."
}
},
"required": ["name", "type"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["input", "output"],
"additionalProperties": false
}
},
"required": [
"description",
"provenance",
"architecture",
"learning_type",
"format",
"io"
],
"additionalProperties": false
},
"modelhub": {
"type": "object",
"description": "This property is required but it has a free structure and should be added by the modelhub team. It can be helful if the modelhub web app requires certain parameters for correctly visualizing input/outputs.",
"properties": {},
"required": [],
"modelhubOptionalProperties": [
"allow_user_test",
"allow_sample_demo",
"top",
"sort"
],
"additionalProperties": true
}
},
"required": ["id", "meta", "model", "modelhub"],
"additionalProperties": false
}