Parser and validator library for bioimage.io specifications
Project description
Specifications for bioimage.io
This repository contains specifications defined by the bioimage.io community. These specifications are used for defining fields in YAML 1.2 files which should be named rdf.yaml. Such a rdf.yaml --- along with 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).
bioimage.io-compatible resources must fulfill the following rules:
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 bioimage.io-compliant is to call bioimageio.core.validate from the bioimageio.core Python package.
The bioimageio.core Python package also provides the bioimageio command line interface (CLI) with the validate command:
bioimageio validate path/to/your/rdf.yaml
Format version overview
All bioimage.io description formats are defined as Pydantic models.
| type | format version | documentation |
|---|---|---|
| model | 0.5 0.4 |
model_spec_v0-5.md model_spec_v0-4.md |
| dataset | 0.3 0.2 |
dataset_spec_v0-3.md dataset_spec_v0-2.md |
| notebook | 0.3 0.2 |
notebook_spec_v0-3.md notebook_spec_v0-2.md |
| application | 0.3 0.2 |
application_spec_v0-3.md application_spec_v0-2.md |
| collection | 0.3 0.2 |
collection_spec_v0-3.md collection_spec_v0-2.md |
| generic | 0.3 0.2 |
generic_spec_v0-3.md generic_spec_v0-2.md |
JSON schema
Simplified descriptions are available as JSON schema:
| bioimageio.spec version | JSON schema |
|---|---|
| latest | bioimageio_schema_latest.json |
| 0.5 | bioimageio_schema_v0-5.json |
These are primarily intended for syntax highlighting and form generation.
Examples
We provide some examples for using rdf.yaml files to describe models, applications, notebooks and datasets.
💁 Recommendations
- Due to the limitations of storage services such as Zenodo, which does not support subfolders, it is recommended to place other files in the same directory level of the
rdf.yamlfile and try to avoid using subdirectories. - Use the bioimageio.core Python package to validate your
rdf.yamlfile. - bioimageio.spec keeps evolving. Try to use and upgrade to the most current format version!
⌨ bioimageio command-line interface (CLI)
The bioimageio CLI has moved entirely to bioimageio.core.
🖥 Installation
bioimageio.spec can be installed with either conda or pip, we recommend to install bioimageio.core instead:
conda install -c conda-forge bioimageio.core
or
pip install -U bioimageio.core
🤝 How to contribute
♥ Contributors
Made with contrib.rocks.
Δ Changelog
bioimageio.spec Python package
bioimageio.spec 0.5.0post1
- fix
_internal.io_utils.identify_bioimageio_yaml_file()
bioimageio.spec 0.5.0
- new description formats: generic 0.3, application 0.3, collection 0.3, dataset 0.3, notebook 0.3 and model 0.5.
- various API changes, most important functions:
bioimageio.spec.load_description(replacesload_raw_resource_description, interface changed)bioimageio.spec.validate_format(new)bioimageio.spec.dump_description(replacesserialize_raw_resource_description_to_dict, interface changed)bioimageio.spec.update_format(interface changed)
- switch from Marshmallow to Pydantic
- extended validation
- one joint, more precise JSON schema
bioimageio.spec 0.4.9
- small bugixes
- better type hints
- improved tests
bioimageio.spec 0.4.8post1
- add
axesandepstoscale_mean_var
bioimageio.spec 0.4.7post1
- add simple forward compatibility by treating future format versions as latest known (for the respective resource type)
bioimageio.spec 0.4.6post3
-
Make CLI output more readable
-
find redirected URLs when checking for URL availability
bioimageio.spec 0.4.6post2
-
Improve error message for non-existing RDF file path given as string
-
Improve documentation for model description's
documentationfield
bioimageio.spec 0.4.6post1
- fix enrich_partial_rdf_with_imjoy_plugin (see https://github.com/bioimage-io/spec-bioimage-io/pull/452)
bioimageio.spec 0.4.5post16
- fix rdf_update of entries in
resolve_collection_entries()
bioimageio.spec 0.4.5post15
- pass root to
enrich_partial_rdfarg ofresolve_collection_entries()
bioimageio.spec 0.4.5post14
- keep
ResourceDescrption.root_pathas URI for remote resources. This fixes the collection description as the collection entries are resolved after the collection description has been loaded.
bioimageio.spec 0.4.5post13
- new bioimageio.spec.partner module adding validate-partner-collection command if optional 'lxml' dependency is available
bioimageio.spec 0.4.5post12
-
new env var
BIOIMAGEIO_CACHE_WARNINGS_LIMIT(default: 3) to avoid spam from cache hit warnings -
more robust conversion of ImportableSourceFile for absolute paths to relative paths (don't fail on non-path source file)
bioimageio.spec 0.4.5post11
- resolve symlinks when transforming absolute to relative paths during serialization; see #438
bioimageio.spec 0.4.5post10
- fix loading of collection description with id (id used to be ignored)
bioimageio.spec 0.4.5post9
- support loading bioimageio resources by their animal nickname (currently only models have nicknames).
bioimageio.spec 0.4.5post8
-
any field previously expecting a local relative path is now also accepting an absolute path
-
load_raw_resource_description returns a raw resource description which has no relative paths (any relative paths are converted to absolute paths).
bioimageio.spec 0.4.4post7
- add command
commands.update_rdf()/update-rdf(cli)
bioimageio.spec 0.4.4post2
- fix unresolved ImportableSourceFile
bioimageio.spec 0.4.4post1
- fix collection description conversion for type field
bioimageio.spec 0.4.3post1
-
fix to shape validation for model description 0.4: output shape now needs to be bigger than halo
-
moved objects from bioimageio.spec.shared.utils to bioimageio.spec.shared[.node_transformer]
-
additional keys to validation summary: bioimageio_spec_version, status
bioimageio.spec 0.4.2post4
- fixes to generic description:
- ignore value of field
root_pathif present in yaml. This field is used internally and always present in RDF nodes.
- ignore value of field
bioimageio.spec 0.4.1.post5
- fixes to collection description:
- RDFs specified directly in collection description are validated correctly even if their source field does not point to an RDF.
- nesting of collection description allowed
bioimageio.spec 0.4.1.post4
-
fixed missing field
iconin generic description's raw node -
fixes to collection description:
- RDFs specified directly in collection description are validated correctly
- no nesting of collection description allowed for now
linksis no longer an explicit collection entry field ("moved" to unknown)
bioimageio.spec 0.4.1.post0
- new model spec 0.3.5 and 0.4.1
bioimageio.spec 0.4.0.post3
load_raw_resource_descriptionno longer acceptsupdate_to_current_formatkwarg (useupdate_to_formatinstead)
bioimageio.spec 0.4.0.post2
load_raw_resource_descriptionacceptsupdate_to_formatkwarg
Resource Description Format Versions
generic 0.3.0 / application 0.3.0 / collection 0.3.0 / dataset 0.3.0 / notebook 0.3.0
- Breaking canges that are fully auto-convertible
- dropped
download_url - dropped non-file attachments
attachments.filesmoved toattachments.i.source
- dropped
- Non-breaking changes
- added optional
parentfield
- added optional
model 0.5.0
all generic 0.3.0 changes (except models already have the parent field) plus:
- Breaking changes that are partially auto-convertible
inputs.i.axesare now defined in more detail (same foroutputs.i.axes)inputs.i.shapemoved per axes toinputs.i.axes.size(same foroutputs.i.shape)- new pre-/postprocessing 'fixed_zero_mean_unit_variance' separated from 'zero_mean_unit_variance', where
mode=fixedis no longer valid. (for scalar values this is auto-convertible.)
- Breaking changes that are fully auto-convertible
- changes in
weights.pytorch_state_dict.architecture- renamed
weights.pytorch_state_dict.architecture.source_fileto...architecture.source
- renamed
- changes in
weights.pytorch_state_dict.dependencies- only conda environment allowed and specified by
weights.pytorch_state_dict.dependencies.source - new optional field
weights.pytorch_state_dict.dependencies.sha256
- only conda environment allowed and specified by
- changes in
weights.tensorflow_model_bundle.dependencies- same as changes in
weights.pytorch_state_dict.dependencies
- same as changes in
- moved
test_inputstoinputs.i.test_tensor - moved
test_outputstooutputs.i.test_tensor - moved
sample_inputstoinputs.i.sample_tensor - moved
sample_outputstooutputs.i.sample_tensor - renamed
inputs.i.nametoinputs.i.id - renamed
outputs.i.nametooutputs.i.id - renamed
inputs.i.preprocessing.nametoinputs.i.preprocessing.id - renamed
outputs.i.postprocessing.nametooutputs.i.postprocessing.id
- changes in
- Non-breaking changes:
- new pre-/postprocessing:
id='ensure_dtype' with kwargdtype
- new pre-/postprocessing:
generic 0.2.4 and model 0.4.10
- Breaking changes that are fully auto-convertible
idoverwritten with value fromconfig.bioimageio.nicknameif available
- Non-breaking changes
version_numberis a new, optional field indicating that an RDF is the nth published version with a givenidid_emojiis a new, optional field (set fromconfig.bioimageio.nickname_iconif available)uploaderis a new, optional field withemailand an optionalnamesubfields
model 0.4.9
- Non-breaking changes
- make pre-/postprocessing kwargs
modeandaxesalways optional for model description 0.3 and 0.4
- make pre-/postprocessing kwargs
model 0.4.8
- Non-breaking changes
citefield is now optional
generic 0.2.2 and model 0.4.7
- Breaking changes that are fully auto-convertible
- name field may not include '/' or '' (conversion removes these)
model 0.4.6
- Non-breaking changes
- Implicit output shape can be expanded by inserting
nullintoshape:scaleand indicating length of new dimension D in theoffsetfield. Keep in mind thatD=2*'offset'.
- Implicit output shape can be expanded by inserting
model 0.4.5
- Breaking changes that are fully auto-convertible
parentfield changed to hold a string that is a bioimage.io ID, a URL or a local relative path (and not subfieldsuriandsha256)
model 0.4.4
- Non-breaking changes
- new optional field
training_data
- new optional field
dataset 0.2.2
- Non-breaking changes
- explicitly define and document dataset description (for now, clone of generic description with type="dataset")
model 0.4.3
- Non-breaking changes
- add optional field
download_url - add optional field
dependenciesto all weight formats (not only pytorch_state_dict) - add optional
pytorch_versionto the pytorch_state_dict and torchscript weight formats
- add optional field
model 0.4.2
- Bug fixes:
- in a
pytorch_state_dictweight entryarchitectureis no longer optional.
- in a
collection 0.2.2
-
Non-breaking changes
- make
authors,cite,documentationandtagsoptional
- make
-
Breaking changes that are fully auto-convertible
- Simplifies collection description 0.2.1 by merging resource type fields together to a
collectionfield, holindg a list of all resources in the specified collection.
- Simplifies collection description 0.2.1 by merging resource type fields together to a
generic 0.2.2 / model 0.3.6 / model 0.4.2
- Non-breaking changes
rdf_sourcenew optional fieldidnew optional field
collection 0.2.1
- First official release, extends generic description with fields
application,model,dataset,notebookand (nested)collection, which hold lists linking to respective resources.
generic 0.2.1
- Non-breaking changes
- add optional
emailandgithub_userfields to entries inauthors - add optional
maintainersfield (entries like inauthorsbutgithub_useris required (andnameis not))
- add optional
model 0.4.1
-
Breaking changes that are fully auto-convertible
- moved field
dependenciestoweights:pytorch_state_dict:dependencies
- moved field
-
Non-breaking changes
documentationfield accepts URLs as well
model 0.3.5
- Non-breaking changes
documentationfield accepts URLs as well
model 0.4.0
-
Breaking changes
- model inputs and outputs may not use duplicated names.
- model field
sha256is required ifpytorch_state_dictweights are defined. and is now moved to thepytroch_state_dictentry asarchitecture_sha256.
-
Breaking changes that are fully auto-convertible
- model fields language and framework are removed.
- model field
sourceis renamedarchitectureand is moved together withkwargsto thepytorch_state_dictweights entry (if it exists, otherwise they are removed). - the weight format
pytorch_scriptwas renamed totorchscript.
-
Other changes
- model inputs (like outputs) may be defined by
scaleing andoffseting areference_tensor - a
maintainersfield was added to the model description. - the entries in the
authorsfield may now additionally containemailorgithub_user. - the summary returned by the
validatecommand now also contains a list of warnings. - an
update_formatcommand was added to aid with updating older RDFs by applying auto-conversion.
- model inputs (like outputs) may be defined by
model 0.3.4
- Non-breaking changes
- Add optional parameter
epstoscale_rangepostprocessing.
- Add optional parameter
model 0.3.3
- Breaking changes that are fully auto-convertible
reference_inputfor implicit output tensor shape was renamed toreference_tensor
model 0.3.2
-
Breaking changes
- The RDF file name in a package should be
rdf.yamlfor all the RDF (notmodel.yaml); - Change
authorsandpackaged_byfields from List[str] to List[Author] with Author consisting of a dictionary{name: '<Full name>', affiliation: '<Affiliation>', orcid: 'optional orcid id'}; - Add a mandatory
typefield to comply with the generic description. Only valid value is 'model' for model description; - Only allow
licenseidentifier from the SPDX license list;
- The RDF file name in a package should be
-
Non-breaking changes
- Add optional
versionfield (default 0.1.0) to keep track of model changes; - Allow the values in the
attachmentslist to be any values besides URI;
- Add optional
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bioimageio.spec-0.5.0.post1.tar.gz.
File metadata
- Download URL: bioimageio.spec-0.5.0.post1.tar.gz
- Upload date:
- Size: 152.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e07a7ae0133f7750818b4057aa57d10a5f3319f04d68b831bd037879a910280
|
|
| MD5 |
bfa672a76800bdc8d1c3c3b63621df60
|
|
| BLAKE2b-256 |
e2ac027865609ec20f59cac2280b7ff09dc6e318829420d36f7b0caa86ca0542
|
File details
Details for the file bioimageio.spec-0.5.0.post1-py3-none-any.whl.
File metadata
- Download URL: bioimageio.spec-0.5.0.post1-py3-none-any.whl
- Upload date:
- Size: 186.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55d5f1a8d159879e576dda6f028a77409165e5a388e5a6d9139f619f3014d41b
|
|
| MD5 |
dabe294d2a9cbe63640276c659b1292a
|
|
| BLAKE2b-256 |
f6bba2b7872ee42b98d22906e89ffcf4930c5a2f8ed672d0dcba3f3f2fec03fd
|