Coder Social home page Coder Social logo

cornernet's Introduction

CornerNet: Training and Evaluation Code

Code for reproducing the results in the following paper:

CornerNet: Detecting Objects as Paired Keypoints
Hei Law, Jia Deng
European Conference on Computer Vision (ECCV), 2018

Getting Started

Please first install Anaconda and create an Anaconda environment using the provided package list.

conda create --name CornerNet --file conda_packagelist.txt

After you create the environment, activate it.

source activate CornerNet

Our current implementation only supports GPU so you need a GPU and need to have CUDA installed on your machine.

Compiling Corner Pooling Layers

You need to compile the C++ implementation of corner pooling layers.

cd <CornetNet dir>/models/py_utils/_cpools/
python setup.py install --user

Compiling NMS

You also need to compile the NMS code (originally from Faster R-CNN and Soft-NMS).

cd <CornetNet dir>/external
make

Installing MS COCO APIs

You also need to install the MS COCO APIs.

cd <CornetNet dir>/data
git clone [email protected]:cocodataset/cocoapi.git coco
cd <CornetNet dir>/data/coco/PythonAPI
make

Downloading MS COCO Data

  • Download the training/validation split we use in our paper from here (originally from Faster R-CNN)
  • Unzip the file and place annotations under <CornetNet dir>/data/coco
  • Download the images (2014 Train, 2014 Val, 2017 Test) from here
  • Create 3 directories, trainval2014, minival2014 and testdev2017, under <CornerNet dir>/data/coco/images/
  • Copy the training/validation/testing images to the corresponding directories according to the annotation files

Training and Evaluation

To train and evaluate a network, you will need to create a configuration file, which defines the hyperparameters, and a model file, which defines the network architecture. The configuration file should be in JSON format and placed in config/. Each configuration file should have a corresponding model file in models/. i.e. If there is a <model>.json in config/, there should be a <model>.py in models/. There is only one exception which we will mention later.

To train a model:

python train.py <model>

We provide the configuration file (CornerNet.json) and the model file (CornerNet.py) for CornerNet in this repo.

To train CornerNet:

python train.py CornerNet

We also provide a trained model for CornerNet, which is trained for 500k iterations using 10 Titan X (PASCAL) GPUs. You can download it from here and put it under <CornerNet dir>/cache/nnet/CornerNet (You may need to create this directory by yourself if it does not exist). If you want to train you own CornerNet, please adjust the batch size in CornerNet.json to accommodate the number of GPUs that are available to you.

To use the trained model:

python test.py CornerNet --testiter 500000 --split <split>

If you want to test different hyperparameters in testing and do not want to overwrite the original configuration file, you can do so by creating a configuration file with a suffix (<model>-<suffix>.json). You DO NOT need to create <model>-<suffix>.py in models/.

To use the new configuration file:

python test.py <model> --testiter <iter> --split <split> --suffix <suffix>

We also include a configuration file for multi-scale evaluation, which is CornerNet-multi_scale.json, in this repo.

To use the multi-scale configuration file:

python test.py CornerNet --testiter <iter> --split <split> --suffix multi_scale

cornernet's People

Contributors

heilaw avatar

Watchers

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