I noticed you already use the 🤗 hub for loading the model, which is great!
This PR aims to improve the integration by:
adding from_pretrained and push_to_hub capabilities to the model
making sure download numbers work for your model (similar to models in the Transformers library)
It leverages the PyTorchModelHubMixin class which allows to inherits these methods.
Usage is as follows:
from scene.hmr2_extension import load_hmr_predictor, GaussianHMRPredictor
# define model
model = load_hmr_predictor(...)
# equip with weights
model.load_state_dict(...)
# push to hub
model.push_to_hub("your-hf-username-or-org/your-model")
# reload
model = GaussianHMRPredictor.from_pretrained("your-hf-username-or-org/your-model")
This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub.
Hi @prosperolo,
Thanks for this nice work! Niels here from HF.
I noticed you already use the 🤗 hub for loading the model, which is great!
This PR aims to improve the integration by:
from_pretrained
andpush_to_hub
capabilities to the modelIt leverages the PyTorchModelHubMixin class which allows to inherits these methods.
Usage is as follows:
This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub.
Would you be interested in this integration?
Kind regards,
Niels