Git Product home page Git Product logo

cls2det's Introduction

Introduction

cls2det is an object detection tool based on PyTorch. Unlike most popular object detection algorithms, cls2det implement object detection with only a classifier pre-trained on ImageNet dataset.

Benchmark

Evaluation on class "dog" on PASCAL VOC 2012 dataset:

AP50 AP40 AP30
train 0.229 0.367 0.507
val 0.235 0.382 0.510
AR50 AR40 AR30
train 0.406 0.426 0.636
val 0.394 0.533 0.631
  • Achieve good visual results by only using a classifier without any training process
  • Although the metrics are not good as SOTA, the location of the bounding box prediction is highly correlated with the ground truth from the perspective of the intuitive feeling. In some cases, e.g. when the size of the bounding box prediction does not need to be very accurate, this tool is of great significance.

example

Requirements

  • Linux
  • Python 3.6+
  • PyTorch 1.1.0 or higher
  • CUDA 9.0 or higher

Install

a. Create a conda virtual environment and activate it.

conda create -n cls2det python=3.6 -y
conda activate cls2det

b. Install PyTorch and torchvision following the official instructions, e.g.,

conda install pytorch torchvision -c pytorch

c. Clone the cls2det repository.

git clone https://github.com/Media-Smart/cls2det.git
cd cls2det

d. Install dependencies.

pip install -r requirements.txt

Prepare data

Download Pascal VOC 2012 and put the dataset into cls2det/data directory, the structure of data directory will look like as follows:

  data
    ├── VOC2012
    │     ├── Annotations
    │     ├── ImageSets
    │     │       └──── Main
    │     └── JPEGImages
    ├── eval
    ├── result
    └── imagenet.txt

Demo

a. Config

Modify some configuration accordingly in the config file like configs/detection.py

b. Run

python tools/demo.py --config configs/cls2det_resnet18.py --img_path <path to image>

Rendered image with bounding box prediction and confidence will be stored in data/result.

Eval

a. Config

Modify some configuration accordingly in the config file like configs/detection.py

b. Run

python tools/eval.py --config configs/cls2det_resnet18.py

The evaluation report will be shown on terminal.

cls2det's People

Contributors

yuxinzou avatar media-smart avatar mileistone 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.