• Stars
    star
    1,439
  • Rank 32,712 (Top 0.7 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch

EfficientDet: Scalable and Efficient Object Detection, in PyTorch

A PyTorch implementation of EfficientDet from the 2019 paper by Mingxing Tan Ruoming Pang Quoc V. Le Google Research, Brain Team. The official and original: comming soon.

Fun with Demo:

python demo.py --weight ./checkpoint_VOC_efficientdet-d1_97.pth --threshold 0.6 --iou_threshold 0.5 --cam --score

Table of Contents

       

Recent Update

  • [06/01/2020] Support both DistributedDataParallel and DataParallel, change augmentation, eval_voc
  • [17/12/2019] Add Fast normalized fusion, Augmentation with Ratio, Change RetinaHead, Fix Support EfficientDet-D0->D7
  • [7/12/2019] Support EfficientDet-D0, EfficientDet-D1, EfficientDet-D2, EfficientDet-D3, EfficientDet-D4,... . Support change gradient accumulation steps, AdamW.

Benchmarking

We benchmark our code thoroughly on three datasets: pascal voc and coco, using family efficientnet different network architectures: EfficientDet-D0->7. Below are the results:

1). PASCAL VOC 2007 (Train/Test: 07trainval/07test, scale=600, ROI Align)

model   mAP
[EfficientDet-D0(with Weight)](https://drive.google.com/file/d/1r7MAyBfG5OK_9F_cU8yActUWxTHOuOpL/view?usp=sharing 62.16

Installation

  • Install PyTorch by selecting your environment on the website and running the appropriate command.
  • Clone this repository and install package prerequisites below.
  • Then download the dataset by following the instructions below.
  • Note: For training, we currently support VOC and COCO, and aim to add ImageNet support soon.

prerequisites

  • Python 3.6+
  • PyTorch 1.3+
  • Torchvision 0.4.0+ (We need high version because Torchvision support nms now.)
  • requirements.txt

Datasets

To make things easy, we provide bash scripts to handle the dataset downloads and setup for you. We also provide simple dataset loaders that inherit torch.utils.data.Dataset, making them fully compatible with the torchvision.datasets API.

VOC Dataset

PASCAL VOC: Visual Object Classes

Download VOC2007 + VOC2012 trainval & test
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh datasets/scripts/VOC2007.sh
sh datasets/scripts/VOC2012.sh

COCO

Microsoft COCO: Common Objects in Context

Download COCO 2017
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh datasets/scripts/COCO2017.sh

Training EfficientDet

  • To train EfficientDet using the train script simply specify the parameters listed in train.py as a flag or manually change them.
python train.py --network effcientdet-d0  # Example
  • With VOC Dataset:
# DataParallel
python train.py --dataset VOC --dataset_root /root/data/VOCdevkit/ --network effcientdet-d0 --batch_size 32 
# DistributedDataParallel with backend nccl
python train.py --dataset VOC --dataset_root /root/data/VOCdevkit/ --network effcientdet-d0 --batch_size 32 --multiprocessing-distributed
  • With COCO Dataset:
# DataParallel
python train.py --dataset COCO --dataset_root ~/data/coco/ --network effcientdet-d0 --batch_size 32
# DistributedDataParallel with backend nccl
python train.py --dataset COCO --dataset_root ~/data/coco/ --network effcientdet-d0 --batch_size 32 --multiprocessing-distributed

Evaluation

To evaluate a trained network:

  • With VOC Dataset:
    python eval_voc.py --dataset_root ~/data/VOCdevkit --weight ./checkpoint_VOC_efficientdet-d0_261.pth
  • With COCO Dataset comming soon.

Demo

python demo.py --threshold 0.5 --iou_threshold 0.5 --score --weight checkpoint_VOC_efficientdet-d1_34.pth --file_name demo.png

Output:

Webcam Demo

You can use a webcam in a real-time demo by running:

python demo.py --threshold 0.5 --iou_threshold 0.5 --cam --score --weight checkpoint_VOC_efficientdet-d1_34.pth

Performance

TODO

We have accumulated the following to-do list, which we hope to complete in the near future

  • Still to come:
    • EfficientDet-[D0-7]
    • GPU-Parallel
    • NMS
    • Soft-NMS
    • Pretrained model
    • Demo
    • Model zoo
    • TorchScript
    • Mobile
    • C++ Onnx

Authors

Note: Unfortunately, this is just a hobby of ours and not a full-time job, so we'll do our best to keep things up to date, but no guarantees. That being said, thanks to everyone for your continued help and feedback as it is really appreciated. We will try to address everything as soon as possible.

References

Citation

@article{efficientdetpytoan,
    Author = {Toan Dao Minh},
    Title = {A Pytorch Implementation of EfficientDet Object Detection},
    Journal = {github.com/toandaominh1997/EfficientDet.Pytorch},
    Year = {2019}
}

More Repositories

1

Steel-Defect-Detection

Python
14
star
2

grow

Monorepo to boost myself
Jupyter Notebook
7
star
3

dotfiles

A set of vim, tmux and zsh configuration files.
Lua
6
star
4

pytoan

Python
5
star
5

dataset-for-beginners

Python
4
star
6

TrafficSignDetection

Jupyter Notebook
4
star
7

Deep_Learning

Jupyter Notebook
3
star
8

Stocks

Jupyter Notebook
3
star
9

Data_Mining

2
star
10

Machine-Learning

Learning Machine Learning
Jupyter Notebook
2
star
11

toandaominh1997

Config files for my GitHub profile.
2
star
12

GlobalWheatDetection

Python
2
star
13

argocd

2
star
14

Competitive_Programming

competitive programming
C++
2
star
15

Kaggle

Competitive on Kaggle
Jupyter Notebook
2
star
16

pipelineservice

https://pipelineservice.readthedocs.io
Python
2
star
17

Train_Model

Jupyter Notebook
1
star
18

awesome-rl

1
star
19

objflow

Python
1
star
20

learnrust

Rust
1
star
21

Online_Judge

Java
1
star
22

OpenCV

1
star
23

Interview_Test

Jupyter Notebook
1
star
24

Developing_Android_Apps

1
star
25

mlgame

1
star
26

Flutter-LoGy

Logy is shopping app
Dart
1
star
27

TensorFlow_Examples

1
star
28

FPT_MultiThreading

Java
1
star
29

Hand-Recognition

Python
1
star
30

acmicpc_vietnam

C++
1
star
31

solidity

1
star
32

Books

The Books should read for 2018.
1
star
33

FlutterDev

Dart
1
star
34

Python

Python tutorial
Jupyter Notebook
1
star
35

OCR_Proposal

TeX
1
star
36

PDF_To_Markdown

1
star
37

warp_ctc_pytorch_1.0.1

Cuda
1
star
38

freeCodeCampChallenge

Learn to Free Code Camp
1
star
39

test-circleci

Python
1
star
40

Midterm_Exercise_Digital_Image_Processing

1
star
41

heroku

Python
1
star
42

Jenkins

Jenkins Tutorial
C++
1
star
43

FinalProject_MNIST_With_SVM

Đồ án vấn đáp môn Máy học Phân lớp ảnh chữ số viết tay bằng SVM
Jupyter Notebook
1
star
44

bigkizd.github.io

1
star
45

Web_developer

HTML
1
star
46

OCR-Proposal

Proposal for OCR
TeX
1
star