资源算法Mask_RCNN_Pytorch

Mask_RCNN_Pytorch

2020-02-13 | |  33 |   0 |   0

Mask_RCNN_Pytorch

This is an implementation of the instance segmentation model Mask R-CNN on Pytorch, based on the previous work of Matterport and lasseha. Matterport's repository is an implementation on Keras and TensorFlow while lasseha's repository is an implementation on Pytorch.

Features

Compared with other PyTorch implementations, this repository has the following features:

  • It supports multi-image batch training (i.e., batch size >1).

  • It supports PyTorch 0.4.0 (Currently does not support Pytorch >1.0).

  • It supports both GPU and CPU. You can use a CPU to visualize the results.

  • It supports multiple GPUs training (please look at instrctions here).

  • You could train Mask R-CNN on your own dataset (please see synthia.py, which demonstrates how we trained a model on Synthia Dataset, starting from the model pre-trained on COCO Dataset).

  • You could use a model pre-trained on COCO or ImageNet to segment objects in your own images (please see demo_coco.py or demo_synthia.py).

Requirements

  • Python 3

  • Linux

  • PyTorch 0.4.0

  • matplotlib, scipy, skimage, h5py, numpy

Demo

Synthia Dataset

图片.png

COCO dataset

图片.png

Compilation

The instructions come from lasseha's repository.

  • We use the Non-Maximum Suppression from ruotianluo and the RoiAlign from longcw. Please follow the instructions below to build the functions.

      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 ../../

    where 'arch' is determined by your GPU model:

    GPUTitanXGTX 960MGTX 1070GTX 1080 (Ti)
    archsm_52sm_50sm_61sm_61
  • If you want to train the network on the COCO dataset, please install the Python COCO API and create a symlink.

      ln -s /path/to/coco/cocoapi/PythonAPI/pycocotools/ pycocotools
  • The pretrained models on COCO and ImageNet are available here.

Results(COCO)

The training and evaluation is based on COCO Dataset 2014. To understand the indicators below, please have a look at pycocotools. Notably, I only used one GTX 1080 (Ti). I think the performance could be improved if more GPUs are available.

IndicatorIoUareamaxDetsValue
Average Precision (AP)0.50:0.95all1000.392
Average Precision (AP)0.50all1000.574
Average Precision (AP)0.75all1000.434
Average Precision (AP)0.50:0.95small1000.199
Average Precision (AP)0.50:0.95medium1000.448
Average Precision (AP)0.50:0.95large1000.575
Average Recall (AR)0.50:0.95all10.321
Average Recall (AR)0.50:0.95all100.445
Average Recall (AR)0.50:0.95all1000.457
Average Recall (AR)0.50:0.95small1000.231
Average Recall (AR)0.50:0.95medium1000.508
Average Recall (AR)0.50:0.95large1000.645


上一篇:Mask_R_CNN_Keypoints

下一篇:maskrcnn-modanet

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...