Specifications for bioimage.io¤
This repository contains the specifications of the standard format defined by the bioimage.io community for the content (i.e., models, datasets and applications) in the bioimage.io website.
Each item in the content is always described using a YAML 1.2 file named rdf.yaml or bioimageio.yaml.
This rdf.yaml bioimageio.yaml--- along with the files referenced in it --- can be downloaded from or uploaded to the bioimage.io website and may be produced or consumed by bioimage.io-compatible consumers (e.g., image analysis software like ilastik).
These are the latest format specifications that bioimage.io-compatible resources should comply to.
Note that the Python package PyYAML does not support YAML 1.2 . We therefore use and recommend ruyaml. For differences see https://ruamelyaml.readthedocs.io/en/latest/pyyaml.
Please also note that the best way to check whether your rdf.yaml file is fully bioimage.io-compliant, is to call bioimageio.core.test_description from the bioimageio.core Python package.
The bioimageio.core Python package also provides the bioimageio command line interface (CLI) with the test command:
bioimageio test path/to/your/rdf.yaml
Documentation¤
The bioimageio.spec documentation is hosted at https://bioimage-io.github.io/spec-bioimage-io.
Format version overview¤
All bioimage.io description formats are defined as Pydantic models, see API overview.
| Type | Format Version | Documentation1 | Developer Documentation2 |
|---|---|---|---|
| model | 0.5 0.4 | model 0.5 model 0.4 | bioimagio.spec.model.v0_5.ModelDescr bioimagio.spec.model.v0_4.ModelDescr |
| dataset | 0.3 0.2 | dataset 0.3 dataset 0.2 | v0_3.DatasetDescr v0_2.DatasetDescr |
| notebook | 0.3 0.2 | notebook 0.3 notebook 0.2 | v0_3.NotebookDescr v0_2.NotebookDescr |
| application | 0.3 0.2 | application 0.3 application 0.2 | v0_3.ApplicationDescr v0_2.ApplicationDescr |
| generic | 0.3 0.2 | - | v0_3.GenericDescr v0_2.GenericDescr |
JSON Schema¤
Simplified descriptions are available as JSON Schema (generated with Pydantic):
| bioimageio.spec version | JSON Schema | documentation1 |
|---|---|---|
| latest | bioimageio_schema_latest.json | latest documentation |
| 0.5 | bioimageio_schema_v0-5.json | 0.5 documentation |
Note: bioimageio_schema_v0-5.json and bioimageio_schema_latest.json are identical, but bioimageio_schema_latest.json will eventually refer to the future bioimageio_schema_v0-6.json.
Flattened, interactive docs¤
Alternatively to the above metadata format documentation, this flattened view of the metadata specification that also shows value constraints can be explored.
API overview¤
bioimageio.spec implements type and format version specific pydantic.BaseModel models for resources shared on bioimage.io.
The return type of bioimageio.spec.load_description() is bioimageio.spec.ResourceDescr.
This is a typing.Union over various format type and format version specific classes including InvalidDescr and GenericDescr.
The individual *Descr-classes of this Union can be instantiated in code to create a bioimage.io resource description in the first place.
For more narrow type hints and runtime-checks during loading dedicated load_*_description methods may be used:
load_model_descriptionload_dataset_description
Another way to narrow/check the return type is to call load_description/load_model_description/... with format_version="latest", returning bioimageio.spec.LatestResourceDescr/bioimageio.spec.ModelDescr (instead of bioimageio.spec.AnyModelDescr)/... .
To export resource descriptions:
save_bioimageio_packagesave_bioimageio_package_as_foldersave_bioimageio_package_to_streamsave_bioimageio_yaml_only
-
JSON Schema based documentation generated with json-schema-for-humans. ↩↩
-
Part of the bioimageio.spec API reference. ↩