data-snapshot / schemas /data-snapshot-eval-v1.3.schema.json
ajdajd's picture
Update schema file
ce57805
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.org/schemas/data-snapshot-eval-v1.3.schema.json",
"title": "Data Snapshot Evaluation Format (v1.3)",
"type": "object",
"additionalProperties": false,
"required": ["label_map", "info", "documents", "predictions"],
"properties": {
"label_map": {
"description": "Canonical mapping of integer label IDs to label names. Keys are strings that parse to positive integers.",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^[1-9][0-9]*$": { "type": "string", "minLength": 1 }
}
},
"info": {
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "type", "run_id", "model", "coordinate_system"],
"properties": {
"schema_version": { "type": "string", "const": "1.3" },
"type": {
"description": "Whether this file is ground truth or model predictions.",
"type": "string",
"enum": ["ground_truth", "prediction"]
},
"created_at": {
"description": "ISO8601 date or datetime string.",
"type": "string",
"minLength": 8
},
"run_id": {
"description": "Identifier for a prediction run. Null for ground truth.",
"type": ["string", "null"],
"minLength": 1
},
"model": {
"description": "Model metadata. Use {\"name\": \"human annotation\"} for ground truth.",
"type": "object",
"additionalProperties": true,
"required": ["name"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"version": { "type": ["string", "null"] },
"notes": { "type": ["string", "null"] }
}
},
"coordinate_system": {
"type": "object",
"additionalProperties": false,
"required": ["type", "range", "origin"],
"properties": {
"type": { "type": "string", "const": "normalized_xyxy" },
"range": {
"description": "Fixed numeric range for normalized coordinates.",
"type": "array",
"minItems": 2,
"maxItems": 2,
"prefixItems": [{ "type": "number", "const": 0.0 }, { "type": "number", "const": 1.0 }]
},
"origin": { "type": "string", "const": "top_left" }
}
}
}
},
"documents": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["doc_id", "doc_name", "doc_path"],
"properties": {
"doc_id": { "type": "string", "minLength": 1 },
"doc_name": { "type": "string", "minLength": 1 },
"doc_path": { "type": "string", "minLength": 1 }
}
}
},
"predictions": {
"description": "Per-page container of objects. Used for both GT and predictions.",
"type": "array",
"items": { "$ref": "#/$defs/pageEntry" }
}
},
"$defs": {
"bbox": {
"description": "Normalized [x1, y1, x2, y2] in [0,1].",
"type": "array",
"minItems": 4,
"maxItems": 4,
"prefixItems": [
{ "type": "number", "minimum": 0.0, "maximum": 1.0 },
{ "type": "number", "minimum": 0.0, "maximum": 1.0 },
{ "type": "number", "minimum": 0.0, "maximum": 1.0 },
{ "type": "number", "minimum": 0.0, "maximum": 1.0 }
]
},
"objectBase": {
"type": "object",
"additionalProperties": false,
"required": ["id", "label", "bbox"],
"properties": {
"id": { "type": "string", "minLength": 1 },
"label": {
"description": "Human-readable label name (must be consistent with label_map; enforced in code).",
"type": "string",
"minLength": 1
},
"bbox": { "$ref": "#/$defs/bbox" },
"attributes": {
"description": "Optional free-form metadata.",
"type": "object",
"additionalProperties": true
},
"score": {
"description": "Confidence score in [0,1]. Null for ground truth objects.",
"type": ["number", "null"],
"minimum": 0.0,
"maximum": 1.0
}
}
},
"pageEntry": {
"type": "object",
"additionalProperties": false,
"required": ["page_id", "doc_id", "page_index", "objects"],
"properties": {
"page_id": { "type": "string", "minLength": 1 },
"doc_id": { "type": "string", "minLength": 1 },
"page_index": { "type": "integer", "minimum": 0 },
"objects": {
"type": "array",
"items": { "$ref": "#/$defs/objectBase" }
}
}
}
}
}