Skip to content
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

Read information about required number of channels for a given model #298

Closed
Czaki opened this issue Oct 9, 2022 · 4 comments
Closed

Read information about required number of channels for a given model #298

Czaki opened this issue Oct 9, 2022 · 4 comments

Comments

@Czaki
Copy link
Contributor

Czaki commented Oct 9, 2022

Is there any official API to determine how many channels are required by a given model stored in bioimage-io format?

Part of my job is implementing a universal GUI that allows evaluating a model on user data to check how it works with user data for PartSeg/napari.

The possibility to adjust the parameters of visualization of each data channel separately is an essential functional requirement. Also, a user could have more channels in data than the model creator uses to train it. So it would be nice if the interface could adjust to the model rather than require the user to search for such information in the description or understand traceback.

In the future, it will be nice to allow model creators to annotate channels with semantic descriptions, which is expected input that could be rendered in the interface (label or tooltip). I do not find such a possibility in a current model.

@FynnBe
Copy link
Member

FynnBe commented Oct 10, 2022

bioimageio.spec defines the 'model RDF', where you find the inputs field: https://github.com/bioimage-io/spec-bioimage-io/blob/gh-pages/model_spec_0_4.md#inputs

thus, for a given model resource you could use model = bioimageio.spec.load_raw_resource_description(model_rdf) and then check model.inputs.

To extend the inputs/outputs metadata we have this issue: bioimage-io/spec-bioimage-io#290

@Czaki
Copy link
Contributor Author

Czaki commented Oct 10, 2022

So, in general, if inputs.shape.min on the axis that corresponds to channel in inputs.axes will always informal number of required channels?

(If explicit shape is provided then, it could be read from this)

@FynnBe
Copy link
Member

FynnBe commented Oct 10, 2022

yes, you probably want to double check that inputs.shape.step has a zero in the channel dim, otherwise the model would accept a range of input channels (which you probably don't want to support for now. I don't think any current model has this edge case).

@FynnBe
Copy link
Member

FynnBe commented Oct 11, 2022

please reopen if there are more questions!

@FynnBe FynnBe closed this as completed Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants