Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Instance Segmentation — Vehicle & Traffic Light Detection

Real-time instance segmentation of cars and traffic lights in urban street images using a pretrained Mask R-CNN (ResNet-50 FPN backbone) from torchvision. Detections are rendered as colour-coded pixel-level masks overlaid on the original image.

Demo

Original Segmented
Street scene Cars highlighted in red · Traffic lights in green

Architecture

Mask R-CNN with a ResNet-50 + Feature Pyramid Network (FPN) backbone, pretrained on the COCO dataset (80 classes). Only two classes are visualised here:

  • Class 3 → Car (red mask)
  • Class 10 → Traffic Light (green mask)

Tech Stack

Python · PyTorch · torchvision · OpenCV · Pillow · Matplotlib

How to Run

pip install torch torchvision opencv-python pillow matplotlib

# Add your street images to images/
mkdir images
# Then run:
python segment.py

Notes

  • Model weights are downloaded automatically from torchvision on first run (~170 MB)
  • Detection threshold defaults to 0.5 — lower it to catch more objects, raise it to reduce false positives
  • Works on CPU; GPU (CUDA) will significantly speed up inference on larger images

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages