-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend description #54
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,7 +12,7 @@ To get a quick overview of the config file, see an example file [here](https://g | |||||
|
||||||
## Model Specification | ||||||
|
||||||
A model entry in the bioimage.io model zoo is defined by a configuration file `<model name>.model.yaml`. | ||||||
A model entry in the bioimage.io model zoo is defined by a configuration file `model.yaml`. | ||||||
The configuration file must contain the following \[optional\]* keys (* denotes that the field is optional depending on input to another field): | ||||||
|
||||||
|
||||||
|
@@ -36,7 +36,7 @@ The authors are the creators of the specifications and the primary points of con | |||||
|
||||||
- `cite` | ||||||
A citation entry or list of citation entries. | ||||||
Each entry contains of a mandatory `text` field and either one or both of `doi` and `url`. | ||||||
Each entry contains a mandatory `text` field and either one or both of `doi` and `url`. | ||||||
E.g. the citation for the model architecture and/or the training data used. | ||||||
|
||||||
- `git_repo` | ||||||
|
@@ -62,12 +62,22 @@ Must be a list of *tensor specification keys*. | |||||
*tensor specification keys*: | ||||||
- `name` tensor name | ||||||
- `data_type` data type (e.g. float32) | ||||||
- `data_range` tuple of (minimum, maximum) | ||||||
- `axes` string of axes identifying characters from: btczyx | ||||||
- `data_range` tuple of (minimum, maximum) (e.g. [-inf, inf]) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a hunch: Did you remove the inf example, because you expect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think putting in the "data range so that the model yields sensible results" makes sense for the data range: |
||||||
- `axes` string of axes identifying characters from: btczyx. Same length and order as the axes in `shape`. | ||||||
- `shape` specification of tensor shape\ | ||||||
Either as *exact shape with same length as `axes`*,\ | ||||||
or (only for input) as {`min` *minimum shape with same length as `axes`*, `step` *minimum shape change with same length as `axes`*},\ | ||||||
or (only for output) as {`reference_input` *input tensor name*, `scale` *list of factors 'output_pix/input_pix' for each dimension*, `offset` *position of origin wrt to input*, `halo` *the halo to crop from the output tensor (for example to crop away boundary efects or for tiling)*} | ||||||
Either as *fixed shape with same length as `axes`* (e.g. `shape`: [1, 512, 512, 1]),\ | ||||||
or (only for input) as\ | ||||||
esgomezm marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
`shape` | ||||||
- `min` *minimum shape with same length as `axes`* | ||||||
- `step` *minimum shape change with same length as `axes`* | ||||||
|
||||||
or (only for output) as\ | ||||||
`shape` | ||||||
- `reference_input` *input tensor name* | ||||||
- `scale` *list of factors 'output_pix/input_pix' for each dimension* | ||||||
- `offset` *position of origin wrt to input* | ||||||
- `halo` *the halo to crop from the output tensor* (for example to crop away boundary effects or for tiling) (e.g. the valid domain of an output of `size = [256, 256]` and `halo = [32, 32]`, results in `output_shape = [256 - 2 * 32, 256 - 2 * 32] = [192, 192]`).\ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my perception the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But what's the difference then of having a halo or not? The way I understand halo here is that it's a hint to the consumer runing prediction with this model, that indicates which "outer region" of the prediction should be discarded, for example due to boundary artifacts caused by same convolutions. (but there could be lots of other reasons for doing this) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am confused, as to me you answer this question yourself:
This is how I understood it, too. I have to say though, that I like @esgomezm definition more that forces you to crop the outputs that contain a halo (either through valid convs or postprocessing), to instead return only valid output. Every consumer software should just tile accordingly and would no longer have to deal with the two options of 1. I ignore the halo and look at ugly border artefacts or 2. I crop the halo from what I got back from the runner. It would amount to option 3: I have to tile correctly (overlapping if model has halo), but what I get back is all valid :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah ok, so now I understand the issue here, I think.
I don't think option 1 makes so much sense, because then we wouldn't need to specify the halo in the first place, because we can just use the predictions from the model in the first place. But if we go with option 2, this implies that we don't change the output shape when a halo is specified. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
right, if we do want to handle it this way, we could just move it into output |
||||||
The output shape is determined as `output_shape = reference_input_shape * scale + offset`. | ||||||
esgomezm marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
in the description of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I actually think we shouldn't include the halo in the |
||||||
- `[preprocessing]` (only for input) list of transformations describing how this input should be preprocessed. Each entry has these keys: | ||||||
- `name` name of preprocessing (see [supported_formats_and_operations.md#preprocessing](https://github.com/bioimage-io/configuration/blob/master/supported_formats_and_operations.md#preprocessing) for valid names). | ||||||
- `[kwargs]` key word arguments for `preprocessing`. | ||||||
|
@@ -88,7 +98,7 @@ What about `javascript`? | |||||
- `framework` | ||||||
The deep learning framework of the source code. For now, we support `pytorch` and `tensorflow`. | ||||||
Can be `null` if the implementation is not framework specific.\ | ||||||
`language` and `framework` define which model runner can use this model for inference. | ||||||
`language` and `framework` define which model runner can use this model for inference (see [supported_formats_and_operations.md#preprocessing](https://github.com/bioimage-io/configuration/blob/master/supported_formats_and_operations.md#preprocessing)). | ||||||
constantinpape marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
- `[source]*` | ||||||
Language and framework specific implementation.\ | ||||||
|
@@ -133,13 +143,13 @@ For example: | |||||
|
||||||
- `weights` The weights for this model. Weights can be given for different formats, but should otherwise be equivalent. | ||||||
- `weight_format` Format of this set of weights. Weight formats can define additional (optional or required) fields. See [supported_formats_and_operations.md#Weight Format](https://github.com/bioimage-io/configuration/blob/master/supported_formats_and_operations.md#weight_format) | ||||||
- `[authors]` a list of authors. | ||||||
- `[authors]` a list of authors. It refers to the ones who trained the model. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I thought those authors were the ones in the main description as it says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the idea is that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I agree, we should explain this in more detail) |
||||||
- `source` link to the weights file. Preferably an url to the weights file. | ||||||
- `sha256` SHA256 checksum of the model weight file specified by `source` (see `models` section above for how to generate SHA256 checksum) | ||||||
- `sha256` SHA256 checksum of the model weight file specified by `source` (see `sha256` section above for how to generate SHA256 checksum) | ||||||
- `[attachments]` weight specific attachments that will be included when generating the model package. | ||||||
|
||||||
- `[config]` | ||||||
A custom configuration field that can contain any other keys which are not defined above. It can be very specifc to a framework or specific tool. To avoid conflicted defintions, it is recommended to wrap configuration into a sub-field named with the specific framework or tool name. | ||||||
A custom configuration field that can contain any other keys which are not defined above. It can be very specific to a framework or specific tool. To avoid conflicted definitions, it is recommended to wrap configuration into a sub-field named with the specific framework or tool name. | ||||||
|
||||||
For example: | ||||||
```yaml | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,8 @@ The supported preprocessing operations. | |
- `kwargs` | ||
- `mode` can be one of `per_sample` (percentiles are computed for each sample individually), `per_dataset` (percentiles are computed for the entire dataset) | ||
- `axes` the subset of axes to normalize jointly. For example `xy` to normalize the two image axes for 2d data jointly. The batch axis (`b`) is not valid here. | ||
- `min_percentile` the lower percentile used for normalization, in range 0 to 100. | ||
- `max_percentile` the upper percentile used for normalization, in range 0 to 100. Has to be bigger than `upper_percentile`. | ||
- `min_percentile` the lower percentile used for normalization, in range 0 to 1 | ||
- `max_percentile` the upper percentile used for normalization, in range 0 to 1. Has to be bigger than `upper_percentile`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. percentile usually refers to a range from 0 to 100, not 0 to 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, @FynnBe did not suggest to change the value range to |
||
- `reference_implementaion` | ||
- `zero_mean_unit_variance` normalize the tensor to have zero mean and unit variance | ||
- `kwargs` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model entry is not the same as the packaged model (where we agreed to
model.yaml
inside a<model name>.model.bioimage.io.zip
, see #41). Keeping several models in one folder should be possible, as the may share other resources, etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I am not sure we should mention this here, it's difficult to understand this without explaining the
...model.zip
(which we are not doing yet, but need to add here as well.)