Git Product home page Git Product logo

redet's Introduction

Boosting Dense Long-Tailed Object Detection from Data-Centric View

Pytorch implementation of REDet, ACCV 2022

Getting start

1. Download pretrained models.

'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth',
'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth',

After downloading, please put it into "pretrained/"

2. Prepare Dataset (LVIS v1)

Then download the images and annotations from the official website of LVIS.

Finally the file structure of folder lvis will be like this:

$lvis
  ├── annotations
  │   ├── lvis_v1_val.json
  │   ├── lvis_v1_train.json
  ├── train2017
  │   ├── 000000004134.png
  │   ├── 000000031817.png
  │   ├── ......
  ├── val2017
  ├── test2017

3. Prepare the Environment

# create environment
conda create --name REDet python=3.7
conda activate REDet

# install pytorch
conda install pytorch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 cudatoolkit=10.1

edit easy_setup.sh

#!/bin/bash

export PATH=/your/path/to/gcc-5.3.0/bin/:$PATH # gcc path
export LD_LIBRARY_PATH=/your/path/to/gmp-4.3.2/lib/:/your/path/to/mpfr-2.4.2/lib/:/your/path/to/mpc-0.8.1/lib/:$LD_LIBRARY_PATH # lib path
export TORCH_CUDA_ARCH_LIST='3.5;5.0+PTX;6.0;7.0' # cuda list

python setup.py build_ext -i

Then:

# setup
./easy_setup.sh

# pip install requirements.txt
pip install -r requirements.txt

# install other packages
pip uninstall protobuf
pip install protobuf==3.20.1
pip install pyyaml
pip install scikit-image

4. Run the code

We provide training scripts experiments/test.sh as:

#!/bin/bash

ROOT=../../
T=`date +%m%d%H%M`
export ROOT=$ROOT
cfg=configs/Table1_r50_REDet.yaml
export PYTHONPATH=$ROOT:$PYTHONPATH
python -m up train \
  --nm=1 \
  --ng=1 \
  --launch=pytorch \
  --config=$cfg \
  2>&1 | tee experiments/train_log/log.train.$T.$(basename $cfg) 

We provide testing scripts experiments/test.sh as:

#!/bin/bash

ROOT=../../
T=`date +%m%d%H%M`
export ROOT=$ROOT
cfg=configs/Table1_r50_REDet.yaml
export PYTHONPATH=$ROOT:$PYTHONPATH
python -m up train \
  -e \
  --nm=1 \
  --ng=1 \
  --launch=pytorch \
  --config=$cfg \
  2>&1 | tee experiments/test_log/log.test.$T.$(basename $cfg) 

redet's People

Contributors

rookiexwc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

chen-si-jia

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.