Git Product home page Git Product logo

eod's Introduction

EOD

image

Easy and Efficient Object Detector

EOD (Easy and Efficient Object Detection) is a general object detection model production framework. It aim on provide two key feature about Object Detection:

  • Efficient: we will focus on training VERY HIGH ACCURARY single-shot detection model, and model compression (quantization/sparsity) will be well addressed.
  • Easy: easy to use, easy to add new features(backbone/head/neck), easy to deploy.
  • Large-Scale Dataset Training Detail
  • Equalized Focal Loss for Dense Long-Tailed Object Detection EFL
  • Improve-YOLOX YOLOX-RET
  • Quantization Aware Training(QAT) interface based on MQBench.

The master branch works with PyTorch 1.8.1. Due to the pytorch version, it can not well support the 30 series graphics card hardware.

Install

pip install -r requirments

Get Started

Some example scripts are supported in scripts/.

Export Module

Export eod into ROOT and PYTHONPATH

ROOT=../../
export ROOT=$ROOT
export PYTHONPATH=$ROOT:$PYTHONPATH

Train

Step1: edit meta_file and image_dir of image_reader:

dataset:
  type: coco # dataset type
    kwargs:
      source: train
      meta_file: coco/annotations/instances_train2017.json 
      image_reader:
        type: fs_opencv
        kwargs:
          image_dir: coco/train2017
          color_mode: BGR

Step2: train

python -m eod train --config configs/det/yolox/yolox_tiny.yaml --nm 1 --ng 8 --launch pytorch 2>&1 | tee log.train
  • --config: yamls in configs/
  • --nm: machine number
  • --ng: gpu number for each machine
  • --launch: slurm or pytorch

Step3: fp16, add fp16 setting into runtime config

runtime:
    fp16: True

Eval

Step1: edit config of evaluating dataset

Step2: test

python -m eod train -e --config configs/det/yolox/yolox_tiny.yaml --nm 1 --ng 1 --launch pytorch 2>&1 | tee log.test

Demo

Step1: add visualizer config in yaml

inference:
  visualizer:
    type: plt
    kwargs:
      class_names: ['__background__', 'person'] # class names
      thresh: 0.5

Step2: inference

python -m eod inference --config configs/det/yolox/yolox_tiny.yaml --ckpt ckpt_tiny.pth -i imgs -v vis_dir
  • --ckpt: model for inferencing
  • -i: images directory or single image
  • -v: directory saving visualization results

Mpirun mode

EOD supports mpirun mode to launch task, MPI needs to be installed firstly

# download mpich
wget https://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz # other versions: https://www.mpich.org/static/downloads/

tar -zxvf mpich-3.2.1.tar.gz
cd mpich-3.2.1
./configure  --prefix=/usr/local/mpich-3.2.1
make && make install

Launch task

mpirun -np 8 python -m eod train --config configs/det/yolox/yolox_tiny.yaml --launch mpi 2>&1 | tee log.train
  • Add mpirun -np x; x indicates number of processes
  • Mpirun is convenient to debug with pdb
  • --launch: mpi

Custom Example

Benckmark

Quick Run

Tutorials

Useful Tools

References

Acknowledgments

Thanks to all past contributors, especially opcoder,

eod's People

Contributors

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