A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch.
Key parameters and specifications
Key parameters and specifications
Parameter
Value
Language
Python
Category
Model Development
Subcategory
Object detection
Stars
2,064
Forks
545
Contributors
1
Created date
2018-02-02
Updated date
2026-10-06
Stars in 1 day
0
Stars in 7 days
0
Rank
9,034
Previous rank
9,073
Rank change
39
7-day stars rank
12,153
Previous 7-day stars rank
12,214
7-day stars rank change
61
Total stars rank
6,180
Previous total stars rank
6,174
Total stars rank change
-6
README summary
pytorch-mask-rcnn This is a Pytorch implementation of Mask R-CNN that is in large parts based on Matterport's Mask_RCNN. Matterport's repository is an implementation on Keras and TensorFlow. The following parts of the README are excerpts from the Matterport README. Details on the requirements, training on MS COCO and detection results for this repository can be found at the end of the document. The Mask R-CNN model generates bounding boxes and segmentation masks for each instance
of an object in the image. It's based on Feature Pyramid Network (FPN) and a ResNet101 backbone. The next four images visualize different stages in the detection pipeline: 1. Anchor sorting and filtering The Region Proposal Network proposes bounding boxes that are likely to belong to an object. Positive and negative anchors along with anchor box refinement are visualized. Bounding Box Refinement This is an example of final detection boxes (dotted lines) and the refinement applied to them (solid lines
) in the second stage. Mask Generation Examples of generated masks. These then get scaled and placed on the image in the right location. Composing the different pieces into a final result Requirements Python 3 Pytorch 0. 3 matplotlib, scipy, skimage, h5py Installation 1. We use functions from two more repositories that need to be build with the right option for cuda support. The two functions are Non-Maximum Suppression from ruotianluo's pytorch-faster-rcnn repository and longcw's RoiAlign. As we
use the COCO dataset install the Python COCO API and create a symlink. Download the pretrained models on COCO and ImageNet from Google Drive. Demo To test your installation simply run the demo with It works on CPU or GPU and the result should look like this: Training on COCO Training and evaluation code is in coco. You can run it from the command line as such: If you have not yet downloaded the COCO dataset you should run the
command with the download option set, e. : You can also run the COCO evaluation code with: The training schedule, learning rate, and other parameters can be set in coco. Results COCO results for bounding box and segmentation are reported based on training with the default configuration and backbone initialized with pretrained ImageNet weights.
Frequently asked questions
How many stars and forks are recorded?
multimodallearning/pytorch-mask-rcnn has 2,064 stars and 545 forks.
What is the repository rank?
multimodallearning/pytorch-mask-rcnn is ranked 9,034.
What language and category are recorded?
multimodallearning/pytorch-mask-rcnn has 2,064 stars, uses Python and belongs to Model Development.
Which repository is closest in rank?
multimodallearning/pytorch-mask-rcnn is compared with ozan-oktay/Attention-Gated-Networks, ranked 9,032 with 2,065 stars.
README
pytorch-mask-rcnn
This is a Pytorch implementation of Mask R-CNN that is in large parts based on Matterport's
Mask_RCNN. Matterport's repository is an implementation on Keras and TensorFlow.
The following parts of the README are excerpts from the Matterport README. Details on the requirements, training on MS COCO
and detection results for this repository can be found at the end of the document.
The Mask R-CNN model generates bounding boxes and segmentation masks for each instance of an object in the image. It's based
on Feature Pyramid Network (FPN) and a ResNet101 backbone.
The next four images visualize different stages in the detection pipeline:
1. Anchor sorting and filtering
The Region Proposal Network proposes bounding boxes that are likely to belong to an object. Positive and negative anchors
along with anchor box refinement are visualized.
2. Bounding Box Refinement
This is an example of final detection boxes (dotted lines) and the refinement applied to them (solid lines) in the second stage.
3. Mask Generation
Examples of generated masks. These then get scaled and placed on the image in the right location.
4. Composing the different pieces into a final result
We use functions from two more repositories that need to be build with the right --arch option for cuda support.
The two functions are Non-Maximum Suppression from ruotianluo's pytorch-faster-rcnn
repository and longcw's RoiAlign.
GPU
arch
TitanX
sm_52
GTX 960M
sm_50
GTX 1070
sm_61
GTX 1080 (Ti)
sm_61
cd nms/src/cuda/
nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../
cd roialign/roi_align/src/cuda/
nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../../
Download the pretrained models on COCO and ImageNet from Google Drive.
Demo
To test your installation simply run the demo with
python demo.py
It works on CPU or GPU and the result should look like this:
Training on COCO
Training and evaluation code is in coco.py. You can run it from the command
line as such:
# Train a new model starting from pre-trained COCO weights
python coco.py train --dataset=/path/to/coco/ --model=coco
# Train a new model starting from ImageNet weights
python coco.py train --dataset=/path/to/coco/ --model=imagenet
# Continue training a model that you had trained earlier
python coco.py train --dataset=/path/to/coco/ --model=/path/to/weights.h5
# Continue training the last model you trained. This will find
# the last trained weights in the model directory.
python coco.py train --dataset=/path/to/coco/ --model=last
If you have not yet downloaded the COCO dataset you should run the command
with the download option set, e.g.:
# Train a new model starting from pre-trained COCO weights
python coco.py train --dataset=/path/to/coco/ --model=coco --download=true
You can also run the COCO evaluation code with:
# Run COCO evaluation on the last trained model
python coco.py evaluate --dataset=/path/to/coco/ --model=last
The training schedule, learning rate, and other parameters can be set in coco.py.
Results
COCO results for bounding box and segmentation are reported based on training
with the default configuration and backbone initialized with pretrained
ImageNet weights. Used metric is AP on IoU=0.50:0.95.