huggingface / transformers

🤗 Transformers: State-of-the-art Machine Learning for Pytorch, TensorFlow, and JAX.
https://huggingface.co/transformers
Apache License 2.0
132.09k stars 26.31k forks source link

Mask2FormerImageProcessor - fails to process multichannel image #33295

Closed maciej-adamiak closed 6 days ago

maciej-adamiak commented 1 week ago

System Info

Who can help?

No response

Information

Tasks

Reproduction

Colab

Expected behavior

The image processing should be handled correctly.

It looks like the get_max_height_width is using a default parameter rather then a value input_data_format set in the class constructor.

LysandreJik commented 1 week ago

cc @qubvel or @zucchini-nlp in case you have some bandwidth!

qubvel commented 1 week ago

Hi @maciej-adamiak , thanks for opening an issue and providing an example to reproduce!

Would you like to make a fix? We should make sure that input_data_format is passed to get_max_height_width and all other transforms correctly handle it.

maciej-adamiak commented 1 week ago

I'm on it.