Skip to content

Improve README, load CLIPCount from HF#1

Open
NielsRogge wants to merge 1 commit intoozzafar:mainfrom
NielsRogge:add_hf
Open

Improve README, load CLIPCount from HF#1
NielsRogge wants to merge 1 commit intoozzafar:mainfrom
NielsRogge:add_hf

Conversation

@NielsRogge
Copy link

@NielsRogge NielsRogge commented Aug 26, 2024

Hi,

Thanks for this interesting work. I contributed YOLOS back in the day to the Transformers library, so it's nice to see you're leveraging it here. Since you do seem to use this model, and not the YOLO model from Ultralytics, I assume we can update the link in the README (and perhaps as well the mention in the paper, which mentions YOLO instead of YOLOS).

Next to that, I see you leverage CLIPCount, it would be nice to make this model available on 🤗 for easy inference, and better discoverability. Here's how it can be used:

from models import CLIPCount

model = CLIPCount()

# load weights
model.load_state_dict(...)

# push to hub
model.push_to_hub("your-hf-org-or-username/clip-count-base")

# reload
model = CLIPCount.from_pretrained("your-hf-org-or-username/clip-count-base")

This way, people also don't need to manually download the checkpoint, it loads automatically from the hub.

Moreover, it leverages safetensors for serialization rather than pickle, which is considered unsafe.

Would you be interested in this integration?

Cheers,

Niels
Open-source @ HF

Note

Please don't merge this PR before pushing and reloading :)

@ozzafar
Copy link
Owner

ozzafar commented Aug 28, 2024

Thanks @NielsRogge for you inputs!
I take your suggestion to upload CLIPCount to hugging face :)
Regarding YOLO, at some point we moved to Yolov9 in our experiments, I'll modify the code accordingly - thanks for pointing this out!

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