Broken warning on example
Hello,
I am trying the example and I have this error :
/lib/python3.9/site-packages/transformers/models/segformer/image_processing_segformer.py:102: FutureWarning: The `reduce_labels` parameter is deprecated and will be removed in a future version. Please use `do_reduce_labels` instead.
warnings.warn(
pyTorch : 2.0.0+cpu
python : 3.9.1
transformers : 4.25.1
Any help ?
By the way, which kind of format the code should return ?
From what I understand that warning is coming from the hugging face source code implementation of the Segformer, so I don't think that I can do anything about it here. However, the code should still run no problem with the warning.
The output should have output.logits which has shape (batch_size, 18, 128, 128), 18 being the 18 different labels. Hence in the sample code I take argmax of the [1] dimension to have a label value for each pixel, and the output is upsampled to match the input size. Hope that makes sense.
Yes, so I updated an issue in Transformers part : https://github.com/huggingface/transformers/issues/20542image_processing_segformer
Cool, it should be an easy fix, I might make a pull request tomorrow to adjust it as it's just an argument name change.
If you want to see the prediction then add "plt.show()" at the end of the code, as the sample code is meant for a jupyter notebook where plt.show() isn't needed
Alright, thank you for your PR.
Indeed, I don't really know the framework Jupiter, so thanks for the advice !
Pozdrawiam.