Specification of the fields used in a bioimage.io-compliant RDF to describe 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_3.Author]
generic.v0_3.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]
citations
Sequence[generic.v0_3.CiteEntry]
generic.v0_3.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 string containing a brief description.
∈📦 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://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md', '…']
Union[Path (PathType(path_type='file'); Predicate(is_absolute); ), _internal.io.RelativeFilePath, _internal.url.HttpUrl]
Describes the input tensors expected by this model.
Sequence[bioimageio.spec.model.v0_5.InputTensorDescr]
InputTensorDescr:
Input tensor id. No duplicates are allowed across all inputs and outputs.
free text description
tensor axes
Sequence[typing.Annotated[typing.Union[bioimageio.spec.model.v0_5.BatchAxis, bioimageio.spec.model.v0_5.ChannelAxis, bioimageio.spec.model.v0_5.IndexInputAxis, bioimageio.spec.model.v0_5.TimeInputAxis, bioimageio.spec.model.v0_5.SpaceInputAxis], Discriminator(discriminator='type', custom_error_type=None, custom_error_message=None, custom_error_context=None)]]
Sequence[typing.Annotated[typing.Union[bioimageio.spec.model.v0_5.BatchAxis, bioimageio.spec.model.v0_5.ChannelAxis, bioimageio.spec.model.v0_5.IndexInputAxis, bioimageio.spec.model.v0_5.TimeInputAxis, bioimageio.spec.model.v0_5.SpaceInputAxis], Discriminator(discriminator='type', custom_error_type=None, custom_error_message=None, custom_error_context=None)]]
BatchAxis:
The batch size may be fixed to 1, otherwise (the default) it may be chosen arbitrarily depending on available memory
ChannelAxis:
Sequence[_internal.types.Identifier]
IndexInputAxis:
The size/length of this axis can be specified as
- fixed integer
- parameterized series of valid sizes (
ParameterizedSize
) - reference to another axis with an optional offset (
SizeReference
) Examples: [10, {'min': 32, 'step': 16}, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), ParameterizedSize, SizeReference]
ParameterizedSize:
SizeReference:
tensor id of the reference axis
axis id of the reference axis
If a model has a concatenable
input axis, it can be processed blockwise,
splitting a longer sample axis into blocks matching its input tensor description.
Output axes are concatenable if they have a SizeReference
to a concatenable
input axis.
TimeInputAxis:
The size/length of this axis can be specified as
- fixed integer
- parameterized series of valid sizes (
ParameterizedSize
) - reference to another axis with an optional offset (
SizeReference
) Examples: [10, {'min': 32, 'step': 16}, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), ParameterizedSize, SizeReference]
ParameterizedSize:
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Optional[Literal[attosecond, ..., zettasecond]]
Optional[Literal of
- attosecond
- centisecond
- day
- decisecond
- exasecond
- femtosecond
- gigasecond
- hectosecond
- hour
- kilosecond
- megasecond
- microsecond
- millisecond
- minute
- nanosecond
- petasecond
- picosecond
- second
- terasecond
- yoctosecond
- yottasecond
- zeptosecond
- zettasecond ]
If a model has a concatenable
input axis, it can be processed blockwise,
splitting a longer sample axis into blocks matching its input tensor description.
Output axes are concatenable if they have a SizeReference
to a concatenable
input axis.
SpaceInputAxis:
The size/length of this axis can be specified as
- fixed integer
- parameterized series of valid sizes (
ParameterizedSize
) - reference to another axis with an optional offset (
SizeReference
) Examples: [10, {'min': 32, 'step': 16}, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), ParameterizedSize, SizeReference]
ParameterizedSize:
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Examples: ['x', 'y', 'z']
Optional[Literal[attometer, ..., zettameter]]
Optional[Literal of
- attometer
- angstrom
- centimeter
- decimeter
- exameter
- femtometer
- foot
- gigameter
- hectometer
- inch
- kilometer
- megameter
- meter
- micrometer
- mile
- millimeter
- nanometer
- parsec
- petameter
- picometer
- terameter
- yard
- yoctometer
- yottameter
- zeptometer
- zettameter ]
If a model has a concatenable
input axis, it can be processed blockwise,
splitting a longer sample axis into blocks matching its input tensor description.
Output axes are concatenable if they have a SizeReference
to a concatenable
input axis.
An example tensor to use for testing. Using the model with the test input tensors is expected to yield the test output tensors. Each test tensor has be a an ndarray in the numpy.lib file format. The file extension must be '.npy'.
_internal.io.FileDescr
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
A sample tensor to illustrate a possible input/output for the model,
The sample image primarily serves to inform a human user about an example use case
and is typically stored as .hdf5, .png or .tiff.
It has to be readable by the imageio library
(numpy's .npy
format is not supported).
The image dimensionality has to match the number of axes specified in this tensor description.
Optional[_internal.io.FileDescr]
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Description of the tensor's data values, optionally per channel.
If specified per channel, the data type
needs to match across channels.
Union[NominalOrOrdinalDataDescr, IntervalOrRatioDataDescr, Sequence[typing.Union[bioimageio.spec.model.v0_5.NominalOrOrdinalDataDescr, bioimageio.spec.model.v0_5.IntervalOrRatioDataDescr]]*]
Union of
- NominalOrOrdinalDataDescr
- IntervalOrRatioDataDescr
- Sequence[typing.Union[bioimageio.spec.model.v0_5.NominalOrOrdinalDataDescr, bioimageio.spec.model.v0_5.IntervalOrRatioDataDescr]] (MinLen(min_length=1))
NominalOrOrdinalDataDescr:
A fixed set of nominal or an ascending sequence of ordinal values.
In this case data_type
is required to be an unsigend integer type, e.g. 'uint8'.
String values
are interpreted as labels for tensor values 0, ..., N.
Note: as YAML 1.2 does not natively support a "set" datatype,
nominal values should be given as a sequence (aka list/array) as well.
Union[Sequence[int]*, Sequence[float]*, Sequence[bool]*, Sequence[str]*]
Union of
- Sequence[int] (MinLen(min_length=1))
- Sequence[float] (MinLen(min_length=1))
- Sequence[bool] (MinLen(min_length=1))
- Sequence[str] (MinLen(min_length=1))
Examples: ['float32', 'uint8', 'uint16', 'int64', 'bool']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
Union[Literal[arbitrary unit], _internal.types.SiUnit, None]
IntervalOrRatioDataDescr:
Examples: ['float32', 'float64', 'uint8', 'uint16']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64]
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
None
corresponds to min/max of what can be expressed by data_type
.
Sequence[Optional[float], Optional[float]]
Union[Literal[arbitrary unit], _internal.types.SiUnit]
Scale for data on an interval (or ratio) scale.
Offset for data on a ratio scale.
NominalOrOrdinalDataDescr:
A fixed set of nominal or an ascending sequence of ordinal values.
In this case data_type
is required to be an unsigend integer type, e.g. 'uint8'.
String values
are interpreted as labels for tensor values 0, ..., N.
Note: as YAML 1.2 does not natively support a "set" datatype,
nominal values should be given as a sequence (aka list/array) as well.
Union[Sequence[int]*, Sequence[float]*, Sequence[bool]*, Sequence[str]*]
Union of
- Sequence[int] (MinLen(min_length=1))
- Sequence[float] (MinLen(min_length=1))
- Sequence[bool] (MinLen(min_length=1))
- Sequence[str] (MinLen(min_length=1))
Examples: ['float32', 'uint8', 'uint16', 'int64', 'bool']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
Union[Literal[arbitrary unit], _internal.types.SiUnit, None]
IntervalOrRatioDataDescr:
Examples: ['float32', 'float64', 'uint8', 'uint16']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64]
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
None
corresponds to min/max of what can be expressed by data_type
.
Sequence[Optional[float], Optional[float]]
Union[Literal[arbitrary unit], _internal.types.SiUnit]
Scale for data on an interval (or ratio) scale.
Offset for data on a ratio scale.
indicates that this tensor may be None
Description of how this input should be preprocessed.
notes:
- If preprocessing does not start with an 'ensure_dtype' entry, it is added to ensure an input tensor's data type matches the input tensor's data description.
- If preprocessing does not end with an 'ensure_dtype' or 'binarize' entry, an 'ensure_dtype' step is added to ensure preprocessing steps are not unintentionally changing the data type.
Sequence[Union[BinarizeDescr, ..., ScaleRangeDescr]*]
Sequence of Union of
- BinarizeDescr
- ClipDescr
- EnsureDtypeDescr
- ScaleLinearDescr
- SigmoidDescr
- FixedZeroMeanUnitVarianceDescr
- ZeroMeanUnitVarianceDescr
- ScaleRangeDescr
(Discriminator(discriminator='id', custom_error_type=None, custom_error_message=None, custom_error_context=None))
BinarizeDescr:
Union[BinarizeKwargs, BinarizeAlongAxisKwargs]
BinarizeKwargs:
The fixed threshold
BinarizeAlongAxisKwargs:
The fixed threshold values along axis
The threshold
axis
Example: 'channel'
ClipDescr:
model.v0_4.ClipKwargs
model.v0_4.ClipKwargs:
minimum value for clipping
maximum value for clipping
EnsureDtypeDescr:
EnsureDtypeKwargs
EnsureDtypeKwargs:
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
ScaleLinearDescr:
Union[ScaleLinearKwargs, ScaleLinearAlongAxisKwargs]
ScaleLinearKwargs:
multiplicative factor
additive term
ScaleLinearAlongAxisKwargs:
The axis of of gains/offsets values. Example: 'channel'
multiplicative factor
Union[float, Sequence[float] (MinLen(min_length=1))]
additive term
Union[float, Sequence[float] (MinLen(min_length=1))]
SigmoidDescr:
FixedZeroMeanUnitVarianceDescr:
Literal[fixed_zero_mean_unit_variance]
Union[FixedZeroMeanUnitVarianceKwargs, FixedZeroMeanUnitVarianceAlongAxisKwargs]
FixedZeroMeanUnitVarianceKwargs:
The mean value to normalize with.
The standard deviation value to normalize with.
FixedZeroMeanUnitVarianceAlongAxisKwargs:
The mean value(s) to normalize with.
The standard deviation value(s) to normalize with.
Size must match mean
values.
The axis of the mean/std values to normalize each entry along that dimension separately. Examples: ['channel', 'index']
ZeroMeanUnitVarianceDescr:
ZeroMeanUnitVarianceKwargs
ZeroMeanUnitVarianceKwargs:
The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std.
For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x')
resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y')
.
To normalize each sample independently leave out the 'batch' axis.
Default: Scale all axes jointly.
Example: ('batch', 'x', 'y')
Optional[Sequence[bioimageio.spec.model.v0_5.AxisId]]
epsilon for numeric stability: out = (tensor - mean) / (std + eps)
.
ScaleRangeDescr:
ScaleRangeKwargs
ScaleRangeKwargs:
The subset of axes to normalize jointly, i.e. axes to reduce to compute the min/max percentile value.
For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x')
resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y')
.
To normalize samples independently, leave out the "batch" axis.
Default: Scale all axes jointly.
Example: ('batch', 'x', 'y')
Optional[Sequence[bioimageio.spec.model.v0_5.AxisId]]
The lower percentile used to determine the value to align with zero.
The upper percentile used to determine the value to align with one.
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 ID to compute the percentiles from. Default: The tensor itself.
For any tensor in inputs
only input tensor references are allowed.
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]
A human-readable name of this model. It should be no longer than 64 characters and may only contain letter, number, underscore, minus, parentheses and spaces. We recommend to chose a name that refers to the model's task and image modality.
Describes the output tensors.
Sequence[bioimageio.spec.model.v0_5.OutputTensorDescr]
OutputTensorDescr:
Output tensor id. No duplicates are allowed across all inputs and outputs.
free text description
tensor axes
Sequence[typing.Annotated[typing.Union[bioimageio.spec.model.v0_5.BatchAxis, bioimageio.spec.model.v0_5.ChannelAxis, bioimageio.spec.model.v0_5.IndexOutputAxis, typing.Annotated[typing.Union[typing.Annotated[bioimageio.spec.model.v0_5.TimeOutputAxis, Tag(tag='wo_halo')], typing.Annotated[bioimageio.spec.model.v0_5.TimeOutputAxisWithHalo, Tag(tag='with_halo')]], Discriminator(discriminator=, custom_error_type=None, custom_error_message=None, custom_error_context=None)], typing.Annotated[typing.Union[typing.Annotated[bioimageio.spec.model.v0_5.SpaceOutputAxis, Tag(tag='wo_halo')], typing.Annotated[bioimageio.spec.model.v0_5.SpaceOutputAxisWithHalo, Tag(tag='with_halo')]], Discriminator(discriminator=, custom_error_type=None, custom_error_message=None, custom_error_context=None)]], Discriminator(discriminator='type', custom_error_type=None, custom_error_message=None, custom_error_context=None)]]
Sequence[typing.Annotated[typing.Union[bioimageio.spec.model.v0_5.BatchAxis, bioimageio.spec.model.v0_5.ChannelAxis, bioimageio.spec.model.v0_5.IndexOutputAxis, typing.Annotated[typing.Union[typing.Annotated[bioimageio.spec.model.v0_5.TimeOutputAxis, Tag(tag='wo_halo')], typing.Annotated[bioimageio.spec.model.v0_5.TimeOutputAxisWithHalo, Tag(tag='with_halo')]], Discriminator(discriminator=<function _get_halo_axis_discriminator_value at 0x7fd8d1f8f560>, custom_error_type=None, custom_error_message=None, custom_error_context=None)], typing.Annotated[typing.Union[typing.Annotated[bioimageio.spec.model.v0_5.SpaceOutputAxis, Tag(tag='wo_halo')], typing.Annotated[bioimageio.spec.model.v0_5.SpaceOutputAxisWithHalo, Tag(tag='with_halo')]], Discriminator(discriminator=<function _get_halo_axis_discriminator_value at 0x7fd8d1f8f560>, custom_error_type=None, custom_error_message=None, custom_error_context=None)]], Discriminator(discriminator='type', custom_error_type=None, custom_error_message=None, custom_error_context=None)]]
BatchAxis:
The batch size may be fixed to 1, otherwise (the default) it may be chosen arbitrarily depending on available memory
ChannelAxis:
Sequence[_internal.types.Identifier]
IndexOutputAxis:
The size/length of this axis can be specified as
- fixed integer
- reference to another axis with an optional offset (
SizeReference
) - data dependent size using
DataDependentSize
(size is only known after model inference) Examples: [10, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), SizeReference, DataDependentSize]
SizeReference:
tensor id of the reference axis
axis id of the reference axis
DataDependentSize:
TimeOutputAxis:
The size/length of this axis can be specified as
- fixed integer
- reference to another axis with an optional offset (see
SizeReference
) Examples: [10, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), SizeReference]
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Optional[Literal[attosecond, ..., zettasecond]]
Optional[Literal of
- attosecond
- centisecond
- day
- decisecond
- exasecond
- femtosecond
- gigasecond
- hectosecond
- hour
- kilosecond
- megasecond
- microsecond
- millisecond
- minute
- nanosecond
- petasecond
- picosecond
- second
- terasecond
- yoctosecond
- yottasecond
- zeptosecond
- zettasecond ]
TimeOutputAxisWithHalo:
The halo should be cropped from the output tensor to avoid boundary effects.
It is to be cropped from both sides, i.e. size_after_crop = size - 2 * halo
.
To document a halo that is already cropped by the model use size.offset
instead.
reference to another axis with an optional offset (see SizeReference
)
Examples: [10, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
SizeReference
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Optional[Literal[attosecond, ..., zettasecond]]
Optional[Literal of
- attosecond
- centisecond
- day
- decisecond
- exasecond
- femtosecond
- gigasecond
- hectosecond
- hour
- kilosecond
- megasecond
- microsecond
- millisecond
- minute
- nanosecond
- petasecond
- picosecond
- second
- terasecond
- yoctosecond
- yottasecond
- zeptosecond
- zettasecond ]
SpaceOutputAxis:
The size/length of this axis can be specified as
- fixed integer
- reference to another axis with an optional offset (see
SizeReference
) Examples: [10, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
Union[int (Gt(gt=0)), SizeReference]
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Examples: ['x', 'y', 'z']
Optional[Literal[attometer, ..., zettameter]]
Optional[Literal of
- attometer
- angstrom
- centimeter
- decimeter
- exameter
- femtometer
- foot
- gigameter
- hectometer
- inch
- kilometer
- megameter
- meter
- micrometer
- mile
- millimeter
- nanometer
- parsec
- petameter
- picometer
- terameter
- yard
- yoctometer
- yottameter
- zeptometer
- zettameter ]
SpaceOutputAxisWithHalo:
The halo should be cropped from the output tensor to avoid boundary effects.
It is to be cropped from both sides, i.e. size_after_crop = size - 2 * halo
.
To document a halo that is already cropped by the model use size.offset
instead.
reference to another axis with an optional offset (see SizeReference
)
Examples: [10, {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}]
SizeReference
SizeReference:
tensor id of the reference axis
axis id of the reference axis
Examples: ['x', 'y', 'z']
Optional[Literal[attometer, ..., zettameter]]
Optional[Literal of
- attometer
- angstrom
- centimeter
- decimeter
- exameter
- femtometer
- foot
- gigameter
- hectometer
- inch
- kilometer
- megameter
- meter
- micrometer
- mile
- millimeter
- nanometer
- parsec
- petameter
- picometer
- terameter
- yard
- yoctometer
- yottameter
- zeptometer
- zettameter ]
An example tensor to use for testing. Using the model with the test input tensors is expected to yield the test output tensors. Each test tensor has be a an ndarray in the numpy.lib file format. The file extension must be '.npy'.
_internal.io.FileDescr
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
A sample tensor to illustrate a possible input/output for the model,
The sample image primarily serves to inform a human user about an example use case
and is typically stored as .hdf5, .png or .tiff.
It has to be readable by the imageio library
(numpy's .npy
format is not supported).
The image dimensionality has to match the number of axes specified in this tensor description.
Optional[_internal.io.FileDescr]
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Description of the tensor's data values, optionally per channel.
If specified per channel, the data type
needs to match across channels.
Union[NominalOrOrdinalDataDescr, IntervalOrRatioDataDescr, Sequence[typing.Union[bioimageio.spec.model.v0_5.NominalOrOrdinalDataDescr, bioimageio.spec.model.v0_5.IntervalOrRatioDataDescr]]*]
Union of
- NominalOrOrdinalDataDescr
- IntervalOrRatioDataDescr
- Sequence[typing.Union[bioimageio.spec.model.v0_5.NominalOrOrdinalDataDescr, bioimageio.spec.model.v0_5.IntervalOrRatioDataDescr]] (MinLen(min_length=1))
NominalOrOrdinalDataDescr:
A fixed set of nominal or an ascending sequence of ordinal values.
In this case data_type
is required to be an unsigend integer type, e.g. 'uint8'.
String values
are interpreted as labels for tensor values 0, ..., N.
Note: as YAML 1.2 does not natively support a "set" datatype,
nominal values should be given as a sequence (aka list/array) as well.
Union[Sequence[int]*, Sequence[float]*, Sequence[bool]*, Sequence[str]*]
Union of
- Sequence[int] (MinLen(min_length=1))
- Sequence[float] (MinLen(min_length=1))
- Sequence[bool] (MinLen(min_length=1))
- Sequence[str] (MinLen(min_length=1))
Examples: ['float32', 'uint8', 'uint16', 'int64', 'bool']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
Union[Literal[arbitrary unit], _internal.types.SiUnit, None]
IntervalOrRatioDataDescr:
Examples: ['float32', 'float64', 'uint8', 'uint16']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64]
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
None
corresponds to min/max of what can be expressed by data_type
.
Sequence[Optional[float], Optional[float]]
Union[Literal[arbitrary unit], _internal.types.SiUnit]
Scale for data on an interval (or ratio) scale.
Offset for data on a ratio scale.
NominalOrOrdinalDataDescr:
A fixed set of nominal or an ascending sequence of ordinal values.
In this case data_type
is required to be an unsigend integer type, e.g. 'uint8'.
String values
are interpreted as labels for tensor values 0, ..., N.
Note: as YAML 1.2 does not natively support a "set" datatype,
nominal values should be given as a sequence (aka list/array) as well.
Union[Sequence[int]*, Sequence[float]*, Sequence[bool]*, Sequence[str]*]
Union of
- Sequence[int] (MinLen(min_length=1))
- Sequence[float] (MinLen(min_length=1))
- Sequence[bool] (MinLen(min_length=1))
- Sequence[str] (MinLen(min_length=1))
Examples: ['float32', 'uint8', 'uint16', 'int64', 'bool']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
Union[Literal[arbitrary unit], _internal.types.SiUnit, None]
IntervalOrRatioDataDescr:
Examples: ['float32', 'float64', 'uint8', 'uint16']
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64]
Tuple (minimum, maximum)
specifying the allowed range of the data in this tensor.
None
corresponds to min/max of what can be expressed by data_type
.
Sequence[Optional[float], Optional[float]]
Union[Literal[arbitrary unit], _internal.types.SiUnit]
Scale for data on an interval (or ratio) scale.
Offset for data on a ratio scale.
Description of how this output should be postprocessed.
note: postprocessing
always ends with an 'ensure_dtype' operation.
If not given this is added to cast to this tensor's data.type
.
Sequence[Union[BinarizeDescr, ..., ScaleMeanVarianceDescr]*]
Sequence of Union of
- BinarizeDescr
- ClipDescr
- EnsureDtypeDescr
- ScaleLinearDescr
- SigmoidDescr
- FixedZeroMeanUnitVarianceDescr
- ZeroMeanUnitVarianceDescr
- ScaleRangeDescr
- ScaleMeanVarianceDescr
(Discriminator(discriminator='id', custom_error_type=None, custom_error_message=None, custom_error_context=None))
BinarizeDescr:
Union[BinarizeKwargs, BinarizeAlongAxisKwargs]
BinarizeKwargs:
The fixed threshold
BinarizeAlongAxisKwargs:
The fixed threshold values along axis
The threshold
axis
Example: 'channel'
ClipDescr:
model.v0_4.ClipKwargs
model.v0_4.ClipKwargs:
minimum value for clipping
maximum value for clipping
EnsureDtypeDescr:
EnsureDtypeKwargs
EnsureDtypeKwargs:
Literal[float32, float64, uint8, int8, uint16, int16, uint32, int32, uint64, int64, bool]
ScaleLinearDescr:
Union[ScaleLinearKwargs, ScaleLinearAlongAxisKwargs]
ScaleLinearKwargs:
multiplicative factor
additive term
ScaleLinearAlongAxisKwargs:
The axis of of gains/offsets values. Example: 'channel'
multiplicative factor
Union[float, Sequence[float] (MinLen(min_length=1))]
additive term
Union[float, Sequence[float] (MinLen(min_length=1))]
SigmoidDescr:
FixedZeroMeanUnitVarianceDescr:
Literal[fixed_zero_mean_unit_variance]
Union[FixedZeroMeanUnitVarianceKwargs, FixedZeroMeanUnitVarianceAlongAxisKwargs]
FixedZeroMeanUnitVarianceKwargs:
The mean value to normalize with.
The standard deviation value to normalize with.
FixedZeroMeanUnitVarianceAlongAxisKwargs:
The mean value(s) to normalize with.
The standard deviation value(s) to normalize with.
Size must match mean
values.
The axis of the mean/std values to normalize each entry along that dimension separately. Examples: ['channel', 'index']
ZeroMeanUnitVarianceDescr:
ZeroMeanUnitVarianceKwargs
ZeroMeanUnitVarianceKwargs:
The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std.
For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x')
resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y')
.
To normalize each sample independently leave out the 'batch' axis.
Default: Scale all axes jointly.
Example: ('batch', 'x', 'y')
Optional[Sequence[bioimageio.spec.model.v0_5.AxisId]]
epsilon for numeric stability: out = (tensor - mean) / (std + eps)
.
ScaleRangeDescr:
ScaleRangeKwargs
ScaleRangeKwargs:
The subset of axes to normalize jointly, i.e. axes to reduce to compute the min/max percentile value.
For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x')
resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y')
.
To normalize samples independently, leave out the "batch" axis.
Default: Scale all axes jointly.
Example: ('batch', 'x', 'y')
Optional[Sequence[bioimageio.spec.model.v0_5.AxisId]]
The lower percentile used to determine the value to align with zero.
The upper percentile used to determine the value to align with one.
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 ID to compute the percentiles from. Default: The tensor itself.
For any tensor in inputs
only input tensor references are allowed.
ScaleMeanVarianceDescr:
ScaleMeanVarianceKwargs
ScaleMeanVarianceKwargs:
Name of tensor to match.
The subset of axes to normalize jointly, i.e. axes to reduce to compute mean/std.
For example to normalize 'batch', 'x' and 'y' jointly in a tensor ('batch', 'channel', 'y', 'x')
resulting in a tensor of equal shape normalized per channel, specify axes=('batch', 'x', 'y')
.
To normalize samples independently, leave out the 'batch' axis.
Default: Scale all axes jointly.
Example: ('batch', 'x', 'y')
Optional[Sequence[bioimageio.spec.model.v0_5.AxisId]]
Epsilon for numeric stability:
out = (tensor - mean) / (std + eps) * (ref_std + eps) + ref_mean.
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]
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_3.Author]]
generic.v0_3.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 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[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]
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_3.Author]]
generic.v0_3.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 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]
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_3.Author]]
generic.v0_3.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 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]]
Union[ArchitectureFromFileDescr, ArchitectureFromLibraryDescr]
ArchitectureFromFileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
Identifier of the callable that returns a torch.nn.Module instance. Examples: ['MyNetworkClass', 'get_my_model']
key word arguments for the callable
ArchitectureFromLibraryDescr:
Identifier of the callable that returns a torch.nn.Module instance. Examples: ['MyNetworkClass', 'get_my_model']
key word arguments for the callable
Where to import the callable from, i.e. from <import_from> import <callable>
Version of the PyTorch library used.
If architecture.depencencies
is specified it has to include pytorch and any version pinning has to be compatible.
Custom depencies beyond pytorch.
The conda environment file should include pytorch and any version pinning has to be compatible with
pytorch_version
.
Optional[EnvironmentFileDescr]
EnvironmentFileDescr:
∈📦 Conda environment file. Allows to specify custom dependencies, see conda docs:
- Exporting an environment file across platforms
- Creating an environment file manually Example: 'environment.yaml'
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
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]
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_3.Author]]
generic.v0_3.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 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[TensorflowSavedModelBundleWeightsDescr]
TensorflowSavedModelBundleWeightsDescr:
∈📦 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]
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_3.Author]]
generic.v0_3.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 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.
Custom dependencies beyond tensorflow.
Should include tensorflow and any version pinning has to be compatible with tensorflow_version
.
Optional[EnvironmentFileDescr]
EnvironmentFileDescr:
∈📦 Conda environment file. Allows to specify custom dependencies, see conda docs:
- Exporting an environment file across platforms
- Creating an environment file manually Example: 'environment.yaml'
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
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]
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_3.Author]]
generic.v0_3.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 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.
file attachments
Sequence[_internal.io.FileDescr]
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
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 there is a git_repo
field.
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 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')
Sequence[Union[Path*, _internal.io.RelativeFilePath, _internal.url.HttpUrl]*]
Sequence of Union of
- 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 0x7fd8dda88fe0>, return_type=PydanticUndefined, when_used='unless-none'))
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, e.g. on bioimage.io
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 0x7fd8dda88fe0>, return_type=PydanticUndefined, when_used='unless-none'))
- None
bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.
UTF-8 emoji for display alongside the id
.
Optional[str (Len(min_length=1, max_length=2); )]
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 has to specify their github_user
name
Sequence[generic.v0_3.Maintainer]
generic.v0_3.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 (Predicate(_has_no_slash))]
The persons that have packaged and uploaded this model.
Only required if those persons differ from the authors
.
Sequence[generic.v0_3.Author]
generic.v0_3.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:
The version of the linked resource following SemVer 2.0.
Optional[_internal.version_type.Version]
A valid model id
from the bioimage.io collection.
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[model.v0_4.RunMode]
model.v0_4.RunMode:
Run mode name
Run mode specific key word arguments
Associated tags Example: ('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
Timestamp in ISO 8601 format with a few restrictions listed here. (In Python a datetime object is valid, too).
The dataset used to train this model
Union[None, dataset.v0_3.LinkedDataset, dataset.v0_3.DatasetDescr, dataset.v0_2.DatasetDescr]
dataset.v0_3.LinkedDataset:
The version of the linked resource following SemVer 2.0.
Optional[_internal.version_type.Version]
A valid dataset id
from the bioimage.io collection.
dataset.v0_3.DatasetDescr:
A human-friendly name of the resource description. May only contains letters, digits, underscore, minus, parentheses and spaces.
A string containing a brief description.
Cover images. Please use an image smaller than 500KB and an aspect ratio width to height of 2:1 or 1:1. The supported image formats are: ('.gif', '.jpeg', '.jpg', '.png', '.svg')
Sequence[Union[Path*, _internal.io.RelativeFilePath, _internal.url.HttpUrl]*]
Sequence of Union of
- 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 0x7fd8dda88fe0>, return_type=PydanticUndefined, when_used='unless-none'))
UTF-8 emoji for display alongside the id
.
Optional[str (Len(min_length=1, max_length=2); )]
The authors are the creators of this resource description and the primary points of contact.
Sequence[generic.v0_3.Author]
generic.v0_3.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 attachments
Sequence[_internal.io.FileDescr]
_internal.io.FileDescr:
∈📦 file source
Union[_internal.url.HttpUrl, _internal.io.RelativeFilePath, Path (PathType(path_type='file'); )]
SHA256 checksum of the source file
Optional[_internal.io_basics.Sha256]
citations
Sequence[generic.v0_3.CiteEntry]
generic.v0_3.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 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]
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 there is a git_repo
field.
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'}}
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, e.g. on bioimage.io
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 0x7fd8dda88fe0>, 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 has to specify their github_user
name
Sequence[generic.v0_3.Maintainer]
generic.v0_3.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 (Predicate(_has_no_slash))]
Associated tags Example: ('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
The version of the resource following SemVer 2.0.
Optional[_internal.version_type.Version]
The format version of this resource specification
∈📦 URL or relative path to a markdown file encoded in UTF-8 with additional documentation.
The recommended documentation file name is README.md
. An .md
suffix is mandatory.
Examples: ['https://raw.githubusercontent.com/bioimage-io/spec-bioimage-io/main/example_descriptions/models/unet2d_nuclei_broad/README.md', '…']
Optional[Union[Path*, _internal.io.RelativeFilePath, _internal.url.HttpUrl]*]
Optional[Union of
- Path (PathType(path_type='file'); Predicate(is_absolute); )
- _internal.io.RelativeFilePath
- _internal.url.HttpUrl
(union_mode='left_to_right'; AfterValidator(_validate_md_suffix); PlainSerializer(func=<function _package at 0x7fd8dda88fe0>, return_type=PydanticUndefined, when_used='unless-none'))]
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 0x7fd8dda88fe0>, 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'
bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.
The description from which this one is derived
"URL to the source of the 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 of
- 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 0x7fd8dda88fe0>, 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 0x7fd8dda88fe0>, 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 0x7fd8dda88fe0>, 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 0x7fd8dda88fe0>, 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://raw.githubusercontent.com/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 0x7fd8dda88fe0>, 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]
bioimage.io-wide unique resource identifier assigned by bioimage.io; version unspecific.
"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]
0000-0001-2345-6789
- 10
- {'min': 32, 'step': 16}
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- 10
- {'min': 32, 'step': 16}
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- 10
- {'min': 32, 'step': 16}
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- x
- y
- z
- float32
- uint8
- uint16
- int64
- bool
- float32
- float64
- uint8
- uint16
- float32
- uint8
- uint16
- int64
- bool
- float32
- float64
- uint8
- uint16
channel
channel
- channel
- index
('batch', 'x', 'y')
('batch', 'x', 'y')
- CC0-1.0
- MIT
- BSD-2-Clause
- 10
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- 10
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- 10
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- 10
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- x
- y
- z
- 10
- {'tensor_id': 't', 'axis_id': 'a', 'offset': 5}
- x
- y
- z
- float32
- uint8
- uint16
- int64
- bool
- float32
- float64
- uint8
- uint16
- float32
- uint8
- uint16
- int64
- bool
- float32
- float64
- uint8
- uint16
channel
channel
- channel
- index
('batch', 'x', 'y')
('batch', 'x', 'y')
('batch', 'x', 'y')
0000-0001-2345-6789
pytorch_state_dict
0000-0001-2345-6789
pytorch_state_dict
0000-0001-2345-6789
pytorch_state_dict
- MyNetworkClass
- get_my_model
- MyNetworkClass
- get_my_model
environment.yaml
0000-0001-2345-6789
pytorch_state_dict
0000-0001-2345-6789
pytorch_state_dict
environment.yaml
0000-0001-2345-6789
pytorch_state_dict
{'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
0000-0001-2345-6789
('unet2d', 'pytorch', 'nucleus', 'segmentation', 'dsb2018')
0000-0001-2345-6789
- CC0-1.0
- MIT
- BSD-2-Clause
{'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
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