{"id":15109734,"url":"https://github.com/toandaominh1997/efficientdet.pytorch","last_synced_at":"2025-08-14T09:31:38.987Z","repository":{"id":48926289,"uuid":"225027908","full_name":"toandaominh1997/EfficientDet.Pytorch","owner":"toandaominh1997","description":"Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch","archived":true,"fork":false,"pushed_at":"2021-07-05T10:56:17.000Z","size":11478,"stargazers_count":1443,"open_issues_count":116,"forks_count":305,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-12-15T12:02:29.527Z","etag":null,"topics":["coco","computer-vision","demo","detection","efficientdet-d0","efficientnet","focalloss","multibox","nms","object-detection","pascal-voc","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toandaominh1997.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-30T14:57:27.000Z","updated_at":"2024-12-11T00:58:27.000Z","dependencies_parsed_at":"2022-09-13T09:02:29.205Z","dependency_job_id":null,"html_url":"https://github.com/toandaominh1997/EfficientDet.Pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toandaominh1997%2FEfficientDet.Pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toandaominh1997%2FEfficientDet.Pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toandaominh1997%2FEfficientDet.Pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toandaominh1997%2FEfficientDet.Pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toandaominh1997","download_url":"https://codeload.github.com/toandaominh1997/EfficientDet.Pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229816006,"owners_count":18128512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coco","computer-vision","demo","detection","efficientdet-d0","efficientnet","focalloss","multibox","nms","object-detection","pascal-voc","pytorch"],"created_at":"2024-09-25T23:22:50.268Z","updated_at":"2024-12-15T12:04:49.003Z","avatar_url":"https://github.com/toandaominh1997.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EfficientDet: Scalable and Efficient Object Detection, in PyTorch\nA [PyTorch](http://pytorch.org/) implementation of [EfficientDet](https://arxiv.org/abs/1911.09070) from the 2019 paper by Mingxing Tan Ruoming Pang Quoc V. Le\nGoogle Research, Brain Team.  The official and original: comming soon.\n\n\n\u003cimg src= \"./docs/arch.png\"/\u003e\n\n# Fun with Demo:\n```Shell\npython demo.py --weight ./checkpoint_VOC_efficientdet-d1_97.pth --threshold 0.6 --iou_threshold 0.5 --cam --score\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"docs/pytoan.gif\"\u003e\n\u003c/p\u003e\n\n\n### Table of Contents\n- \u003ca href='#recent-update'\u003eRecent Update\u003c/a\u003e\n- \u003ca href='#benchmarking'\u003eBenchmarking\u003c/a\u003e\n- \u003ca href='#installation'\u003eInstallation\u003c/a\u003e\n- \u003ca href='#installation'\u003eInstallation\u003c/a\u003e\n- \u003ca href='#prerequisites'\u003ePrerequisites\u003c/a\u003e\n- \u003ca href='#datasets'\u003eDatasets\u003c/a\u003e\n- \u003ca href='#training-efficientdet'\u003eTrain\u003c/a\u003e\n- \u003ca href='#evaluation'\u003eEvaluate\u003c/a\u003e\n- \u003ca href='#performance'\u003ePerformance\u003c/a\u003e\n- \u003ca href='#demo'\u003eDemo\u003c/a\u003e\n- \u003ca href='#todo'\u003eFuture Work\u003c/a\u003e\n- \u003ca href='#references'\u003eReference\u003c/a\u003e\n\n\u0026nbsp;\n\u0026nbsp;\n\u0026nbsp;\n\u0026nbsp;\n\n## Recent Update\n - [06/01/2020] Support both DistributedDataParallel and DataParallel, change augmentation, eval_voc\n - [17/12/2019] Add Fast normalized fusion, Augmentation with Ratio, Change RetinaHead, Fix Support EfficientDet-D0-\u003eD7\n - [7/12/2019] Support EfficientDet-D0, EfficientDet-D1, EfficientDet-D2, EfficientDet-D3, EfficientDet-D4,... . Support change gradient accumulation steps, AdamW.\n## Benchmarking\n\nWe benchmark our code thoroughly on three datasets: pascal voc and coco, using family efficientnet different network architectures: EfficientDet-D0-\u003e7. Below are the results:\n\n1). PASCAL VOC 2007 (Train/Test: 07trainval/07test, scale=600, ROI Align)\n\nmodel    | mAP |\n---------|--------|\n[EfficientDet-D0(with Weight)](https://drive.google.com/file/d/1r7MAyBfG5OK_9F_cU8yActUWxTHOuOpL/view?usp=sharing | 62.16\n\n\n## Installation\n- Install [PyTorch](http://pytorch.org/) by selecting your environment on the website and running the appropriate command.\n- Clone this repository and install package [prerequisites](#prerequisites) below.\n- Then download the dataset by following the [instructions](#datasets) below.\n- Note: For training, we currently support [VOC](http://host.robots.ox.ac.uk/pascal/VOC/) and [COCO](http://mscoco.org/), and aim to add [ImageNet](http://www.image-net.org/) support soon.\n\n### prerequisites\n\n* Python 3.6+\n* PyTorch 1.3+\n* Torchvision 0.4.0+ (**We need high version because Torchvision support nms now.**)\n* requirements.txt \n## Datasets\nTo 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](http://pytorch.org/docs/torchvision/datasets.html).\n\n### VOC Dataset\nPASCAL VOC: Visual Object Classes\n\n##### Download VOC2007 + VOC2012 trainval \u0026 test\n```Shell\n# specify a directory for dataset to be downloaded into, else default is ~/data/\nsh datasets/scripts/VOC2007.sh\nsh datasets/scripts/VOC2012.sh\n```\n\n### COCO\nMicrosoft COCO: Common Objects in Context\n\n##### Download COCO 2017\n```Shell\n# specify a directory for dataset to be downloaded into, else default is ~/data/\nsh datasets/scripts/COCO2017.sh\n```\n\n## Training EfficientDet\n\n- To train EfficientDet using the train script simply specify the parameters listed in `train.py` as a flag or manually change them.\n\n```Shell\npython train.py --network effcientdet-d0  # Example\n```\n\n  - With VOC Dataset:\n  ```Shell\n  # DataParallel\n  python train.py --dataset VOC --dataset_root /root/data/VOCdevkit/ --network effcientdet-d0 --batch_size 32 \n  # DistributedDataParallel with backend nccl\n  python train.py --dataset VOC --dataset_root /root/data/VOCdevkit/ --network effcientdet-d0 --batch_size 32 --multiprocessing-distributed\n  ```\n  - With COCO Dataset:\n  ```Shell\n  # DataParallel\n  python train.py --dataset COCO --dataset_root ~/data/coco/ --network effcientdet-d0 --batch_size 32\n  # DistributedDataParallel with backend nccl\n  python train.py --dataset COCO --dataset_root ~/data/coco/ --network effcientdet-d0 --batch_size 32 --multiprocessing-distributed\n  ```\n\n## Evaluation\nTo evaluate a trained network:\n - With VOC Dataset:\n    ```Shell\n    python eval_voc.py --dataset_root ~/data/VOCdevkit --weight ./checkpoint_VOC_efficientdet-d0_261.pth\n    ```\n- With COCO Dataset\ncomming soon.\n## Demo\n\n```Shell\npython demo.py --threshold 0.5 --iou_threshold 0.5 --score --weight checkpoint_VOC_efficientdet-d1_34.pth --file_name demo.png\n```\n\nOutput: \n\n\u003cp align=\"center\"\u003e\n\u003cimg src= \"./docs/demo.png\"\u003e\n\u003c/p\u003e\n\n## Webcam Demo\n\nYou can use a webcam in a real-time demo by running:\n```Shell\npython demo.py --threshold 0.5 --iou_threshold 0.5 --cam --score --weight checkpoint_VOC_efficientdet-d1_34.pth\n```\n\n## Performance\n\u003cimg src= \"./docs/compare.png\"/\u003e\n\n\n\n## TODO\nWe have accumulated the following to-do list, which we hope to complete in the near future\n- Still to come:\n  * [x] EfficientDet-[D0-7]\n  * [x] GPU-Parallel\n  * [x] NMS\n  * [ ] Soft-NMS\n  * [x] Pretrained model\n  * [x] Demo\n  * [ ] Model zoo\n  * [ ] TorchScript\n  * [ ] Mobile\n  * [ ] C++ Onnx\n  \n\n## Authors\n\n* [**Toan Dao Minh**](https://github.com/toandaominh1997)\n\n***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.\n\n## References\n- tanmingxing, rpang, qvl, et al. \"EfficientDet: Scalable and Efficient Object Detection.\" [EfficientDet](https://arxiv.org/abs/1911.09070).\n- A list of other great EfficientDet ports that were sources of inspiration:\n  * [EfficientNet](https://github.com/lukemelas/EfficientNet-PyTorch)\n  * [SSD.Pytorch](https://github.com/amdegroot/ssd.pytorch)\n  * [mmdetection](https://github.com/open-mmlab/mmdetection)\n  * [RetinaNet.Pytorch](https://github.com/yhenon/pytorch-retinanet)\n  * [NMS.Torchvision](https://pytorch.org/docs/stable/torchvision/ops.html)\n  \n\n## Citation\n\n    @article{efficientdetpytoan,\n        Author = {Toan Dao Minh},\n        Title = {A Pytorch Implementation of EfficientDet Object Detection},\n        Journal = {github.com/toandaominh1997/EfficientDet.Pytorch},\n        Year = {2019}\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoandaominh1997%2Fefficientdet.pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoandaominh1997%2Fefficientdet.pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoandaominh1997%2Fefficientdet.pytorch/lists"}