Specification of the fields used in a bioimage.io-compliant RDF that describes AI models with pretrained weights.
These fields are typically stored in a YAML file which we call a model resource description file (model RDF).
General notes on this documentation:
symbol | explanation |
---|---|
field type hint |
A fields's expected type may be shortened. If so, the abbreviated or full type is displayed below the field's description and can expanded to view further (nested) details if available. |
Union[A, B, ...] | indicates that a field value may be of type A or B, etc. |
Literal[a, b, ...] | indicates that a field value must be the specific value a or b, etc. |
Type* := Type (restrictions) | A field Type* followed by an asterisk indicates that annotations, e.g. value restriction apply. These are listed in parentheses in the expanded type description. They are not always intuitively understandable and merely a hint at more complex validation. |
<type>.v<major>_<minor>.<sub spec> | Subparts of a spec might be taken from another spec type or format version. |
field ≝ default |
Default field values are indicated after '≝' and make a field optional. However, type and format_version alwyas need to be set for resource descriptions written as YAML files and determine which bioimage.io specification applies. They are optional only when creating a resource description in Python code using the appropriate, type and format_version specific class. |
field ≝ 🡇 |
Default field value is not displayed in-line, but in the code block below. |
∈📦 | Files referenced in fields which are marked with '∈📦 ' are included when packaging the resource to a .zip archive. The resource description YAML file (RDF) is always included well as 'rdf.yaml'. |
Specialized resource type 'model'
Version of the bioimage.io model description specification used.
When creating a new model always use the latest micro/patch version described here.
The format_version
is important for any consumer software to understand how to parse the fields.
The authors are the creators of the model RDF and the primary points of contact.
Sequence[generic.v0_2.Author]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
∈📦 URL or relative path to a markdown file with additional documentation.
The recommended documentation file name is README.md
. An .md
suffix is mandatory.
The documentation should include a '[#[#]]# Validation' (sub)section
with details on how to quantitatively validate the model on unseen data.
Examples: ['https://github.com/raw/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md', '…']
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
Describes the input tensors expected by this model.
Sequence[InputTensorDescr]
InputTensorDescr:
Tensor name. No duplicates are allowed.
Axes identifying characters. Same length and order as the axes in shape
.
axis | description |
---|---|
b | batch (groups multiple samples) |
i | instance/index/element |
t | time |
c | channel |
z | spatial dimension z |
y | spatial dimension y |
x | spatial dimension x |
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
If not specified, the full data range that can be expressed in data_type
is allowed.
Optional[Sequence[float (allow_inf_nan=True), float (allow_inf_nan=True)]]
For now an input tensor is expected to be given as float32
.
The data flow in bioimage.io models is explained
in this diagram..
Specification of input tensor shape. Examples: [(1, 512, 512, 1), {'min': (1, 64, 64, 1), 'step': (0, 32, 32, 0)}]
Union[Sequence[int], ParameterizedInputShape]
ParameterizedInputShape:
The minimum input shape
The minimum shape change
Description of how this input should be preprocessed.
Sequence[Union[BinarizeDescr, ..., ScaleRangeDescr]*]
Sequence of Union[BinarizeDescr, ClipDescr, ScaleLinearDescr, SigmoidDescr, ZeroMeanUnitVarianceDescr, ScaleRangeDescr] (Discriminator(discriminator='name', custom_error_type=None, custom_error_message=None, custom_error_context=None))
BinarizeDescr:
ClipDescr:
ClipKwargs
ClipKwargs:
minimum value for clipping
maximum value for clipping
ScaleLinearDescr:
ScaleLinearKwargs
ScaleLinearKwargs:
The subset of axes to scale jointly. For example xy to scale the two image axes for 2d data jointly. Example: 'xy'
Optional[str (RestrictCharacters(alphabet='czyx'); AfterValidator(validate_unique_entries))]
multiplicative factor
additive term
SigmoidDescr:
ZeroMeanUnitVarianceDescr:
ZeroMeanUnitVarianceKwargs
ZeroMeanUnitVarianceKwargs:
Mode for computing mean and variance.
mode | description |
---|---|
fixed | Fixed values for mean and variance |
per_dataset | Compute for the entire dataset |
per_sample | Compute for each sample individually |
Literal[fixed, per_dataset, per_sample]
The subset of axes to normalize jointly.
For example xy
to normalize the two image axes for 2d data jointly.
Example: 'xy'
The mean value(s) to use for mode: fixed
.
For example [1.1, 2.2, 3.3]
in the case of a 3 channel image with axes: xy
.
Example: (1.1, 2.2, 3.3)
Union[float, Sequence[float] (MinLen(min_length=1)), None]
The standard deviation values to use for mode: fixed
. Analogous to mean.
Example: (0.1, 0.2, 0.3)
Union[float, Sequence[float] (MinLen(min_length=1)), None]
epsilon for numeric stability: out = (tensor - mean) / (std + eps)
.
ScaleRangeDescr:
ScaleRangeKwargs
ScaleRangeKwargs:
Mode for computing percentiles.
mode | description |
---|---|
per_dataset | compute for the entire dataset |
per_sample | compute for each sample individually |
The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly. Example: 'xy'
The lower percentile used for normalization.
The upper percentile used for normalization
Has to be bigger than min_percentile
.
The range is 1 to 100 instead of 0 to 100 to avoid mistakenly
accepting percentiles specified in the range 0.0 to 1.0.
Epsilon for numeric stability.
out = (tensor - v_lower) / (v_upper - v_lower + eps)
;
with v_lower,v_upper
values at the respective percentiles.
Tensor name to compute the percentiles from. Default: The tensor itself.
For any tensor in inputs
only input tensor references are allowed.
For a tensor in outputs
only input tensor refereences are allowed if mode: per_dataset
A SPDX license identifier. We do notsupport custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community. Examples: ['CC0-1.0', 'MIT', 'BSD-2-Clause']
Union[_internal.license_id.LicenseId, str]
A human-readable name of this model. It should be no longer than 64 characters and only contain letter, number, underscore, minus or space characters.
Describes the output tensors.
Sequence[OutputTensorDescr]
OutputTensorDescr:
Tensor name. No duplicates are allowed.
Axes identifying characters. Same length and order as the axes in shape
.
axis | description |
---|---|
b | batch (groups multiple samples) |
i | instance/index/element |
t | time |
c | channel |
z | spatial dimension z |
y | spatial dimension y |
x | spatial dimension x |
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
If not specified, the full data range that can be expressed in data_type
is allowed.
Optional[Sequence[float (allow_inf_nan=True), float (allow_inf_nan=True)]]
Data type. The data flow in bioimage.io models is explained in this diagram..
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
Output tensor shape.
Union[Sequence[int], ImplicitOutputShape]
ImplicitOutputShape:
Name of the reference tensor.
output_pix/input_pix for each dimension.
'null' values indicate new dimensions, whose length is defined by 2*offset
Position of origin wrt to input.
Sequence[Union[int, float (MultipleOf(multiple_of=0.5))]]
The halo
that should be cropped from the output tensor to avoid boundary effects.
The halo
is to be cropped from both sides, i.e. shape_after_crop = shape - 2 * halo
.
To document a halo
that is already cropped by the model shape.offset
has to be used instead.
Description of how this output should be postprocessed.
Sequence[Union[BinarizeDescr, ..., ScaleMeanVarianceDescr]*]
Sequence of Union of
- BinarizeDescr
- ClipDescr
- ScaleLinearDescr
- SigmoidDescr
- ZeroMeanUnitVarianceDescr
- ScaleRangeDescr
- ScaleMeanVarianceDescr
(Discriminator(discriminator='name', custom_error_type=None, custom_error_message=None, custom_error_context=None))
BinarizeDescr:
BinarizeKwargs
BinarizeKwargs:
The fixed threshold
ClipDescr:
ClipKwargs
ClipKwargs:
minimum value for clipping
maximum value for clipping
ScaleLinearDescr:
ScaleLinearKwargs
ScaleLinearKwargs:
The subset of axes to scale jointly. For example xy to scale the two image axes for 2d data jointly. Example: 'xy'
Optional[str (RestrictCharacters(alphabet='czyx'); AfterValidator(validate_unique_entries))]
multiplicative factor
additive term
SigmoidDescr:
ZeroMeanUnitVarianceDescr:
ZeroMeanUnitVarianceKwargs
ZeroMeanUnitVarianceKwargs:
Mode for computing mean and variance.
mode | description |
---|---|
fixed | Fixed values for mean and variance |
per_dataset | Compute for the entire dataset |
per_sample | Compute for each sample individually |
Literal[fixed, per_dataset, per_sample]
The subset of axes to normalize jointly.
For example xy
to normalize the two image axes for 2d data jointly.
Example: 'xy'
The mean value(s) to use for mode: fixed
.
For example [1.1, 2.2, 3.3]
in the case of a 3 channel image with axes: xy
.
Example: (1.1, 2.2, 3.3)
Union[float, Sequence[float] (MinLen(min_length=1)), None]
The standard deviation values to use for mode: fixed
. Analogous to mean.
Example: (0.1, 0.2, 0.3)
Union[float, Sequence[float] (MinLen(min_length=1)), None]
epsilon for numeric stability: out = (tensor - mean) / (std + eps)
.
ScaleRangeDescr:
ScaleRangeKwargs
ScaleRangeKwargs:
Mode for computing percentiles.
mode | description |
---|---|
per_dataset | compute for the entire dataset |
per_sample | compute for each sample individually |
The subset of axes to normalize jointly. For example xy to normalize the two image axes for 2d data jointly. Example: 'xy'
The lower percentile used for normalization.
The upper percentile used for normalization
Has to be bigger than min_percentile
.
The range is 1 to 100 instead of 0 to 100 to avoid mistakenly
accepting percentiles specified in the range 0.0 to 1.0.
Epsilon for numeric stability.
out = (tensor - v_lower) / (v_upper - v_lower + eps)
;
with v_lower,v_upper
values at the respective percentiles.
Tensor name to compute the percentiles from. Default: The tensor itself.
For any tensor in inputs
only input tensor references are allowed.
For a tensor in outputs
only input tensor refereences are allowed if mode: per_dataset
ScaleMeanVarianceDescr:
ScaleMeanVarianceKwargs
ScaleMeanVarianceKwargs:
Mode for computing mean and variance.
mode | description |
---|---|
per_dataset | Compute for the entire dataset |
per_sample | Compute for each sample individually |
Name of tensor to match.
The subset of axes to scale jointly. For example xy to normalize the two image axes for 2d data jointly. Default: scale all non-batch axes jointly. Example: 'xy'
Optional[str (RestrictCharacters(alphabet='czyx'); AfterValidator(validate_unique_entries))]
Epsilon for numeric stability: "`out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.
∈📦 Test input tensors compatible with the inputs
description for a single test case.
This means if your model has more than one input, you should provide one URL/relative path for each input.
Each test input should be a file with an ndarray in
numpy.lib file format.
The extension must be '.npy'.
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'); WithSuffix(suffix='.npy', case_sensitive=True))
∈📦 Analog to test_inputs
.
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'); WithSuffix(suffix='.npy', case_sensitive=True))
Timestamp in ISO 8601 format with a few restrictions listed here.
The weights for this model. Weights can be given for different formats, but should otherwise be equivalent. The available weight formats determine which consumers can use this model.
WeightsDescr
WeightsDescr:
Optional[KerasHdf5WeightsDescr]
KerasHdf5WeightsDescr:
∈📦 The weights file.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
TensorFlow version used to create these weights
Optional[_internal.version_type.Version]
Optional[OnnxWeightsDescr]
OnnxWeightsDescr:
∈📦 The weights file.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
ONNX opset version
Optional[PytorchStateDictWeightsDescr]
PytorchStateDictWeightsDescr:
∈📦 The weights file.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
callable returning a torch.nn.Module instance.
Local implementation: <relative path to file>:<identifier of implementation within the file>
.
Implementation in a dependency: <dependency-package>.<[dependency-module]>.<identifier>
.
Examples: ['my_function.py:MyNetworkClass', 'my_module.submodule.get_my_model']
Union[CallableFromFile, CallableFromDepencency]
The SHA256 of the architecture source file, if the architecture is not defined in a module listed in dependencies
You can drag and drop your file to this
online tool to generate a SHA256 in your browser.
Or you can generate a SHA256 checksum with Python's hashlib
,
here is a codesnippet.
Optional[_internal.io_basics.Sha256]
key word arguments for the architecture
callable
Version of the PyTorch library used.
If depencencies
is specified it should include pytorch and the verison has to match.
(dependencies
overrules pytorch_version
)
Optional[_internal.version_type.Version]
Optional[TensorflowJsWeightsDescr]
TensorflowJsWeightsDescr:
∈📦 The multi-file weights. All required files/folders should be a zip archive.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
Version of the TensorFlow library used.
Optional[_internal.version_type.Version]
Optional[TensorflowSavedModelBundleWeightsDescr]
TensorflowSavedModelBundleWeightsDescr:
∈📦 The weights file.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
Version of the TensorFlow library used.
Optional[_internal.version_type.Version]
Optional[TorchscriptWeightsDescr]
TorchscriptWeightsDescr:
∈📦 The weights file.
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Attachments that are specific to this weights entry.
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Authors
Either the person(s) that have trained this model resulting in the original weights file.
(If this is the initial weights entry, i.e. it does not have a parent
)
Or the person(s) who have converted the weights to this weights format.
(If this is a child weight, i.e. it has a parent
field)
Optional[Sequence[generic.v0_2.Author]]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Dependency manager and dependency file, specified as <dependency manager>:<relative file path>
.
Examples: ['conda:environment.yaml', 'maven:./pom.xml', 'pip:./requirements.txt']
The source weights these weights were converted from.
For example, if a model's weights were converted from the pytorch_state_dict
format to torchscript
,
The pytorch_state_dict
weights entry has no parent
and is the parent of the torchscript
weights.
All weight entries except one (the initial set of weights resulting from training the model),
need to have this field.
Example: 'pytorch_state_dict'
Optional[Literal[keras_hdf5, onnx, pytorch_state_dict, tensorflow_js, tensorflow_saved_model_bundle, torchscript]]
Version of the PyTorch library used.
Optional[_internal.version_type.Version]
file and other attachments
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
citations
Sequence[generic.v0_2.CiteEntry]
generic.v0_2.CiteEntry:
free text description
A digital object identifier (DOI) is the prefered citation reference.
See https://www.doi.org/ for details. (alternatively specify url
)
URL to cite (preferably specify a doi
instead)
A field for custom configuration that can contain any keys not present in the RDF spec.
This means you should not store, for example, a github repo URL in config
since we already have the
git_repo
field defined in the spec.
Keys in config
may be very specific to a tool or consumer software. To avoid conflicting definitions,
it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name,
for example:
config:
bioimageio: # here is the domain name
my_custom_key: 3837283
another_key:
nested: value
imagej: # config specific to ImageJ
macro_dir: path/to/macro/file
If possible, please use snake_case
for keys in config
.
You may want to list linked files additionally under attachments
to include them when packaging a resource
(packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains
an altered rdf.yaml file with local references to the downloaded files)
Example: {'bioimageio': {'my_custom_key': 3837283, 'another_key': {'nested': 'value'}}, 'imagej': {'macro_dir': 'path/to/macro/file'}}
Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff') Example: 'cover.png'
Sequence[Union[Path*, _internal.io.RelativeFilePath, _internal.url.HttpUrl]*]
Sequence of Union[Path (PathType(path_type='file'); Predicate(is_absolute)), _internal.io.RelativeFilePath, _internal.url.HttpUrl] (union_mode='left_to_right'; WithSuffix(suffix=('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff'), case_sensitive=False); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
URL to download the resource from (deprecated)
A URL to the Git repository where the resource is being developed. Example: 'https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad'
An icon for illustration
Union[str*, Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*, None]
Union of
- str (Len(min_length=1, max_length=2))
- Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
- None
Model zoo (bioimage.io) wide, unique identifier (assigned by bioimage.io)
UTF-8 emoji for display alongside the id
.
Optional[str (Len(min_length=1, max_length=1))]
IDs of other bioimage.io resources Example: ('ilastik/ilastik', 'deepimagej/deepimagej', 'zero/notebook_u-net_3d_zerocostdl4mic')
Maintainers of this resource.
If not specified authors
are maintainers and at least some of them should specify their github_user
name
Sequence[generic.v0_2.Maintainer]
generic.v0_2.Maintainer:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Optional[str (AfterValidator(_remove_slashes))]
The persons that have packaged and uploaded this model.
Only required if those persons differ from the authors
.
Sequence[generic.v0_2.Author]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
The model from which this model is derived, e.g. by fine-tuning the weights.
Optional[LinkedModel]
LinkedModel:
A valid model id
from the bioimage.io collection.
version number (n-th published version, not the semantic version) of linked model
Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right')]
Custom run mode for this model: for more complex prediction procedures like test time data augmentation that currently cannot be expressed in the specification. No standard run modes are defined yet.
Optional[RunMode]
RunMode:
Run mode name
Run mode specific key word arguments
∈📦 URLs/relative paths to sample inputs to illustrate possible inputs for the model, for example stored as PNG or TIFF images. The sample files primarily serve to inform a human user about an example use case
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
∈📦 URLs/relative paths to sample outputs corresponding to the sample_inputs
.
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
Associated tags Example: ('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
The dataset used to train this model
Union[dataset.v0_2.LinkedDataset, dataset.v0_2.DatasetDescr, None]
dataset.v0_2.LinkedDataset:
A valid dataset id
from the bioimage.io collection.
version number (n-th published version, not the semantic version) of linked dataset
dataset.v0_2.DatasetDescr:
A human-friendly name of the resource description
Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff') Example: 'cover.png'
Sequence[Union[Path*, _internal.io.RelativeFilePath, _internal.url.HttpUrl]*]
Sequence of Union[Path (PathType(path_type='file'); Predicate(is_absolute)), _internal.io.RelativeFilePath, _internal.url.HttpUrl] (union_mode='left_to_right'; WithSuffix(suffix=('.gif', '.jpeg', '.jpg', '.png', '.svg', '.tif', '.tiff'), case_sensitive=False); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
UTF-8 emoji for display alongside the id
.
Optional[str (Len(min_length=1, max_length=1))]
The authors are the creators of the RDF and the primary points of contact.
Sequence[generic.v0_2.Author]
generic.v0_2.Author:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
file and other attachments
Optional[generic.v0_2.AttachmentsDescr]
generic.v0_2.AttachmentsDescr:
∈📦 File attachments
Sequence[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Sequence of Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
citations
Sequence[generic.v0_2.CiteEntry]
generic.v0_2.CiteEntry:
free text description
A digital object identifier (DOI) is the prefered citation reference.
See https://www.doi.org/ for details. (alternatively specify url
)
URL to cite (preferably specify a doi
instead)
A field for custom configuration that can contain any keys not present in the RDF spec.
This means you should not store, for example, a github repo URL in config
since we already have the
git_repo
field defined in the spec.
Keys in config
may be very specific to a tool or consumer software. To avoid conflicting definitions,
it is recommended to wrap added configuration into a sub-field named with the specific domain or tool name,
for example:
config:
bioimageio: # here is the domain name
my_custom_key: 3837283
another_key:
nested: value
imagej: # config specific to ImageJ
macro_dir: path/to/macro/file
If possible, please use snake_case
for keys in config
.
You may want to list linked files additionally under attachments
to include them when packaging a resource
(packaging a resource means downloading/copying important linked files and creating a ZIP archive that contains
an altered rdf.yaml file with local references to the downloaded files)
Example: {'bioimageio': {'my_custom_key': 3837283, 'another_key': {'nested': 'value'}}, 'imagej': {'macro_dir': 'path/to/macro/file'}}
URL to download the resource from (deprecated)
A URL to the Git repository where the resource is being developed. Example: 'https://github.com/bioimage-io/spec-bioimage-io/tree/main/example_descriptions/models/unet2d_nuclei_broad'
An icon for illustration
Union[str*, Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*, None]
Union of
- str (Len(min_length=1, max_length=2))
- Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
- None
IDs of other bioimage.io resources Example: ('ilastik/ilastik', 'deepimagej/deepimagej', 'zero/notebook_u-net_3d_zerocostdl4mic')
The person who uploaded the model (e.g. to bioimage.io)
Optional[generic.v0_2.Uploader]
generic.v0_2.Uploader:
name
Optional[str (AfterValidator(_remove_slashes))]
Maintainers of this resource.
If not specified authors
are maintainers and at least some of them should specify their github_user
name
Sequence[generic.v0_2.Maintainer]
generic.v0_2.Maintainer:
Affiliation
An ORCID iD in hyphenated groups of 4 digits, (and valid as per ISO 7064 11,2.) Example: '0000-0001-2345-6789'
Optional[_internal.types.OrcidId]
Optional[str (AfterValidator(_remove_slashes))]
Resource description file (RDF) source; used to keep track of where an rdf.yaml was loaded from. Do not set this field in a YAML file.
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right')]
Associated tags Example: ('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
The version of the resource following SemVer 2.0.
Optional[_internal.version_type.Version]
version number (n-th published version, not the semantic version)
The format version of this resource specification
(not the version
of the resource description)
When creating a new resource always use the latest micro/patch version described here.
The format_version
is important for any consumer software to understand how to parse the fields.
badges associated with this resource
Sequence[generic.v0_2.BadgeDescr]
generic.v0_2.BadgeDescr:
badge label to display on hover Example: 'Open in Colab'
badge icon Example: 'https://colab.research.google.com/assets/colab-badge.svg'
Union[Union[Path*, _internal.io.RelativeFilePath]*, _internal.url.HttpUrl, Url*, None]
Union of
- Union[Path (PathType(path_type='file')), _internal.io.RelativeFilePath] (AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))
- _internal.url.HttpUrl
- Url (max_length=2083 allowed_schemes=['http', 'https'])
- None
target URL Example: 'https://colab.research.google.com/github/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/U-net_2D_ZeroCostDL4Mic.ipynb'
∈📦 URL or relative path to a markdown file with additional documentation.
The recommended documentation file name is README.md
. An .md
suffix is mandatory.
Examples: ['https://github.com/raw/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md', '…']
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path*]*]
Optional[Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'))] (union_mode='left_to_right'; AfterValidator(wo_special_file_name); PlainSerializer(func=<function _package at 0x7fa8ebee2340>, return_type=PydanticUndefined, when_used='unless-none'))]
A SPDX license identifier. We do not support custom license beyond the SPDX license list, if you need that please open a GitHub issue to discuss your intentions with the community. Examples: ['CC0-1.0', 'MIT', 'BSD-2-Clause']
Union[_internal.license_id.LicenseId, _internal.license_id.DeprecatedLicenseId, str, None]
Model zoo (bioimage.io) wide, unique identifier (assigned by bioimage.io)
"URL to the source of the dataset.
The person who uploaded the model (e.g. to bioimage.io)
Optional[generic.v0_2.Uploader]
generic.v0_2.Uploader:
name
Optional[str (AfterValidator(_remove_slashes))]
The version of the resource following SemVer 2.0.
Optional[_internal.version_type.Version]
version number (n-th published version, not the semantic version)
0000-0001-2345-6789
- (1, 512, 512, 1)
- {'min': (1, 64, 64, 1), 'step': (0, 32, 32, 0)}
xy
xy
(1.1, 2.2, 3.3)
(0.1, 0.2, 0.3)
xy
- CC0-1.0
- MIT
- BSD-2-Clause
xy
xy
(1.1, 2.2, 3.3)
(0.1, 0.2, 0.3)
xy
xy
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
- my_function.py:MyNetworkClass
- my_module.submodule.get_my_model
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
0000-0001-2345-6789
- conda:environment.yaml
- maven:./pom.xml
- pip:./requirements.txt
pytorch_state_dict
{'bioimageio': {'my_custom_key': 3837283, 'another_key': {'nested': 'value'}}, 'imagej': {'macro_dir': 'path/to/macro/file'}}
cover.png
('ilastik/ilastik', 'deepimagej/deepimagej', 'zero/notebook_u-net_3d_zerocostdl4mic')
0000-0001-2345-6789
0000-0001-2345-6789
('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
cover.png
0000-0001-2345-6789
{'bioimageio': {'my_custom_key': 3837283, 'another_key': {'nested': 'value'}}, 'imagej': {'macro_dir': 'path/to/macro/file'}}
('ilastik/ilastik', 'deepimagej/deepimagej', 'zero/notebook_u-net_3d_zerocostdl4mic')
0000-0001-2345-6789
('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
Open in Colab
https://colab.research.google.com/assets/colab-badge.svg
- CC0-1.0
- MIT
- BSD-2-Clause