dataeval.models.read_model_metadata¶
- dataeval.models.read_model_metadata(path)¶
Read and validate an opinionated model-metadata.json file.
Parses the
ioblock of the metadata file and returns its input/output contract as aModelIOSpec. The interface, color layout, and required shape fields are validated; detection metadata additionally reads the optional box count.- Parameters:¶
- Returns:¶
Validated, immutable view of the model’s input/output contract.
- Return type:¶
- Raises:¶
ValueError – If a required field is missing, or
io.interface/io.input.channelsholds an unsupported value.FileNotFoundError – If
pathdoes not exist.
See also
ModelIOSpecThe returned contract.
Examples
>>> spec = read_model_metadata(classifier_metadata_path) >>> spec.task 'IMAGE_CLASSIFICATION' >>> (spec.channels, spec.height, spec.width) ('RGB', 8, 8) >>> spec.n_classes 4