DeepForest
DeepForest copied to clipboard
Model library
@ethanwhite, @henrykironde and I were discussing that as the number of trained models increase, we probably want some more refined way of versioning them and calling them. Right now they are saved alongside the release tags. Each new model would get a "use_release" method, with redundant code, etc.
An example release looks like:
https://github.com/weecology/DeepForest/releases/tag/1.0.0
Which is fine. When use_release is called, the model checks github for the latest release. A couple problems.
- It doesn't ask the user if they want to use the new release, so any update to the model should be considered breaking. That seems like a big problem and we should atleast ask if we should update.
- The metadata doesn't live alongside the model in python. There is a link, but not alot of info.
from deepforest import main
m = main.deepforest()
Reading config file: deepforest_config.yml
m.use_release()
Model from DeepForest release https://github.com/weecology/DeepForest/releases/tag/1.0.0 was already downloaded. Loading model from file.
Loading pre-built model: https://github.com/weecology/DeepForest/releases/tag/1.0.0
m.__release_version__
'https://github.com/weecology/DeepForest/releases/tag/1.0.0'
- Torchvision recently released some API improvements. I think they are largely redundant with pytorch lightning. https://pytorch.org/blog/introducing-torchvision-new-multi-weight-support-api/ I have not read deeply enough to know if they can be used in parallel.
Hey @bw4sz , I would like to work on this issue, Can you please guide me?
What have you done so far?
It seems like moving to Hugging Face for model distribution is the most common solution here. If we use the pytorch integration:
https://huggingface.co/docs/hub/models-uploading#upload-a-pytorch-model-using-huggingfacehub
then we can use the from_pretrained()
method and pass in any of our models (and potentially others models as well; we can wrap from_pretained
in use_release
as well for backward compatibility):
model.from_pretrained("weecology/deepforest-trees")
I setup an org account https://huggingface.co/weecology and can add @bw4sz & @henrykironde if this sounds like the general way to go.
@henrykironde this will be an issue i'll connect to alive/dead model.