-
Notifications
You must be signed in to change notification settings - Fork 957
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an initial Segformer implementation #1617
Conversation
35874e1
to
0418879
Compare
1944792
to
513ae54
Compare
This looks like a neat addition, thanks for working on this. |
@LaurentMazare i added some in the PR description |
Apologies if I misread your update but I was more expecting some example images as well as the segmentation masks generated by the model. |
56fe84e
to
7862d0c
Compare
sample image added with readme updated. |
segmentation image added |
Actually I meant more adding some details to the PR rather than to the repo, it's a bit tricky to add more image file in it as it's already on the large side and we would prefer limiting how much more we add. Could you remove the image files and replace them by some |
ah i see. i have included the image into the pull request itself and updated the readme file accordingly, also removed the image files from git history. |
Thanks! |
Also I would encourage you to advertise this new model on reddit/X/... or via some form of blog post. Would be great to attract some attention on it as it seems like a potentially pretty useful model and it can be nicely illustrated with your sample pics. |
this is a copy from the huggingface pytorch model.
this is inference only so i omitted the parts about dropout, etc.
for image classification with
num_labels
the model outputs a tensor with shape
[batch_size, num_labels]
where the last dim is logitsfor image segmentation with
num_labels
,height
andwidth
the model outputs a tensor with shape
[batch_size, num_labels, height // 4, width // 4]
to represent each 4-pixel patch's logitsClassification example
this shall give you
burger
label:Segmentation example
input image (url is https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg):
output segmentation image: