bioimage-io / core-bioimage-io-python

Python libraries for loading, running and packaging bioimage.io models
https://bioimage-io.github.io/core-bioimage-io-python/
MIT License
28 stars 21 forks source link

Support adding multiple weights using build_model #311

Open oeway opened 1 year ago

oeway commented 1 year ago

Discussion from the BMZ meeting, proposed by @ivan-ea

Would be nice to support adding multiple weights in the build_model function.

cc @constantinpape @FynnBe

ivan-ea commented 1 year ago

For context: I was not sure if it was possible to generate models with multiple weight files with the build_model function. Also I wondered if I missed something, since the website has the option to choose between several weight formats to download.

Some models have 2 weights in the rdf (for example impartial-shrimp), so I was curious how they might have built them.

constantinpape commented 1 year ago

Adding multiple weights is supported, but not directly via the build_model function. Instead, you would need to use add_weights. (As a side note: we should add this to the model creation notebook).

I think having the option to do this directly in build_model would be nice, but I don't have capacity to implement this at this points; but I would be happy to review a PR if someone wants to give it a try.

ivan-ea commented 1 year ago

Thanks @constantinpape the add_weights function seems exactly what I was missing. I was following the model creation notebook, since I need to get the deepimagej_config too. Maybe I could add the add_weights to the example notebook once I figure out how to use it.

constantinpape commented 1 year ago

Maybe I could add the add_weights to the example notebook once I figure out how to use it.

That would be great!