eGitty

Discover The Most Popular Algorithms

SparseR-CNN: An Improvement of R-CNN with Learnable Proposals Using PyTorch for Object Detection

SparseR-CNN is the pytorch implementation of the paper: Sparse R-CNN: End-to-End Object Detection with Learnable Proposals. Existing works on object detection heavily rely on dense object candidates, such as k anchor boxes pre-defined on all grids of image feature map of size H × W. However, as to SparseR-CNN, it completely avoids all efforts related to object candidates design and many-toone label assignment.

The structure of SparseR-CNN

SparseR-CNN looks like:

The structure of SparseR-CNN

The database used in SparseR-CNN

All models in SparseR-CNN are trained on the COCO train2017 split (∼118k images) and evaluated with val2017 (5k images)

The comparable result of SparseR-CNN with other methods

You can find detailed results in paper, here we will list one:

The comparable result of SparseR-CNN with other methods

How to use SparseR-CNN?

Step 1: Install and build libs

git clone https://github.com/PeizeSun/SparseR-CNN.git
cd SparseR-CNN
python setup.py build develop

Step 2: Link coco dataset path to SparseR-CNN/datasets/coco

mkdir -p datasets/coco
ln -s /path_to_coco_dataset/annotations datasets/coco/annotations
ln -s /path_to_coco_dataset/train2017 datasets/coco/train2017
ln -s /path_to_coco_dataset/val2017 datasets/coco/val2017

Step 3: Train SparseR-CNN

python projects/SparseRCNN/train_net.py --num-gpus 8 \
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml

Step 4: Evaluate SparseR-CNN

python projects/SparseRCNN/train_net.py --num-gpus 8 \
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml \
    --eval-only MODEL.WEIGHTS path/to/model.pth

Step 5: Visualize SparseR-CNN

python demo/demo.py\
    --config-file projects/SparseRCNN/configs/sparsercnn.res50.100pro.3x.yaml \
    --input path/to/images --output path/to/save_images --confidence-threshold 0.4 \
    --opts MODEL.WEIGHTS path/to/model.pth

You can download source code in here to run: SparseR-CNN Download

Leave a Reply

Your email address will not be published. Required fields are marked *