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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad predictions from HuggingFace pretrained models #83

Open
tldrafael opened this issue Jul 14, 2023 · 4 comments
Open

Bad predictions from HuggingFace pretrained models #83

tldrafael opened this issue Jul 14, 2023 · 4 comments
Labels
huggingface issue related to huggingface integrations (transformers, space)

Comments

@tldrafael
Copy link

tldrafael commented Jul 14, 2023

Hi, thanks for sharing this great work.

I was trying to use your model based on the HF example here. But It turned out that it predicts badly, even trying many versions of models on the training ADE20k samples.

import torch
from PIL import Image
from transformers import OneFormerProcessor, OneFormerModel

image = Image.open('ADE_train_00002024.jpg')

processor = OneFormerProcessor.from_pretrained("shi-labs/oneformer_ade20k_swin_large")
model = OneFormerModel.from_pretrained("shi-labs/oneformer_ade20k_swin_large")
inputs = processor(image, ["semantic"], return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

mask_predictions = outputs.transformer_decoder_mask_predictions
pred = mask_predictions[0].argmax(0)

image

The results are very different from the Colab demo.

image

Is there a way to access the colab pretrained weights from the huggingface interface?

@praeclarumjj3
Copy link
Member

Hi @tldrafael, the HF weights are the same as in our colab demo. However, the result does seem strange. Could you share the image with me so I can try it myself? Thanks.

@praeclarumjj3 praeclarumjj3 added bug Something isn't working huggingface issue related to huggingface integrations (transformers, space) and removed bug Something isn't working labels Aug 7, 2023
@tldrafael
Copy link
Author

Sure @praeclarumjj3 , that's the image. ADE_train_00002024

@davin-win-kyi
Copy link

I'm also interested in this issue, is there a solution for it?

@th0mas-codes
Copy link

Also interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
huggingface issue related to huggingface integrations (transformers, space)
Projects
None yet
Development

No branches or pull requests

4 participants