Giter VIP home page Giter VIP logo

detectron-traffic-signs's Introduction

Detectron for Traffic Signs

This branch contains fixes for the Detectron code that allows aplication on domains with many small objects, specifically it was designed for traffic sign detection from the "Deep Learning for Large-Scale Traffic-Sign Detection and Recognition" ITS 2019 journal paper.

The following changes are included:

  • integrated Online Hard Negative Minning (OHEM)
  • modifed selection of training ROIs to cover small and large regions evenly
  • added weights to loss of background samples during training (weight of 0.01 for RPN and 0.1 for classification)

YAML definition files of detectron models for the DFG-dataset are available below:

Each zip contains models based on ResNet101_FPN and ResNet50_FPN that have enabled OHEM (OHEM: True), even selection of small and large ROIs (RPN_EVENLY_SELECT_POS_ROIS: True) and weighting of pos/neg classes (RPN_SIZE_WEIGHTED_LOSS: True and CLS_SIZE_WEIGHTED_LOSS: True).

You can download weights trained on DFG-Dataset for the upper model in:

Note: Due to slight update of the DFG dataset the resulty may vary from the ITS 2019 paper

Installation

Our changes to the code require custom WeightedSigmoidCrossEntropyLoss operation (for RPN_SIZE_WEIGHTED_LOSS and CLS_SIZE_WEIGHTED_LOSS options) which is implemented in the DETECTRON_PATH/caffe2-modules/ folder. All files in DETECTRON_PATH/caffe2-modules/* need to be coppied into your caffe2 source (CAFFE2_SRC_PATH/modules/detectron).

export DETECTRON_PATH=/path/to/detectron
export CAFFE2_SRC_PATH=/path/to/caffe2_source

cp $DETECTRON_PATH/caffe2-modules/* $CAFFE2_SRC_PATH/modules/detectron

After copying caffe2-modules/* caffe2 proceed with the instalation instructions for caffe2 and Detectron in INSTALL.md

Citation

Please cite our ITS 2019 paper when using modifications for Detectron from this repository or for the DFG dataset:

 @article{Tabernik2019ITS,
    author = {Tabernik, Domen and Sko{\v{c}}aj, Danijel},
    journal = {IEEE Transactions on Intelligent Transportation Systems},
    title = {{Deep Learning for Large-Scale Traffic-Sign Detection and Recognition}},
    year = {2019},
    doi={10.1109/TITS.2019.2913588}, 
    ISSN={1524-9050}
 }

Detectron

Detectron is Facebook AI Research's software system that implements state-of-the-art object detection algorithms, including Mask R-CNN. It is written in Python and powered by the Caffe2 deep learning framework.

At FAIR, Detectron has enabled numerous research projects, including: Feature Pyramid Networks for Object Detection, Mask R-CNN, Detecting and Recognizing Human-Object Interactions, Focal Loss for Dense Object Detection, Non-local Neural Networks, Learning to Segment Every Thing, and Data Distillation: Towards Omni-Supervised Learning.

Example Mask R-CNN output.

Introduction

The goal of Detectron is to provide a high-quality, high-performance codebase for object detection research. It is designed to be flexible in order to support rapid implementation and evaluation of novel research. Detectron includes implementations of the following object detection algorithms:

using the following backbone network architectures:

Additional backbone architectures may be easily implemented. For more details about these models, please see References below.

License

Detectron is released under the Apache 2.0 license. See the NOTICE file for additional details.

Citing Detectron

If you use Detectron in your research or wish to refer to the baseline results published in the Model Zoo, please use the following BibTeX entry.

@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}
}

Model Zoo and Baselines

We provide a large set of baseline results and trained models available for download in the Detectron Model Zoo.

Installation

Please find installation instructions for Caffe2 and Detectron in INSTALL.md.

Quick Start: Using Detectron

After installation, please see GETTING_STARTED.md for brief tutorials covering inference and training with Detectron.

Getting Help

To start, please check the troubleshooting section of our installation instructions as well as our FAQ. If you couldn't find help there, try searching our GitHub issues. We intend the issues page to be a forum in which the community collectively troubleshoots problems.

If bugs are found, we appreciate pull requests (including adding Q&A's to FAQ.md and improving our installation instructions and troubleshooting documents). Please see CONTRIBUTING.md for more information about contributing to Detectron.

References

detectron-traffic-signs's People

Contributors

benq581 avatar ir413 avatar rbgirshick avatar skokec 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

Watchers

 avatar  avatar  avatar  avatar  avatar

detectron-traffic-signs's Issues

Configuration File

Hi @skokec,

Wanted to know whether you used a custom-defined configuration file or used one of the following that facebook provided:

e2e_mask_rcnn_R-50-FPN_1x.yaml
e2e_mask_rcnn_R-101-FPN_1x.yaml

Thanks!

about training

Where do you want to train the dataset or where to change the path?
I may have missed some instructions, thank you.

about data aug

Do you have any code for data augmentation,I'd like to study, could I ?

KeyError: u'Key TEST.SCALES was renamed to TEST.SCALE; please update your config

dyx@arthur-PR4904P /m/b/2/d/detectron-traffic-signs (villard) [1]>
python tools/infer_simple.py
--cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml
--output-dir /tmp/detectron-visualizations
--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
Found Detectron ops lib: /home/dyx/anaconda3/envs/caffe2_install/lib/python2.7/site-packages/torch/lib/libcaffe2_detectron_ops_gpu.so
[E init_intrinsics_check.cc:43] 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.
[E init_intrinsics_check.cc:43] 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.
[E init_intrinsics_check.cc:43] 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.
/mnt/big_disk/2020/dyx/detectron/detectron/core/config.py:1145: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
return envu.yaml_load(cfg_to_load)
Traceback (most recent call last):
File "tools/infer_simple.py", line 149, in
main(args)
File "tools/infer_simple.py", line 97, in main
merge_cfg_from_file(args.cfg)
File "/mnt/big_disk/2020/dyx/detectron/detectron/core/config.py", line 1152, in merge_cfg_from_file
_merge_a_into_b(yaml_cfg, __C)
File "/mnt/big_disk/2020/dyx/detectron/detectron/core/config.py", line 1212, in _merge_a_into_b
_merge_a_into_b(v, b[k], stack=stack_push)
File "/mnt/big_disk/2020/dyx/detectron/detectron/core/config.py", line 1200, in _merge_a_into_b
_raise_key_rename_error(full_key)
File "/mnt/big_disk/2020/dyx/detectron/detectron/core/config.py", line 1241, in _raise_key_rename_error
format(full_key, new_key, msg)
KeyError: u'Key TEST.SCALES was renamed to TEST.SCALE; please update your config. Note: Also convert from a tuple, e.g. (600, ), to a integer, e.g. 600.'

Who can help me? thanks

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.