This project is a kind of implementation of EfficientDet using mmdetection.
It is based on the
- the paper EfficientDet: Scalable and Efficient Object Detection
- official TensorFlow implementation
- Pytorch implementation of EfficientNet
Variant | mAP(val2017) | Params | FLOPs | mAP(val2017) in paper | Params in paper | FLOPs in paper |
---|---|---|---|---|---|---|
D0 | 32.02 | 3.87M | 2.55B | 33.5 | 3.9M | 2.5B |
D1 | 37.78 | 6.62M | 6.12B | 39.1 | 6.6M | 6.1B |
D2 | —— | 8.09M | 11B | 42.5 | 8.1M | 11B |
D3 | —— | 12.02M | 24.88B | 45.9 | 12M | 25B |
D4 | —— | 20.7M | 55.13B | 49.0 | 21M | 55B |
D5 | —— | 33.63M | 135.31B | 50.5 | 34M | 135B |
D6 | —— | —— | —— | 51.3 | 52M | 226B |
-
Install mmdetection
This implementation is based on mmdetection(v1.1.0+8732ed9). Please refer to INSTALL.md for installation and dataset preparation.
-
Copy the codes to mmdetection directory
cp -r mmdet/ ${MMDETECTION_PATH}/ cp -r configs/ ${MMDETECTION_PATH}/
-
Prepare data
The directories should be arranged like this:
> mmdetection > ├── mmdet > ├── tools > ├── configs > ├── data > │ ├── coco > │ │ ├── annotations > │ │ ├── train2017 > │ │ ├── val2017 > │ │ ├── test2017
-
Train D0 with 4 GPUs
CONFIG_FILE=configs/efficientdet/efficientdet_d0_4gpu.py ./ tools/dist_train.py ${CONFIG_FILE} 4
-
Calculate parameters and flops
python tools/get_flops.py ${CONFIG_FILE} --shape $SIZE $SIZE
-
Test
python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} --out ${OUTPUT_FILE} --eval bbox
More usages can reference mmdetection documentation.
- [2020-04-27] Update results and add SyncBN in backbone.
- [2020-04-20] Fix some bug in bifpn and use separate BN in head.
- [2020-04-17] Add efficientdet-d0 training config.
- [2020-04-16] Add efficientnet.py and retina_sepconv_head.py.
- [2020-04-06] Create this repository.
- For small reason, I can't release the model. But you can reproduce the result easily using the config file that I provide.
- I find the training procedure of EfficientDet is unstable and there is a small chance that results can be 3% mAP lower.
- The number of bifpn in the latest version of paper is a little different from the first version, but the parameters and flops are the same. I use the structure in the latest version of paper.
- Training from scratch is a time-consuming task. For exmaple, it took me 4 days to train D0 from scratch using 4 GTX TiTAN V GPUs.