Skip to content

Conversation

@NielsRogge
Copy link
Contributor

@NielsRogge NielsRogge commented Aug 26, 2024

Hi,

Thanks for this nice work! I wrote a quick PoC to showcase that you can easily have integration with the 🤗 hub so that you can automatically load the model using from_pretrained (and push it using push_to_hub), track download numbers for your models (similar to models in the Transformers library), and have nice model cards on a per-model basis, and perhaps most importantly, leverage safetensors for the weights in favor of pickle.

It leverages the PyTorchModelHubMixin class which allows to inherits these methods.

Usage is as follows:

from NeuFlow.neuflow import NeuFlow

# instantiate model
model = NeuFlow()

# equip model with weights
model.load_state_dict(...)

# push to hub
model.push_to_hub("your-hf-org/neuflow-v2")

# reload
model = NeuFlow.from_pretrained("your-hf-org/neuflow-v2")

This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub, and they can discover it when filtering https://huggingface.co/models.

Would you be interested in this integration?

Kind regards,

Niels

Note

Please don't merge this PR before pushing the model to the hub :)

@Study-is-happy
Copy link
Collaborator

Thanks for the instruction! We will integrate to HF ASAP.

@Study-is-happy Study-is-happy merged commit 54abed9 into neufieldrobotics:master Sep 2, 2024
@NielsRogge
Copy link
Contributor Author

Awesome!! Also opened a PR to link it to the paper page: https://huggingface.co/Study-is-happy/neuflow-v2/discussions/1.

We will work on adding a dedicated "optical-flow-estimation" tag so that people can easier discover models like yours (cc @merveenoyan).

We also hope researchers can leverage the tools from huggingface_hub for their future works.

Cheers :)

Niels

@Study-is-happy
Copy link
Collaborator

Awesome!! Also opened a PR to link it to the paper page: https://huggingface.co/Study-is-happy/neuflow-v2/discussions/1.

We will work on adding a dedicated "optical-flow-estimation" tag so that people can easier discover models like yours (cc @merveenoyan).

We also hope researchers can leverage the tools from huggingface_hub for their future works.

Cheers :)

Niels

Thanks Niels! We have merged the PR on HuggingFace and looking forward to the "optical-flow-estimation" tag!

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

Successfully merging this pull request may close these issues.

2 participants