关于作者
October 8, 2021 · View on GitHub
数据文件准备
数据集已挂载至aistudio项目中,如果需要本地训练可以从这里下载数据集,项目已同步至AIStudio
工程目录大致如下,可根据实际情况修改
home/aistudio
|-- coco(dataset)
| |-- annotions
| |-- instances_train2017.json
| |-- instances_val2017.json
| |-- train2017
| |-- val2017
| |-- test2017
|-- EfficientDet(repo)
训练
单卡训练
python train.py -c 0 -p coco --batch_size 8 --lr 1e-5
-c X表明efficientdet-dX
验证
确保已安装pycocotools和webcolors
pip install pycocotools webcolors
python coco_eval.py -p coco -c 0
你需要将权重文件下载至weights文件夹下,或者使用-w手动指定权重路径
验证结果如下所示
所有完整验证结果可在EfficientDet/benchmark/coco_eval_result.txt下查看
| coefficient | pth_download | GPU Mem(MB) | mAP 0.5:0.95(this repo) | mAP 0.5:0.95(official) |
|---|---|---|---|---|
| D0 | efficientdet-d0.pdparams | 1049 | 33.1 | 33.8 |
| D1 | efficientdet-d1.pdparams | 1159 | 38.8 | 39.6 |
| D2 | efficientdet-d2.pdparams | 1321 | 42.1 | 43.0 |
| D3 | efficientdet-d3.pdparams | 1647 | 45.6 | 45.8 |
| D4 | efficientdet-d4.pdparams | 1903 | 48.5 | 49.4 |
| D5 | efficientdet-d5.pdparams | 2255 | 50.0 | 50.7 |
| D6 | efficientdet-d6.pdparams | 2985 | 50.7 | 51.7 |
| D7 | efficientdet-d7.pdparams | 3819 | 52.6 | 53.7 |
| D7X | efficientdet-d8.pdparams | 3819 | 53.8 | 55.1 |
推理
python efficientdet_test.py
注意到你需要手动更改中第17行compound_coef = 8来指定efficientdet-dX
部分模型推理结果如下所示
原始图像 ; 官方efficientdet-d0预测图像
本项目efficientdet-d0预测图像 本项目efficientdet-d8预测图像
python efficientdet_test_videos.py
以efficientdet-d0为例,测试效果如下

TODO
- 多卡训练(Coming soon)
- EfficientNet Pretrained Weights(Coming soon)
GitHub地址
关于作者
| 姓名 | 郭权浩 |
|---|---|
| 学校 | 电子科技大学研2020级 |
| 研究方向 | 计算机视觉 |
| BLOG主页 | DeepHao的 blog 主页 |
| GitHub主页 | DeepHao的 github 主页 |
| 如有错误,请及时留言纠正,非常蟹蟹! | |
| 后续会有更多论文复现系列推出,欢迎大家有问题留言交流学习,共同进步成长! |