This project implements an image segmentation pipeline using Mask R-CNN for instance segmentation and GrabCut for mask refinement. The system detects objects in an input image, generates segmentation masks, refines the detected masks using GrabCut, and visualizes the results with bounding boxes, class labels, and confidence scores.
The project demonstrates the application of deep learning and classical computer vision techniques for accurate object segmentation.
- Object Detection using Mask R-CNN
- Instance Segmentation
- Mask Refinement using GrabCut
- Bounding Box Visualization
- Class Label Prediction
- Confidence Score Display
- Segmented Object Extraction
- Overlay Visualization
- Automatic Output Image Generation
- Python
- PyTorch
- Torchvision
- OpenCV
- NumPy
- Mask R-CNN (Pre-trained COCO Model)
Interactive-Image-Segmentation-using-Mask-R-CNN-GrabCut//
│
├── images/
│ ├── input/
│ │ └── test.jpg
│ │
│ └── output/
│ ├── result.jpg
│ ├── overlay.jpg
│ ├── boxed.jpg
│ └── refined.jpg
│
├── src/
│ ├── main.py
│ ├── segmentation.py
│ └── utils.py
│
├── requirements.txt
├── README.md
├── LICENSE
└── .gitignore
Input Image
│
▼
Image Preprocessing
│
▼
Mask R-CNN
│
▼
Object Detection
│
▼
Instance Segmentation
│
▼
GrabCut Refinement
│
▼
Bounding Boxes & Labels
│
▼
Output Images
The following output images are generated automatically:
| Output | Description |
|---|---|
| result.jpg | Segmented object |
| overlay.jpg | Segmentation overlay on original image |
| boxed.jpg | Bounding box with class label and confidence |
| refined.jpg | GrabCut refined segmentation |
- Autonomous Vehicles
- Medical Image Analysis
- Robotics
- Video Surveillance
- Object Recognition
- Image Editing
- Augmented Reality
- Support segmentation of multiple objects simultaneously.
- Real-time webcam segmentation.
- Custom dataset training.
- Web application deployment using Flask or Streamlit.
- Integration with Segment Anything Model (SAM).
Ch. Navya Naidu
B.Tech Computer Science and Engineering (AI & ML)
This project is licensed under the MIT License.