Comments (10)
Ok, I agree. This is an error in the spec (but note that it was an error from the beginning....). I will add a PR to fix it in there properly.
I think the fundamental problem is that we allow too many different ways of specifying the shape, which change the type of the shape
field. This is not good design, but it's probably not worth reopening this can of worms now.
from core-bioimage-io-python.
Yes, it looks like halo
was mistakenly put here
instead of the OutputShape
.
cc @FynnBe
from core-bioimage-io-python.
I think the error lies in bioimage-io/spec-bioimage-io#76
In our "reference example" halo is also part of the output tensor description, not of the shape:
https://github.com/bioimage-io/pytorch-bioimage-io/blob/113e6d01989e39cd955cb2ead311086548d95026/specs/models/unet2d_nuclei_broad/UNet2DNucleiBroad.model.yaml#L45
This is because the shape might be defined with reference_input
, etc. but it may also be a fixed shape : [1, 2, 3]
, and halo
may be specified independently...
I see some arguments for including halo
under shape
, but as of now that is indeed 'wrong'
from core-bioimage-io-python.
I think the error lies in bioimage-io/spec-bioimage-io#76
In our "reference example" halo is also part of the output tensor description, not of the shape:
https://github.com/bioimage-io/pytorch-bioimage-io/blob/113e6d01989e39cd955cb2ead311086548d95026/specs/models/unet2d_nuclei_broad/UNet2DNucleiBroad.model.yaml#L45
I am pretty sure that we have put halo
in the shape (going back to the discussions about how to compute the output shape).
This is rather an error here and in the reference example.
from core-bioimage-io-python.
This also becomes clear if you actually read what we have in the spec description:
- reference_input name of the reference input tensor
- 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). The halo should be croped from both sides, i.e. shape_after_crop = shape - 2 * halo. The halo is not cropped by the bioimage.io model, but is left to be cropped by the consumer software. Use offset if the model output itself is cropped.
This refers to offset
without any further modifiers, which strongly implies that its on the same level of hierarchy.
from core-bioimage-io-python.
I see how this ambiguity arose over time, as we had further discussions about the meaning of halo and offset. While offset only makes sense with the presence of reference_input
, halo is independent of how the output shape is defined. If at any time we decided to move halo
into shape
I am not opposed to changing the validator accordingly, but I am puzzled about the use case of a fixed output shape that has a halo
. Because of this case I see no other way (without further changes) to keep halo
out of shape
.
from core-bioimage-io-python.
If at any time we decided to move
halo
intoshape
It was always part of shape
, see these commits were we introduced the shape descriptions:
bioimage-io/spec-bioimage-io@9d1dfb6
bioimage-io/spec-bioimage-io@dc54550
I am puzzled about the use case of a fixed output shape that has a
halo
This is again going back to the discussions we had about this, but halo
is a hint for the consumer software on what parts of the output to crop away in order to get the "valid" part of the prediction, e.g. to avoid border effects.
So in that sense it should not matter if the output shape is fixed or computed from offset
and scale
, the treatment of halo is always identical.
from core-bioimage-io-python.
So in that sense it should not matter if the output shape is fixed or computed from
offset
andscale
, the treatment of halo is always identical.
exactly, but in case shape
is specified explicitly, halo
cannot be below shape
like offset
and scale
I am thinking of this scenario:
output:
shape: [10, 20, 30] # explicit shape
halo: [1, 2, 3] # halo is outside of shape
from core-bioimage-io-python.
See bioimage-io/spec-bioimage-io#77.
from core-bioimage-io-python.
This is fixed.
from core-bioimage-io-python.
Related Issues (20)
- validate (citation) dois
- VALUE is not a is not a valid RESUNIT HOT 12
- Better default io names in build_model() HOT 12
- Implement sha256 check for the model
- MONAI translation to BioImage format HOT 1
- Image normalization causing test_model test failure HOT 3
- Provide our CI testing environment as docker containers
- Reproducibility test for model creation fails HOT 3
- Hackathon 2023/10 notes HOT 2
- programmatic access for datasets
- Add support for release candidates and automatic mail updates
- developer documentation
- Investigate integration of aicsimageio
- Add/improve weight converters
- Loading model resource gives assertion error HOT 2
- Link in example broken HOT 1
- Running `test_model` raises TypeError: list indices must be integers or slices, not str HOT 1
- Improve weights conversion to ONNX HOT 1
- bug when `add_deepimagej_config=True` in `build_model` HOT 5
- Error when importing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core-bioimage-io-python.