Instructions to use facebook/mask2former-swin-tiny-coco-instance with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/mask2former-swin-tiny-coco-instance with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="facebook/mask2former-swin-tiny-coco-instance")# Load model directly from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-tiny-coco-instance") model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-tiny-coco-instance") - Inference
- Notebooks
- Google Colab
- Kaggle
how to export onnx?
#3
by wenshinlee - opened
I want to convert mask2former to onnx format and get an error when I execute the following command.
optimum-cli export onnx --model facebook/mask2former-swin-tiny-coco-instance mask2former-swin-tiny-coco-instance-onnx
Mistake as
ValueError: Unrecognized configuration classes ('AutoModelForImageSegmentation', 'AutoModelForSemanticSegmentation') do not match with the model type mask2former and task image-segmentation.
Can someone help me with this?