Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CLIPSeg to HuggingFace Transformers 馃 #18

Closed
NielsRogge opened this issue Nov 4, 2022 · 6 comments
Closed

Adding CLIPSeg to HuggingFace Transformers 馃 #18

NielsRogge opened this issue Nov 4, 2022 · 6 comments

Comments

@NielsRogge
Copy link

NielsRogge commented Nov 4, 2022

Hi,

Thanks for this awesome work. As I really liked the approach of adapting CLIP for zero and one-shot image segmentation, I implemented your model as a branch of 馃 Transformers.

The model is soon going to be added to the main library (see huggingface/transformers#20066). Here's a Colab notebook to showcase usage: https://colab.research.google.com/drive/1ijnW67ac6bMnda4D_XkdUbZfilyVZDOh?usp=sharing.

Would you like to create an organization on the hub, under which the checkpoints can be hosted?

Currently I host them under my own username: https://huggingface.co/models?other=clipseg.

Thanks!

Niels,
ML Engineer @ HF

@timojl
Copy link
Owner

timojl commented Nov 7, 2022

Hi Niels,

I'm glad you like our method and thanks for integrating it into HF Transformers! I guess, providing the weights under your user is fine for now.

@NielsRogge
Copy link
Author

I've created a CIDAS organization on the hub, feel free to join :)

https://huggingface.co/CIDAS

@NielsRogge
Copy link
Author

CLIPSeg is now available here: https://huggingface.co/docs/transformers/main/en/model_doc/clipseg.

Would be highly appreciated if you add a mention to it in the README 馃檹

@bonlime
Copy link

bonlime commented Dec 30, 2022

@NielsRogge Hey, could you clarify one minor thing to me? This repo in the Quickstart.ipynb uses normalization with Imagenet mean/std, while the HF version used the normalization to [-1, 1] according to this. Which normalization is correct for the images?

I've seen that you've ported the weights somehow, but didn't you do something with the fact that different nomalization was used?

Also it's confusing that here you use Imagenet mean/std for tests.

upd. after few test it seem that this is really a bug and default processors params at HF are incorrect

@NielsRogge
Copy link
Author

NielsRogge commented Jan 4, 2023

Hi,

Thanks for flagging. I'll update the mean and std of the checkpoints on the hub. Visually I don't see any differences though.

@bonlime
Copy link

bonlime commented Jan 5, 2023

The difference is minor, because the models in general a very robust to such things as slightly scaled inputs, but still it's better to use correct norm :) thanks for a quick fix

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

No branches or pull requests

3 participants