Giter VIP home page Giter VIP logo

detectron-cascade-rcnn's Introduction

Cascade R-CNN: Delving into High Quality Object Detection

by Zhaowei Cai and Nuno Vasconcelos

This repository is written by Zhaowei Cai at UC San Diego, on the base of Detectron @ e8942c8.

Introduction

This repository re-implements Cascade R-CNN on the base of Detectron. Very consistent gains are available for all tested models, regardless of baseline strength.

Please follow Detectron on how to install and use Detectron-Cascade-RCNN.

It is also recommended to use our original implementation, cascade-rcnn based on Caffe, and the third-party implementation, mmdetection based on PyTorch and tensorpack based on TensorFlow.

Citation

If you use our code/model/data, please cite our paper:

@inproceedings{cai18cascadercnn,
  author = {Zhaowei Cai and Nuno Vasconcelos},
  Title = {Cascade R-CNN: Delving into High Quality Object Detection},
  booktitle = {CVPR},
  Year  = {2018}
}

or its extension:

@article{cai2019cascadercnn,
  author = {Zhaowei Cai and Nuno Vasconcelos},
  title = {Cascade R-CNN: High Quality Object Detection and Instance Segmentation},
  journal = {arXiv preprint arXiv:1906.09756},
  year = {2019}
}

and Detectron:

@misc{Detectron2018,
  author =       {Ross Girshick and Ilija Radosavovic and Georgia Gkioxari and
                  Piotr Doll\'{a}r and Kaiming He},
  title =        {Detectron},
  howpublished = {\url{https://github.com/facebookresearch/detectron}},
  year =         {2018}
}

Benchmarking

End-to-End Faster & Mask R-CNN Baselines

        backbone         type lr
schd
im/
gpu
box
AP
box
AP50
box
AP75
mask
AP
mask
AP50
mask
AP75
download
links
R-50-FPN-baseline Faster 1x 2 36.7 58.4 39.6 - - - model | boxes
R-50-FPN-cascade Faster 1x 2 40.9 59.0 44.6 - - - model | boxes
R-101-FPN-baseline Faster 1x 2 39.4 61.2 43.4 - - - model | boxes
R-101-FPN-cascade Faster 1x 2 42.8 61.4 46.1 - - - model | boxes
X-101-64x4d-FPN-baseline Faster 1x 1 41.5 63.8 44.9 - - - model | boxes
X-101-64x4d-FPN-cascade Faster 1x 1 45.4 64.0 49.8 - - - model | boxes
X-101-32x8d-FPN-baseline Faster 1x 1 41.3 63.7 44.7 - - - model | boxes
X-101-32x8d-FPN-cascade Faster 1x 1 44.7 63.7 48.8 - - - model | boxes
R-50-FPN-baseline Mask 1x 2 37.7 59.2 40.9 33.9 55.8 35.8 model | boxes | masks
R-50-FPN-cascade Mask 1x 2 41.3 59.6 44.9 35.4 56.2 37.8 model | boxes | masks
R-101-FPN-baseline Mask 1x 2 40.0 61.8 43.7 35.9 58.3 38.0 model | boxes | masks
R-101-FPN-cascade Mask 1x 2 43.3 61.7 47.2 37.1 58.6 39.8 model | boxes | masks
X-101-64x4d-FPN-baseline Mask 1x 1 42.4 64.3 46.4 37.5 60.6 39.9 model | boxes | masks
X-101-64x4d-FPN-cascade Mask 1x 1 45.9 64.4 50.2 38.8 61.3 41.6 model | boxes | masks
X-101-32x8d-FPN-baseline Mask 1x 1 42.1 64.1 45.9 37.3 60.3 39.5 model | boxes | masks
X-101-32x8d-FPN-cascade Mask 1x 1 45.8 64.1 50.3 38.6 60.6 41.5 model | boxes | masks

Mask R-CNN with Bells & Whistles

        backbone         type lr
schd
im/
gpu
box
AP
box
AP50
box
AP75
mask
AP
mask
AP50
mask
AP75
download
links
X-152-32x8d-FPN-IN5k-baseline Mask s1x 1 48.1 68.3 52.9 41.5 65.1 44.7 model | boxes | masks
[above without test-time aug.] 45.2 66.9 49.7 39.7 63.5 42.4
X-152-32x8d-FPN-IN5k-cascade Mask s1x 1 50.2 68.2 55.0 42.3 65.4 45.8 model | boxes | masks
[above without test-time aug.] 48.1 66.7 52.6 40.7 63.7 43.8

Faster & Mask R-CNN with GN

        backbone         type lr
schd
im/
gpu
box
AP
box
AP50
box
AP75
mask
AP
mask
AP50
mask
AP75
download
links
R-50-FPN-GN-baseline Faster 1x 2 38.4 59.9 41.7 - - - model | boxes
R-50-FPN-GN-cascade Faster 1x 2 42.2 60.6 45.8 - - - model | boxes
R-101-FPN-GN-baseline Faster 1x 2 39.9 61.3 43.3 - - - model | boxes
R-101-FPN-GN-cascade Faster 1x 1 43.8 62.2 47.6 - - - model | boxes
R-50-FPN-GN-baseline Mask 1x 2 39.2 60.5 42.9 34.9 57.1 36.9 model | boxes
R-50-FPN-GN-cascade Mask 1x 1 42.9 60.7 46.6 36.6 57.7 39.2 model | boxes | masks
R-101-FPN-GN-baseline Mask 1x 2 41.1 62.1 45.1 36.3 58.9 38.5 model | boxes | masks
R-101-FPN-GN-cascade Mask 1x 1 44.8 62.8 48.8 38.0 59.8 40.8 model | boxes | masks

detectron-cascade-rcnn's People

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  avatar  avatar  avatar  avatar  avatar  avatar

detectron-cascade-rcnn's Issues

i run sudo nvidia-docker run --rm -it detectron:c2-cuda9-cudnn7 python2 tools/infer_simple.py --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml --output-dir demo/output --image-ext jpg --wts https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl demo

INFO infer_simple.py: 133: Processing demo/34501842524_3c858b3080_k.jpg -> demo/output/34501842524_3c858b3080_k.jpg.pdf
INFO infer_simple.py: 141: Inference time: 0.164s
INFO infer_simple.py: 143: | im_detect_bbox: 0.141s
INFO infer_simple.py: 143: | misc_mask: 0.013s
INFO infer_simple.py: 143: | im_detect_mask: 0.006s
INFO infer_simple.py: 143: | misc_bbox: 0.002s
INFO infer_simple.py: 133: Processing demo/19064748793_bb942deea1_k.jpg -> demo/output/19064748793_bb942deea1_k.jpg.pdf
INFO infer_simple.py: 141: Inference time: 0.235s
INFO infer_simple.py: 143: | im_detect_bbox: 0.137s
INFO infer_simple.py: 143: | misc_mask: 0.061s
INFO infer_simple.py: 143: | im_detect_mask: 0.034s
INFO infer_simple.py: 143: | misc_bbox: 0.003s
INFO infer_simple.py: 133: Processing demo/17790319373_bd19b24cfc_k.jpg -> demo/output/17790319373_bd19b24cfc_k.jpg.pdf
INFO infer_simple.py: 141: Inference time: 0.205s
INFO infer_simple.py: 143: | im_detect_bbox: 0.142s
INFO infer_simple.py: 143: | misc_mask: 0.043s
INFO infer_simple.py: 143: | im_detect_mask: 0.017s
INFO infer_simple.py: 143: | misc_bbox: 0.003s
INFO infer_simple.py: 133: Processing demo/16004479832_a748d55f21_k.jpg -> demo/output/16004479832_a748d55f21_k.jpg.pdf
INFO infer_simple.py: 141: Inference time: 0.163s
INFO infer_simple.py: 143: | im_detect_bbox: 0.139s
INFO infer_simple.py: 143: | misc_mask: 0.015s
INFO infer_simple.py: 143: | im_detect_mask: 0.006s
INFO infer_simple.py: 143: | misc_bbox: 0.003s
INFO infer_simple.py: 133: Processing demo/33887522274_eebd074106_k.jpg -> demo/output/33887522274_eebd074106_k.jpg.pdf
INFO infer_simple.py: 141: Inference time: 0.150s
INFO infer_simple.py: 143: | im_detect_bbox: 0.130s
INFO infer_simple.py: 143: | misc_mask: 0.011s
INFO infer_simple.py: 143: | im_detect_mask: 0.006s
INFO infer_simple.py: 143: | misc_bbox: 0.003s

I can't see the files in the output folder under the local demo (I deleted all the files from the original output)

urllib2.HTTPError: HTTP Error 301: Moved Permanently

The link about the pretrained model seems Invalid
Can you give me some suggestion to solve it?

After following steps 1-3 above and agreeing to provide the detailed information requested

INFO io.py: 67: Downloading remote file https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/25093814/X-152-32x8d-IN5k.pkl to /tmp/detectron-download-cache/ImageNetPretrained/25093814/X-152-32x8d-IN5k.pkl
Traceback (most recent call last):
File "tools/train_net.py", line 132, in
main()
File "tools/train_net.py", line 101, in main
assert_and_infer_cfg()
File "/home/wrc/CBNet/detectron/core/config.py", line 1127, in assert_and_infer_cfg
cache_cfg_urls()
File "/home/wrc/CBNet/detectron/core/config.py", line 1136, in cache_cfg_urls
__C.TRAIN.WEIGHTS = cache_url(__C.TRAIN.WEIGHTS, __C.DOWNLOAD_CACHE)
File "/home/wrc/CBNet/detectron/utils/io.py", line 68, in cache_url
download_url(url, cache_file_path)
File "/home/wrc/CBNet/detectron/utils/io.py", line 114, in download_url
response = urllib2.urlopen(url)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/wrc/anaconda3/envs/py27/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 301: Moved Permanently

Expected results

train normally

Actual results

urllib2.HTTPError: HTTP Error 301: Moved Permanently

Detailed steps to reproduce

E.g.:


System information

INFO loader.py: 113: Stopping mini-batch loading thread,can you tell me why ?

CRITICAL train.py: 98: roi_data_loader failed
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread
INFO loader.py: 126: Stopping enqueue thread

Can't download the weight?

When I train the model with "configs/e2e_cascade_rcnn_R-101-FPN_1x_gn.yaml", it shows such errors:

INFO io.py: 67: Downloading remote file https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/47592356/R-101-GN.pkl to /tmp/detectron-download-cache/ImageNetPretrained/47592356/R-101-GN.pkl
Traceback (most recent call last):
File "tools/train_net.py", line 132, in
main()
File "tools/train_net.py", line 101, in main
assert_and_infer_cfg()
File "/home/test/Detectron-Cascade-RCNN/detectron/core/config.py", line 1127, in assert_and_infer_cfg
cache_cfg_urls()
File "/home/test/Detectron-Cascade-RCNN/detectron/core/config.py", line 1136, in cache_cfg_urls
__C.TRAIN.WEIGHTS = cache_url(__C.TRAIN.WEIGHTS, __C.DOWNLOAD_CACHE)
File "/home/test/Detectron-Cascade-RCNN/detectron/utils/io.py", line 68, in cache_url
download_url(url, cache_file_path)
File "/home/test/Detectron-Cascade-RCNN/detectron/utils/io.py", line 114, in download_url
response = urllib2.urlopen(url)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/dl/anaconda3/envs/caffe2_py2/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

And I try to “wget https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/47592356/R-101-GN.pkl”, it also failured.

Can anyone show me where is the model "https://s3-us-west-2.amazonaws.com/detectron/ImageNetPretrained/47592356/R-101-GN.pkl"?

Loss is NaN

When I use my own data to train the model I found the error happened ? I have already modified the lr to a small value but after few hours training ,the error still happened

mAP&AP

I use the detectron model and run the e2e_cascade_rcnn_R-50-fpn_1x.yaml
but it only show the MEAN AP
how to show the AP ?

Doesn't work for my custom dataset

I have a custom dataset, Detectron works well, but I switch to your Cascade-RCNN, the loss doesn't decease, and performance is bad, Could you help figure it out? by the way, the gt numbers of my custom dataset is large

Caffe2 installed edition question

The caffe2 installed can run the official Detectron properly.But when I try to test your code ,this error happend. Can you give me some suggestions?

File "/home/wrc/Detectron-Cascade-RCNN/detectron/utils/env.py", line 71, in get_detectron_ops_lib
('Detectron ops lib not found; make sure that your Caffe2 '
AssertionError: Detectron ops lib not found; make sure that your Caffe2 version includes Detectron module

I don't know how to do it.

gtx-16@gtx16-Lenovo:~/Detectron-Cascade-RCNN$ sudo nvidia-docker run --rm -it detectron:c2-cuda9-cudnn7 python2 detectron/tests/test_batch_permutation_op.py
No handlers could be found for logger "caffe2.python.net_drawer"
net_drawer will not run correctly. Please install the correct dependencies.
E0929 07:30:17.760017 1 init_intrinsics_check.cc:54] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0929 07:30:17.760035 1 init_intrinsics_check.cc:54] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0929 07:30:17.760040 1 init_intrinsics_check.cc:54] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Found Detectron ops lib: /usr/local/caffe2_build/lib/libcaffe2_detectron_ops_gpu.so
..

Ran 2 tests in 0.726s

OK

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.