Skip to main content

chainer-mask-rcnn

PyPI version Python Versions GitHub Actions

Chainer Implementation of Mask R-CNN.

Features


Fig 1. Mask R-CNN, ResNet50, 8GPU, Ours, COCO 31.4 mAP@50:95

COCO Results

Model Implementation N gpu training mAP@50:95 Log
Mask R-CNN, ResNet50 Ours 8 31.5 - 31.8 Log
Mask R-CNN, ResNet50 Detectron 8 31.4 (30.8 after copied) Log
FCIS, ResNet50 FCIS 8 27.1 -

Inference

# you can use your trained model
./demo.py logs/<YOUR_TRAINING_LOG> --img <IMAGE_PATH_OR_URL>

# COCO Example: Mask R-CNN, ResNet50, 31.4 mAP@50:95
cd examples/coco
LOG_DIR=logs/20180730_081433
mkdir -p $LOG_DIR
pip install gdown
gdown https://drive.google.com/uc?id=1XC-Mx4HX0YBIy0Fbp59EjJFOF7a3XK0R -O $LOG_DIR/snapshot_model.npz
gdown https://drive.google.com/uc?id=1fXHanL2pBakbkv83wn69QhI6nM6KjrzL -O $LOG_DIR/params.yaml
./demo.py $LOG_DIR

# copy weight from caffe2 to chainer
cd examples/coco
./convert_caffe2_to_chainer.py  # or download from https://drive.google.com/open?id=1WOEtVnxqYdHl35pAyIcp-H0HtTjI-l3V
./demo.py logs/R-50-C4_x1_caffe2_to_chainer --img https://raw.githubusercontent.com/facebookresearch/Detectron/master/demo/33823288584_1d21cf0a26_k.jpg
./demo.py logs/R-50-C4_x1_caffe2_to_chainer --img https://raw.githubusercontent.com/facebookresearch/Detectron/master/demo/17790319373_bd19b24cfc_k.jpg


Fig 2. Mask R-CNN, ResNet50, 8GPU, Copied from Detectron, COCO 31.4 mAP@50:95

Installation & Training

Single GPU Training

# Install Chainer Mask R-CNN.
pip install opencv-python
pip install .

# Run training!
cd examples/coco && ./train.py --gpu 0

Multi GPU Training

# Install OpenMPI
wget https://www.open-mpi.org/software/ompi/v3.0/downloads/openmpi-3.0.0.tar.gz
tar zxvf openmpi-3.0.0.tar.gz
cd openmpi-3.0.0
./configure --with-cuda
make -j4
sudo make install
sudo ldconfig

# Install NCCL
# dpkg -i nccl-repo-ubuntu1404-2.1.4-ga-cuda8.0_1-1_amd64.deb
dpkg -i nccl-repo-ubuntu1604-2.1.15-ga-cuda9.1_1-1_amd64.deb
sudo apt update
sudo apt install libnccl2 libnccl-dev

# Install ChainerMN
pip install chainermn

# Finally, install Chainer Mask R-CNN.
pip install opencv-python
pip install .

# Run training!
cd examples/coco && mpirun -n 4 ./train.py --multi-node

Testing

pip install flake8 pytest
flake8 .
pytest -v tests

Metadata

Release files for chainer-mask-rcnn 0.5.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chainer-mask-rcnn 0.5.24
File Size Uploaded
chainer-mask-rcnn-0.5.24.tar.gz 70.3 kB Details

Release files / chainer-mask-rcnn-0.5.24.tar.gz

Download URL chainer-mask-rcnn-0.5.24.tar.gz
Size 70.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f99b9a4471c6b62a1550af34551103977de7befa9b4cffc7eb6262fb0e1dd54e
BLAKE2b-256 checksum
How to use checksums
60f7a49f7625cc190657118eaab1f34d79db1bde42c8bd7d06c38737b649e21c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.20.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.5.24 This release

1 release file

0.5.23

1 release file

0.5.22

1 release file

0.5.21

1 release file

0.5.20

1 release file

0.5.19

1 release file

0.5.18

1 release file

0.5.17

1 release file

0.5.16

1 release file

0.5.15

1 release file

0.5.14

1 release file

0.5.13

1 release file

0.5.12

1 release file

0.5.11

1 release file

0.5.10

1 release file

0.5.9

1 release file

0.5.8

1 release file

0.5.7

1 release file

0.5.6

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page