Brightsun10/instance-segmentation-demo
0
๐ผ๏ธ Instance Segmentation with Mask2Former
This demo performs advanced instance segmentation using Mask2Former from Facebook AI. It identifies and highlights individual objects in an image with:
- Colored masks
- Bounding boxes
- Class labels and confidence scores
๐ How It Works
- Input an image via upload or example selection.
- The app uses the
facebook/mask2former-swin-large-coco-instancemodel to detect objects. - Only the following classes are visualized:
cat,dog,car,truck,bus,person- Results are drawn on the image and displayed along with a status message.
๐ง Model
- Architecture: Mask2Former with Swin-Large backbone
- Dataset: COCO Instance
- Framework: Hugging Face Transformers + PyTorch
๐ป Technologies Used
- Python ๐
- Gradio for UI
- Hugging Face Transformers
- PIL & NumPy for image manipulation
๐ท Example Images
Try out with example images like:
- Cats vs. Dogs
- Street scenes with vehicles and people
You can also upload your own images!
๐ Notes
- Detection is limited to high-confidence predictions (
score > 0.9) - This demo is optimized for CPU; inference may take up to 30 seconds.
๐ ๏ธ Developer Notes
This app uses the following Gradio configuration:
sdk: gradio
sdk_version: "4.24.0"
app_file: app.py