Code Monkey home page Code Monkey logo

faster-rcnn-kitti-bdd100k's Introduction

Faster R-CNN for KITTI and BDD100K

This project is based on facebookresearch's maskrcnn-benchmark.

Installation

conda create --name py36 python=3.6
conda activate py36
conda install -c anaconda numpy
conda install -c anaconda cython
conda install ipython
pip install tqdm yacs
mkdir ~/github
cd ~/github
export INSTALL_DIR=$PWD
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
python setup.py build_ext install
cd ~/github
git clone https://github.com/xanderchf/faster-rcnn-KITTI-BDD100k.git
cd faster-rcnn-KITTI-BDD100k
conda install -c pytorch pytorch torchvision cudatoolkit=9.2
python setup.py build develop
unset INSTALL_DIR
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.12.0-cp36-cp36m-linux_x86_64.whl
pip install tensorboardX

Data Preparation

KITTI

This repo assumes that you followed NVIDIA DIGIT's instruction to prepare the KITTI dataset.

BDD100K

Prepare the dataset with the below structure:

bdd100k/
  images/
    100k/
      train/
      val/
      test/
  labels/
    bdd100k_labels_images_train.json
    bdd100k_labels_images_val.json

Finally, create a symlink for the datasets:

ln -s {parent directory of kitti and bdd100k} {root directory of this repo}/datasets

Training

KITTI

python tools/train_net.py --config-file "configs/e2e_faster_rcnn_R_101_FPN_1x.yaml" --use_tensorboard MODEL.ROI_BOX_HEAD.NUM_CLASSES 7 DATASETS.TRAIN '("kitti_train",)' OUTPUT_DIR out_kitti

BDD100K

python tools/train_net.py --config-file "configs/e2e_faster_rcnn_R_101_FPN_1x.yaml" --use_tensorboard MODEL.ROI_BOX_HEAD.NUM_CLASSES 11 DATASETS.TRAIN '("bdd100k_train",)' OUTPUT_DIR out_bdd

For the BDD100K dataset, you might need to clip the gradient for training stability. For other hyperparameters, refer to maskrcnn-benchmark.

Inference

Below commands loads saved weights and save the detections in the BDD format in {OUTPUT_DIR}/detections.

KITTI

python tools/test_net.py --weights out_kitti/*.pth --config-file "configs/e2e_faster_rcnn_R_101_FPN_1x.yaml" DATASETS.TEST '("kitti_val",)' OUTPUT_DIR out_kitti

BDD100K

python tools/test_net.py --weights out_bdd/*.pth --config-file "configs/e2e_faster_rcnn_R_101_FPN_1x.yaml" DATASETS.TEST '("bdd100k_val",)' OUTPUT_DIR out_bdd

Evaluate

To evaluate the saved detection, run the below command:

python tools/evaluate.py --result out_bdd/detections DATASETS.TEST '("bdd100k_val",)'

faster-rcnn-kitti-bdd100k's People

Contributors

haofengac avatar fmassa avatar soumith avatar jiayuan-gu avatar belowmit avatar killthekitten avatar godricly avatar guoxiawang avatar hadim avatar macfly1202 avatar kongsea avatar martinruenz avatar bermanmaxim avatar sotte avatar vfdev-5 avatar

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.