diff --git a/wsinfer_zoo/schemas/model-config.schema.json b/wsinfer_zoo/schemas/model-config.schema.json new file mode 100644 index 0000000..81edefe --- /dev/null +++ b/wsinfer_zoo/schemas/model-config.schema.json @@ -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" + ] +} diff --git a/wsinfer_zoo/schemas/wsinfer-zoo-registry.schema.json b/wsinfer_zoo/schemas/wsinfer-zoo-registry.schema.json new file mode 100644 index 0000000..e84897f --- /dev/null +++ b/wsinfer_zoo/schemas/wsinfer-zoo-registry.schema.json @@ -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 +}