Skip to content

Commit

Permalink
move schas dedicated dir + add model config schema
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczmarj committed Jun 20, 2023
1 parent 3e5aad5 commit bed3749
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
59 changes: 59 additions & 0 deletions wsinfer_zoo/schemas/model-config.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"properties": {
"num_classes": {
"type": "integer",
"description": "The number of classes the model outputs",
"minimum": 1
},
"patch_size_pixels": {
"type": "integer",
"description": "The size of the patch in pixels (eg 350)",
"minimum": 1
},
"spacing_um_px": {
"type": "number",
"description": "The spacing of the patch in micrometers per pixel (eg 0.5)",
"minimum": 0
},
"class_names": {
"type": "array",
"description": "The names of the classes the model outputs. Length must be equal to 'num_classes'.",
"items": {
"type": "string"
},
"uniqueItems": true
},
"transform": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": [
"Resize",
"ToTensor",
"Normalize"
]
},
"arguments": {
"type": "object"
}
},
"additionalProperties": false,
"required": [
"name"
]
}
}
},
"required": [
"num_classes",
"patch_size_pixels",
"spacing_um_px",
"class_names",
"transform"
]
}
34 changes: 34 additions & 0 deletions wsinfer_zoo/schemas/wsinfer-zoo-registry.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Schema for WSInfer Model Zoo registry file (wsinfer-zoo-registry.json)",
"type": "object",
"properties": {
"models": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"hf_repo_id": {
"type": "string"
},
"hf_revision": {
"type": "string"
}
},
"required": [
"description",
"hf_repo_id",
"hf_revision"
],
"additionalProperties": false
}
}
},
"required": [
"models"
],
"additionalProperties": false
}

0 comments on commit bed3749

Please sign in to comment.