Giter Site home page Giter Site logo

repulsion_loss's Introduction

Repulsion_Loss

Pytorch implementation of Repulsion Loss as described in Repulsion Loss: Detecting Pedestrians in a Crowd. The baseline is RetinaNet followed by this repo.

Requirements

  • Python3
  • Pytorch0.4
  • torchvision
  • tensorboardX

Installation

Install packages.

sudo apt-get install tk-dev python-tk
pip install cffi
pip install cython
pip install pandas
pip install tensorboardX

Build NMS.

cd Repulsion_Loss/lib
sh build.sh

Create folders.

cd Repulsion_Loss
mkdir ckpt mAP_txt summary weight

Datasets

This repo is built for human detection. The popular annotation format for human detection(or pedestrian detection) includes bounding boxes of both human and ignore regions such as Citypersons and Crowdhuman. You should write them in CSV or TXT files.

Annotations format

Three examples are as follows:

$image_path/img_1.jpg x1 y1 x2 y2 person
$image_path/img_1.jpg x1 y1 x2 y2 ignore
$image_path/img_2.jpg . . . . .

Images with more than one bounding box should use one row per box. Labels that we often use are 'person' or 'ignore'. When an image does not contain any bounding box, set them '.'.

Label encoding file

A TXT file (classes.txt) is needed to map label to ID. Each line means one label name and its ID. One example is as follows:

person 0

Pretrained Model

We use resnet18, 34, 50, 101, 152 as the backbone. You should download them and put them to /weight.

Training

python train.py --csv_train <$path/train.txt> --csv_val <$path/val.txt> --csv_classes <$path/classes.txt> --depth <50> --pretrained resnet50-19c8e357.pth --model_name <model name to save>

Visualization Result

Baseline

img1

Add repulsion loss

img2

Reference

repulsion_loss's People

Contributors

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