Light-Head R-CNN

Overview

Light-head R-CNN

Introduction

We release code for Light-Head R-CNN.

This is my best practice for my research.

This repo is organized as follows:

light_head_rcnn/
    |->experiments
    |    |->user
    |    |    |->your_models
    |->lib       
    |->tools
    |->output

Main Results

  1. We train on COCO trainval which includes 80k training and 35k validation images. Test on minival which is a 5k subset in validation datasets. Noticing test-dev should be little higher than minival.
  2. We provide some crutial ablation experiments details, and it is easy to diff the difference.
  3. We share our training logs in GoogleDrive output folder, which contains dump models, training loss and speed of each steps. (experiments are done on 8 titan xp, and 2batches/per_gpu. Training should be within one day.)
  4. Because the limitation of the time, extra experiments are comming soon.
Model Name [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
R-FCN, ResNet-v1-101
our reproduce baseline
35.5 54.3 33.8 12.8 34.9 46.1
Light-Head R-CNN
ResNet-v1-101
38.2 60.9 41.0 20.9 42.2 52.8
Light-Head,ResNet-v1-101
+align pooling
39.3 61.0 42.4 22.2 43.8 53.2
Light-Head,ResNet-v1-101
+align pooling + nms0.5
40.0 62.1 42.9 22.5 44.6 54.0

Experiments path related to model:

experiments/lizeming/rfcn_reproduce.ori_res101.coco.baseline
experiments/lizeming/light_head_rcnn.ori_res101.coco 
experiments/lizeming/light_head_rcnn.ori_res101.coco.ps_roialign
experiments/lizeming/light_head_rcnn.ori_res101.coco.ps_roialign

Requirements

  1. tensorflow-gpu==1.5.0 (We only test on tensorflow 1.5.0, early tensorflow is not supported because of our gpu nms implementation)
  2. python3. We recommend using Anaconda as it already includes many common packages. (python2 is not tested)
  3. Python packages might missing. pls fix it according to the error message.

Installation, Prepare data, Testing, Training

Installation

  1. Clone the Light-Head R-CNN repository, and we'll call the directory that you cloned Light-Head R-CNNN as ${lighthead_ROOT}.
git clone https://github.com/zengarden/light_head_rcnn
  1. Compiling
cd ${lighthead_ROOT}/lib;
bash make.sh

Make sure all of your compiling is successful. It may arise some errors, it is useful to find some common compile errors in FAQ

  1. Create log dump directory, data directory.
cd ${lighthead_ROOT};
mkdir output
mkdir data

Prepare data

data should be organized as follows:

data/
    |->imagenet_weights/res101.ckpt
    |->MSCOCO
    |    |->odformat
    |    |->instances_xxx.json
    |    |train2014
    |    |val2014

Download res101 basemodel:

wget -v http://download.tensorflow.org/models/resnet_v1_101_2016_08_28.tar.gz
tar -xzvf resnet_v1_101_2016_08_28.tar.gz
mv resnet_v1_101.ckpt res101.ckpt

We transfer instances_xxx.json to odformat(object detection format), each line in odformat is an annotation(json) for one image. Our transformed odformat is shared in GoogleDrive odformat.zip .

Testing

  1. Using -d to assign gpu_id for testing. (e.g. -d 0,1,2,3 or -d 0-3 )
  2. Using -s to visualize the results.
  3. Using '-se' to specify start_epoch for testing.

We share our experiments output(logs) folder in GoogleDrive. Download it and place it to ${lighthead_ROOT}, then test our release model.

e.g.

cd experiments/lizeming/light_head_rcnn.ori_res101.coco.ps_roialign
python3 test.py -d 0-7 -se 26

Training

We provide common used train.py in tools, which can be linked to experiments folder.

e.g.

cd experiments/lizeming/light_head_rcnn.ori_res101.coco.ps_roialign
python3 config.py -tool
cp tools/train.py .
python3 train.py -d 0-7

Features

This repo is designed be fast and simple for research. There are still some can be improved: anchor_target and proposal_target layer are tf.py_func, which means it will run on cpu.

Disclaimer

This is an implementation for Light-Head R-CNN, it is worth noting that:

  • The original implementation is based on our internal Platform used in Megvii. There are slight differences in the final accuracy and running time due to the plenty details in platform switch.
  • The code is tested on a server with 8 Pascal Titian XP gpu, 188.00 GB memory, and 40 core cpu.
  • We rewrite a faster nms in our inner platform, while hear we use tf.nms instead.

Citing Light-Head R-CNN

If you find Light-Head R-CNN is useful in your research, pls consider citing:

@article{li2017light,
  title={Light-Head R-CNN: In Defense of Two-Stage Object Detector},
  author={Li, Zeming and Peng, Chao and Yu, Gang and Zhang, Xiangyu and Deng, Yangdong and Sun, Jian},
  journal={arXiv preprint arXiv:1711.07264},
  year={2017}
}

FAQ

  • fatal error: cuda/cuda_config.h: No such file or directory

First, find where is cuda_config.h.

e.g.

find /usr/local/lib/ | grep cuda_config.h

then export your cpath, like:

export CPATH=$CPATH:/usr/local/lib/python3.5/dist-packages/external/local_config_cuda/cuda/
Owner
jemmy li
jemmy li
Automatically align face images 🙃→🙂. Can also do windowing and warping.

Automatic Face Alignment (AFA) Carl M. Gaspar & Oliver G.B. Garrod You have lots of photos of faces like this: But you want to line up all of the face

Carl Michael Gaspar 15 Dec 12, 2022
PyTorch implementation of Deformable Convolution

PyTorch implementation of Deformable Convolution !!!Warning: There is some issues in this implementation and this repo is not maintained any more, ple

Wei Ouyang 893 Dec 18, 2022
Learning Spatio-Temporal Transformer for Visual Tracking

STARK The official implementation of the paper Learning Spatio-Temporal Transformer for Visual Tracking Hiring research interns for visual transformer

Multimedia Research 484 Dec 29, 2022
A modified version of DeepMind's Alphafold2 to divide CPU part (MSA and template searching) and GPU part (prediction model)

ParallelFold Author: Bozitao Zhong This is a modified version of DeepMind's Alphafold2 to divide CPU part (MSA and template searching) and GPU part (p

Bozitao Zhong 77 Dec 22, 2022
Hierarchical Memory Matching Network for Video Object Segmentation (ICCV 2021)

Hierarchical Memory Matching Network for Video Object Segmentation Hongje Seong, Seoung Wug Oh, Joon-Young Lee, Seongwon Lee, Suhyeon Lee, Euntai Kim

Hongje Seong 72 Dec 14, 2022
Equivariant Imaging: Learning Beyond the Range Space

[Project] Equivariant Imaging: Learning Beyond the Range Space Project about the

Georges Le Bellier 3 Feb 06, 2022
This repo is customed for VisDrone.

Object Detection for VisDrone(无人机航拍图像目标检测) My environment 1、Windows10 (Linux available) 2、tensorflow = 1.12.0 3、python3.6 (anaconda) 4、cv2 5、ensemble

53 Jul 17, 2022
Information-Theoretic Multi-Objective Bayesian Optimization with Continuous Approximations

Information-Theoretic Multi-Objective Bayesian Optimization with Continuous Approximations Requirements The code is implemented in Python and requires

1 Nov 03, 2021
Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".

nvdiffrec Joint optimization of topology, materials and lighting from multi-view image observations as described in the paper Extracting Triangular 3D

NVIDIA Research Projects 1.4k Jan 01, 2023
A tool to analyze leveraged liquidity mining and find optimal option combination for hedging.

LP-Option-Hedging Description A Python program to analyze leveraged liquidity farming/mining and find the optimal option combination for hedging imper

Aureliano 18 Dec 19, 2022
StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation

StyleSpace Analysis: Disentangled Controls for StyleGAN Image Generation Demo video: CVPR 2021 Oral: Single Channel Manipulation: Localized or attribu

Zongze Wu 267 Dec 30, 2022
QuALITY: Question Answering with Long Input Texts, Yes!

QuALITY: Question Answering with Long Input Texts, Yes! Authors: Richard Yuanzhe Pang,* Alicia Parrish,* Nitish Joshi,* Nikita Nangia, Jason Phang, An

ML² AT CILVR 61 Jan 02, 2023
How to Predict Stock Prices Easily Demo

How-to-Predict-Stock-Prices-Easily-Demo How to Predict Stock Prices Easily - Intro to Deep Learning #7 by Siraj Raval on Youtube ##Overview This is th

Siraj Raval 752 Nov 16, 2022
Neural Tangent Generalization Attacks (NTGA)

Neural Tangent Generalization Attacks (NTGA) ICML 2021 Video | Paper | Quickstart | Results | Unlearnable Datasets | Competitions | Citation Overview

Chia-Hung Yuan 34 Nov 25, 2022
This is the official implementation of 3D-CVF: Generating Joint Camera and LiDAR Features Using Cross-View Spatial Feature Fusion for 3D Object Detection, built on SECOND.

3D-CVF This is the official implementation of 3D-CVF: Generating Joint Camera and LiDAR Features Using Cross-View Spatial Feature Fusion for 3D Object

YecheolKim 97 Dec 20, 2022
Pytorch implementation of Learning Rate Dropout.

Learning-Rate-Dropout Pytorch implementation of Learning Rate Dropout. Paper Link: https://arxiv.org/pdf/1912.00144.pdf Train ResNet-34 for Cifar10: r

42 Nov 25, 2022
A Comprehensive Study on Learning-Based PE Malware Family Classification Methods

A Comprehensive Study on Learning-Based PE Malware Family Classification Methods Datasets Because of copyright issues, both the MalwareBazaar dataset

8 Oct 21, 2022
Mining-the-Social-Web-3rd-Edition - The official online compendium for Mining the Social Web, 3rd Edition (O'Reilly, 2018)

Mining the Social Web, 3rd Edition The official code repository for Mining the Social Web, 3rd Edition (O'Reilly, 2019). The book is available from Am

Mikhail Klassen 838 Jan 01, 2023
Character Controllers using Motion VAEs

Character Controllers using Motion VAEs This repo is the codebase for the SIGGRAPH 2020 paper with the title above. Please find the paper and demo at

Electronic Arts 165 Jan 03, 2023
Implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hashing by Maximizing Bit Entropy

Deep Unsupervised Image Hashing by Maximizing Bit Entropy This is the PyTorch implementation of accepted AAAI 2021 paper: Deep Unsupervised Image Hash

62 Dec 30, 2022