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.
python demo.py --weight ./checkpoint_VOC_efficientdet-d1_97.pth --threshold 0.6 --iou_threshold 0.5 --cam --score
- Recent Update
- Benchmarking
- Installation
- Installation
- Prerequisites
- Datasets
- Train
- Evaluate
- Performance
- Demo
- Future Work
- Reference
- [7/12/2019] Support Efficient-D0, Efficient-D1, Efficient-D2, Efficient-D3, Efficient-D4,... . Support change gradient accumulation steps, AdamW.
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 | #GPUs | batch size | lr | lr_decay | max_epoch | time/epoch | mem/GPU | mAP |
---|---|---|---|---|---|---|---|---|
EfficientDet-D1(with Weight) | 2 | 32 | 1e-4 | 30 | 100 | 20.min | 20100 MB | updating |
- 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.
- Python 3.6+
- PyTorch 1.3+
- Torchvision 0.4.0+ (We need high version because Torchvision support nms now.)
- requirements.txt
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.
PASCAL VOC: Visual Object Classes
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh datasets/scripts/VOC2007.sh
sh datasets/scripts/VOC2012.sh
Microsoft COCO: Common Objects in Context
# specify a directory for dataset to be downloaded into, else default is ~/data/
sh datasets/scripts/COCO2014.sh
Note: Read dataset COCO will support soon.
- 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 --model_name effcientdet-d0 # Example
- With VOC Dataset:
python train.py --dataset_root /root/data/VOCdevkit/ --model_name effcientdet-d0 # Example
- With COCO Dataset: Support soon
To evaluate a trained network:
python eval.py
python demo.py --weights ./checkpoint_VOC_efficientdet-d1_97.pth --threshold 0.5
Output:
You can use a webcam in a real-time demo by running:
python demo.py --weight ./checkpoint_VOC_efficientdet-d1_97.pth --threshold 0.6 --iou_threshold 0.5 --cam --score
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
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.
- tanmingxing, rpang, qvl, et al. "EfficientDet: Scalable and Efficient Object Detection." EfficientDet.
- A list of other great EfficientDet ports that were sources of inspiration:
@article{efficientdetpytoan,
Author = {Toan Dao Minh},
Title = {A Pytorch Implementation of EfficientDet Object Detection},
Journal = {github.com/toandaominh1997/EfficientDet.Pytorch},
Year = {2019}
}