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
It's a powerful version of linebot

CTPS-FINAL Linbot-sever.py 主程式 Algorithm.py 推薦演算法,媒合餐廳端資料與顧客端資料 config.ini 儲存 channel-access-token、channel-secret 資料 Preface 生活在成大將近4年,我們每天的午餐時間看著形形色色

1 Oct 17, 2022
Predicting Semantic Map Representations from Images with Pyramid Occupancy Networks

This is the code associated with the paper Predicting Semantic Map Representations from Images with Pyramid Occupancy Networks, published at CVPR 2020.

Thomas Roddick 219 Dec 20, 2022
TEA: A Sequential Recommendation Framework via Temporally Evolving Aggregations

TEA: A Sequential Recommendation Framework via Temporally Evolving Aggregations Requirements python 3.6 torch 1.9 numpy 1.19 Quick Start The experimen

DMIRLAB 4 Oct 16, 2022
NLG evaluation via Statistical Measures of Similarity: BaryScore, DepthScore, InfoLM

NLG evaluation via Statistical Measures of Similarity: BaryScore, DepthScore, InfoLM Automatic Evaluation Metric described in the papers BaryScore (EM

Pierre Colombo 28 Dec 28, 2022
DetCo: Unsupervised Contrastive Learning for Object Detection

DetCo: Unsupervised Contrastive Learning for Object Detection arxiv link News Sparse RCNN+DetCo improves from 45.0 AP to 46.5 AP(+1.5) with 3x+ms trai

Enze Xie 234 Dec 18, 2022
Here we present the implementation in TensorFlow of our work about liver lesion segmentation accepted in the Machine Learning 4 Health Workshop

Detection-aided liver lesion segmentation Here we present the implementation in TensorFlow of our work about liver lesion segmentation accepted in the

Image Processing Group - BarcelonaTECH - UPC 96 Oct 26, 2022
A toolkit for Lagrangian-based constrained optimization in Pytorch

Cooper About Cooper is a toolkit for Lagrangian-based constrained optimization in Pytorch. This library aims to encourage and facilitate the study of

Cooper 34 Jan 01, 2023
SketchEdit: Mask-Free Local Image Manipulation with Partial Sketches

SketchEdit: Mask-Free Local Image Manipulation with Partial Sketches [Paper]  [Project Page]  [Interactive Demo]  [Supplementary Material]        Usag

215 Dec 25, 2022
PCAM: Product of Cross-Attention Matrices for Rigid Registration of Point Clouds

PCAM: Product of Cross-Attention Matrices for Rigid Registration of Point Clouds PCAM: Product of Cross-Attention Matrices for Rigid Registration of P

valeo.ai 24 May 31, 2022
A Simple Framwork for CV Pre-training Model (SOCO, VirTex, BEiT)

A Simple Framwork for CV Pre-training Model (SOCO, VirTex, BEiT)

Sense-GVT 14 Jul 07, 2022
code for paper"A High-precision Semantic Segmentation Method Combining Adversarial Learning and Attention Mechanism"

PyTorch implementation of UAGAN(U-net Attention Generative Adversarial Networks) This repository contains the source code for the paper "A High-precis

Tong 8 Apr 25, 2022
Direct LiDAR Odometry: Fast Localization with Dense Point Clouds

Direct LiDAR Odometry: Fast Localization with Dense Point Clouds DLO is a lightweight and computationally-efficient frontend LiDAR odometry solution w

VECTR at UCLA 369 Dec 30, 2022
A Player for Kanye West's Stem Player. Sort of an emulator.

Stem Player Player Stem Player Player Usage Download the latest release here Optional: install ffmpeg, instructions here NOTE: DOES NOT ENABLE DOWNLOA

119 Dec 28, 2022
A face dataset generator with out-of-focus blur detection and dynamic interval adjustment.

A face dataset generator with out-of-focus blur detection and dynamic interval adjustment.

Yutian Liu 2 Jan 29, 2022
Code and data form the paper BERT Got a Date: Introducing Transformers to Temporal Tagging

BERT Got a Date: Introducing Transformers to Temporal Tagging Satya Almasian*, Dennis Aumiller*, and Michael Gertz Heidelberg University Contact us vi

54 Dec 04, 2022
Vision transformers (ViTs) have found only limited practical use in processing images

CXV Convolutional Xformers for Vision Vision transformers (ViTs) have found only limited practical use in processing images, in spite of their state-o

Cloudwalker 23 Sep 10, 2022
Neural Scene Flow Fields for Space-Time View Synthesis of Dynamic Scenes

Neural Scene Flow Fields PyTorch implementation of paper "Neural Scene Flow Fields for Space-Time View Synthesis of Dynamic Scenes", CVPR 2021 [Projec

Zhengqi Li 583 Dec 30, 2022
KoCLIP: Korean port of OpenAI CLIP, in Flax

KoCLIP This repository contains code for KoCLIP, a Korean port of OpenAI's CLIP. This project was conducted as part of Hugging Face's Flax/JAX communi

Jake Tae 100 Jan 02, 2023
MERLOT: Multimodal Neural Script Knowledge Models

merlot MERLOT: Multimodal Neural Script Knowledge Models MERLOT is a model for learning what we are calling "neural script knowledge" -- representatio

Rowan Zellers 190 Dec 22, 2022
The codes I made while I practiced various TensorFlow examples

TensorFlow_Exercises The codes I made while I practiced various TensorFlow examples About the codes I didn't create these codes by myself, but re-crea

Terry Taewoong Um 614 Dec 08, 2022