How to use facebook/mask2former-swin-base-coco-instance with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="facebook/mask2former-swin-base-coco-instance")
# Load model directly from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-base-coco-instance") model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-base-coco-instance")
Used the code of the "two cats and tv remote" image in the description and got a bad segmentation output:
Tried with another mask2former weight (mask2former-swin-small-coco-instance), and got valid results:
Am I missing something? Are these weights not valid?
· Sign up or log in to comment