Giter Site home page Giter Site logo

Comments (10)

constantinpape avatar constantinpape commented on June 19, 2024 2

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.

constantinpape avatar constantinpape commented on June 19, 2024

Yes, it looks like halo was mistakenly put here
instead of the OutputShape.
cc @FynnBe

from core-bioimage-io-python.

FynnBe avatar FynnBe commented on June 19, 2024

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.

constantinpape avatar constantinpape commented on June 19, 2024

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.

constantinpape avatar constantinpape commented on June 19, 2024

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.

FynnBe avatar FynnBe commented on June 19, 2024

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.

constantinpape avatar constantinpape commented on June 19, 2024

If at any time we decided to move halo into shape

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.

FynnBe avatar FynnBe commented on June 19, 2024

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.

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.

constantinpape avatar constantinpape commented on June 19, 2024

See bioimage-io/spec-bioimage-io#77.

from core-bioimage-io-python.

constantinpape avatar constantinpape commented on June 19, 2024

This is fixed.

from core-bioimage-io-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.