Code Monkey home page Code Monkey logo

grid-r-cnn's Introduction

Grid R-CNN

An mmdetection based implementation of updated Grid R-CNN published on CVPR 2019. Original paper is here, details of updates can be seen in this technical report.

Installation

This project is based on mmdetection object detection framework.

Requirements

Install Grid R-CNN with mmdetection

a. Create a conda virtual environment and activate it. Then install Cython.

conda create -n open-mmlab python=3.7 -y
source activate open-mmlab

conda install cython

b. Install PyTorch stable or nightly and torchvision following the official instructions.

c. Clone the this repository.

d. Compile cuda extensions.

./compile.sh

e. Setup mmdetection (other dependencies will be installed automatically).

python setup.py develop
# or "pip install -e ."

Dataset Preparation

It is recommended to symlink the dataset root to your project.

Grid_RCNN
├── mmdet
├── tools
├── configs
├── data
│   ├── coco
│   │   ├── annotations
│   │   ├── train2017
│   │   ├── val2017
│   │   ├── test2017
│   ├── VOCdevkit
│   │   ├── VOC2007
│   │   ├── VOC2012

Training and Testing

We provide training and testing scripts and config files for Grid R-CNN. An example configuration file is here, corresponding checkpoint is here. Note that the batchsize we used is 64(32 GPUs/2 images per GPU), you could adjust the learning rate and warmup schedule according to your batchsize.

Please see GETTING_STARTED.md for more basic usage of mmdetection.

Results

Training on Res50/101 FPN backbone and Testing on COCO minival. Inference speed is tested on our TITANXp GPU cluster.

Method lr sched AP [email protected] [email protected] AP@S AP@M AP@L Inference speed
Res50-FPN 2x 37.4% 59.3% 40.3% 21.8% 40.9% 47.9% 0.09s
Res50-FPN-Grid R-CNN 2x 40.4% 58.6% 43.7% 23.2% 44.2% 52.4% 0.11s
Res101-FPN 2x 39.5% 61.2% 43.1% 22.7% 43.7% 50.8% 0.12s
Res101-FPN-Grid R-CNN 2x 42.0% 60.6% 45.4% 24.1% 46.2% 55.2% 0.13s

Citation

If you use our codebase or models in your research, please cite this project.

@InProceedings{Lu_2019_CVPR,
author = {Lu, Xin and Li, Buyu and Yue, Yuxin and Li, Quanquan and Yan, Junjie},
title = {Grid R-CNN},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2019}
}

@article{mmdetection,
  title   = {{MMDetection}: Open MMLab Detection Toolbox and Benchmark},
  author  = {Kai Chen, Jiaqi Wang, Jiangmiao Pang, Yuhang Cao, Yu Xiong, Xiaoxiao Li,
             Shuyang Sun, Wansen Feng, Ziwei Liu, Jiarui Xu, Zheng Zhang, Dazhi Cheng,
             Chenchen Zhu, Tianheng Cheng, Qijie Zhao, Buyu Li, Xin Lu, Rui Zhu, Yue Wu,
             Jifeng Dai, Jingdong Wang, Jianping Shi, Wanli Ouyang, Chen Change Loy, Dahua Lin},
  journal = {arXiv preprint arXiv:1906.07155},
  year    = {2019}
}

License

Grid R-CNN is released under the Apache 2.0 license.

grid-r-cnn's People

Contributors

luxiin avatar siyuanren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grid-r-cnn's Issues

Get the bboxes' x,y,w,h

I want to get the bboxes' x,y,w,h. But I can't find any modules or methods to get them.How can I do to gain them?

Extra exception detection boxes

when i train the model on my owner dataset, recall is very high but when i check the badcase , i find some extra exception detection boxes even on clean surface. What could be the cause?

About low training speed with fewer gpus.

I tried to train Grid R-CNN with grid_rcnn_r50_fpn_2x.py, I used 4 gpus, setting lr=0.01 and warmup_iters=14660(2 epochs) 。The training goes well for now except that the training speed is very slow, about 2.2s/iter.

2019-08-12 23:29:06,094 - INFO - Epoch [2][4350/14659]  lr: 0.01000, eta: 8 days, 9:38:37, time: 2.414, data_time: 0.129, memory: 4836, loss_rpn_cls: 0.0598, loss_rpn_reg: 0.0411, loss_cls: 0.3345, acc: 89.5898, loss_grid: 0.6875, loss: 1.1229
2019-08-12 23:31:04,507 - INFO - Epoch [2][4400/14659]  lr: 0.01000, eta: 8 days, 9:41:07, time: 2.369, data_time: 0.134, memory: 4836, loss_rpn_cls: 0.0570, loss_rpn_reg: 0.0407, loss_cls: 0.3127, acc: 90.7246, loss_grid: 0.6755, loss: 1.0860
2019-08-12 23:32:52,252 - INFO - Epoch [2][4450/14659]  lr: 0.01000, eta: 8 days, 9:40:22, time: 2.155, data_time: 0.120, memory: 4836, loss_rpn_cls: 0.0632, loss_rpn_reg: 0.0409, loss_cls: 0.3332, acc: 90.3809, loss_grid: 0.6859, loss: 1.1231

My virtual environment is based on Anaconda 4.7, other system settings are as below:
Ubuntu 14.04
Pytorch 1.1
Python 3.7
CUDA 10.0
GCC 5.4
Need some help, thx.

FileNotFoundError: [Errno 2] No such file or directory: 'data/coco/annotations/instances_val2017.json'

python tools/test.py configs/grid_rcnn_r50_fpn_2x.py checkpoints/grid_rcnn_res50.pth --show
loading annotations into memory...
Traceback (most recent call last):
File "tools/test.py", line 189, in
main()
File "tools/test.py", line 145, in main
dataset = get_dataset(cfg.data.test)
File "/home/fsr/Grid-R-CNN/mmdet/datasets/utils.py", line 110, in get_dataset
dset = obj_from_dict(data_info, datasets)
File "/home/fsr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/utils.py", line 50, in obj_from_dict
return obj_type(**args)
File "/home/fsr/Grid-R-CNN/mmdet/datasets/custom.py", line 61, in init
self.img_infos = self.load_annotations(ann_file)
File "/home/fsr/Grid-R-CNN/mmdet/datasets/coco.py", line 25, in load_annotations
self.coco = COCO(ann_file)
File "/home/fsr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/pycocotools-2.0.2-py3.7-linux-x86_64.egg/pycocotools/coco.py", line 84, in init
with open(annotation_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'data/coco/annotations/instances_val2017.json'

but the file does exist.

module not found error

" !python tools/test.py grid_rcnn_r50_fpn_2x.py grid_rcnn_res50.pth --show " I try to run this code output like this

Traceback (most recent call last):
File "tools/test.py", line 12, in
from mmdet.apis import init_dist
ModuleNotFoundError: No module named 'mmdet'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.