Skip to content

A PyTorch version of mask-rcnn based on torchvision model with VOC dataset format.

License

Notifications You must be signed in to change notification settings

4-geeks/Mask-RCNN-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mask-RCNN-pytorch

Pytorch implementation of Mask-RCNN based on torchvision model with VOC dataset format. The model generates segmentation masks and their scores for each instance of an object in the image. This repository is based on TorchVision Object Detection Finetuning Tutorial.

Network Structure

Training

label your data with labelme and Export VOC-format dataset from json files with labelme2voc.

Prepare your dataset in this format:

my_dataset
      ├── labels.txt
      │
      ├── JPEGImages
      │       ├── image1.jpg
      │       └── image2.jpg
      │
      ├── SegmentationObject
      │       ├── image1.png
      │       └── image2.png
      │
      └── SegmentationClass
              ├── image1.png
              └── image2.png

Clone the repository and put my_dataset folder in Mask-RCNN-pytorch folder then use this line of code to train:

$ python3 train.py --data my_dataset --num_classes 11 --num_epochs 150

Enter num_classes including background.

Testing

Enter your class names using classes variable in mask_rcnn.py then use this line of code to test on your image:

$ python3 test.py --img test_img.jpg --model ./maskrcnn_saved_models/mask_rcnn_model.pt

Here are some output results:

res1 res2

About

A PyTorch version of mask-rcnn based on torchvision model with VOC dataset format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages