Code Monkey home page Code Monkey logo

keras-faster-rcnn-1's Introduction

keras_frcnn

This repo is an implementation of faster r-cnn using Keras and Tensorflow. The Tensorflow part borrows the ref: https://github.com/endernewton/tf-faster-rcnn a lot.

Introduction

The implementation is aiming to build the Keras interface based on a Tensorflow FRCNN code [1]. Most of the tf functions are packed by using Keras Lambda. And the structure of the code is changed.

Testing Results and Some Notes

  • Pascal VOC 2007
model #GPUs batch size lr max_epoch mem/GPU mAP
VGG-16     1 1   1e-5 7 8817 MB 66.0
  • Pascal VOC 2007 + 2012
model #GPUs batch size lr max_epoch mem/GPU mAP
VGG-16     1 1   1e-5 7 8817 MB 72.2
  • COCO 2014
model #GPUs batch size lr max_epoch mem/GPU mAP
VGG-16     1 1   1e-5 7 8817 MB 31.2

Required Environment

  • Ubuntu 16.04

  • Python 2/3, in case you need the sufficient scientific computing packages, we recommend you to install anaconda.

  • Tensorflow >= 1.5.0

  • Keras >= 2.2.0

  • Optional: if you need GPUs acceleration, please install CUDA that the version requires >= 9.0

Training and Testing

  • Data preparation and setup

    Follow the ref: https://github.com/rbgirshick/py-faster-rcnn#beyond-the-demo-installation-for-training-and-testing-models. Download Pascal VOC 07 dataset and build soft link in folder ./data/, then name the link as "VOCdevkit2007"

    To compile the lib, move into the lib folder "cd ./lib". According to your hardware, change the "-arch" parameter in setup.py line: 130. Then run

    make
    

    Tips: to find your hardware compiling setting, you can refer to: http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/. For me using the Titan XP, I set the "-arch" as "sm_61".

  • Training

    Build the model weight saving folder "../output/[NET]/"

    Download pre-trained models and weights:

    mkdir net_weights
    wget https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
    cd ..
    
    

    Run the following script:

    ./scripts/train_faster_rcnn.sh [GPU_ID] [DATASET] [NET]
    # GPU_ID is the GPU you want to test on
    # NET in {vgg16} is the network arch to use,
    # DATASET {pascal_voc, pascal_voc_0712, coco} is defined in train_faster_rcnn.sh
    # Examples:
    ./scripts/train_faster_rcnn.sh 0 pascal_voc vgg16
    
  • Testing

    Build the test output saving folder "../output/[NET]/"

    Run the following script:

    ./scripts/test_faster_rcnn.sh [GPU_ID] [DATASET] [NET]
    # GPU_ID is the GPU you want to test on
    # NET in {vgg16} is the network arch to use,
    # DATASET {pascal_voc, pascal_voc_0712, coco} is defined in train_faster_rcnn.sh
    # Examples:
    ./scripts/test_faster_rcnn.sh 0 pascal_voc vgg16
    
    

Reference

keras-faster-rcnn-1's People

Watchers

James Cloos avatar

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.