{"id":13442749,"url":"https://github.com/tinyvision/DAMO-YOLO","last_synced_at":"2025-03-20T15:30:49.480Z","repository":{"id":63890384,"uuid":"571211144","full_name":"tinyvision/DAMO-YOLO","owner":"tinyvision","description":"DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.","archived":false,"fork":false,"pushed_at":"2024-05-25T16:21:06.000Z","size":35223,"stargazers_count":3773,"open_issues_count":43,"forks_count":474,"subscribers_count":139,"default_branch":"master","last_synced_at":"2024-10-22T01:30:09.770Z","etag":null,"topics":["damo-yolo","deep-learning","imagenet","nas","object-detection","onnx","pytorch","tensorrt","yolo","yolov5"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinyvision.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-27T14:22:54.000Z","updated_at":"2024-10-18T08:45:50.000Z","dependencies_parsed_at":"2024-01-14T12:04:55.845Z","dependency_job_id":"3b3bf44d-54ea-4973-a084-7bdb4582a760","html_url":"https://github.com/tinyvision/DAMO-YOLO","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/tinyvision%2FDAMO-YOLO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FDAMO-YOLO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FDAMO-YOLO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyvision%2FDAMO-YOLO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyvision","download_url":"https://codeload.github.com/tinyvision/DAMO-YOLO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221772545,"owners_count":16878125,"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":["damo-yolo","deep-learning","imagenet","nas","object-detection","onnx","pytorch","tensorrt","yolo","yolov5"],"created_at":"2024-07-31T03:01:50.091Z","updated_at":"2025-03-20T15:30:49.474Z","avatar_url":"https://github.com/tinyvision.png","language":"Python","readme":"English | [简体中文](README_cn.md)\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/logo.png\" width=\"1500\"\u003e\n\n![](https://img.shields.io/badge/language-python-blue.svg)\n![](https://img.shields.io/badge/license-Apache-000000.svg)\n![Contributing](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n[![README-cn](https://shields.io/badge/README-%E4%B8%AD%E6%96%87-blue)](README_cn.md)\n[![ThirdParty](https://img.shields.io/badge/ThirdParty--Resources-brightgreen)](#third-parry-resources)\n[![IndustryModels](https://img.shields.io/badge/Industry--Models-orange)](#industry-application-models)\n\n\u003c/div\u003e\n\n## Introduction\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/overview.gif\" width=\"1500\"\u003e\u003c/div\u003e\n\nWelcome to **DAMO-YOLO**! It is a fast and accurate object detection method, which is developed by TinyML Team from Alibaba DAMO Data Analytics and Intelligence Lab. And it achieves a higher performance than state-of-the-art YOLO series. DAMO-YOLO is extend from YOLO but with some new techs, including Neural Architecture Search (NAS) backbones, efficient Reparameterized Generalized-FPN (RepGFPN), a lightweight head with AlignedOTA label assignment, and distillation enhancement. For more details, please refer to our [Arxiv Report](https://arxiv.org/abs/2211.15444). Moreover, here you can find not only powerful models, but also highly efficient training strategies and complete tools from training to deployment.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=\"assets/curve.png\" width=\"1200\"\u003e\u003c/div\u003e\n\n## Updates\n- **[2023/04/12: We release DAMO-YOLO v0.3.1!] ![new](https://img.alicdn.com/imgextra/i4/O1CN01kUiDtl1HVxN6G56vN_!!6000000000764-2-tps-43-19.png)**\n    * Add 701-categories DAMO-YOLO-S model, which cover more application scenarios and serve as high-quality pre-training model to improve the performance of downstream tasks。\n    * Upgrade the DAMO-YOLO-Nano series model, which achieves 32.3/38.2/40.5 mAP with only 1.56/3.69/6.04 Flops, and runs in real-time at 4.08/5.05/6.69ms using Intel-CPU. \n    * Add DAMO-YOLO-L model, which achieves 51.9 mAP with 7.95ms latency using T4-GPU.\n- **[2023/03/13: We release DAMO-YOLO v0.3.0!]**\n    * Release DAMO-YOLO-Nano, which achieves 35.1 mAP with only 3.02GFlops.\n    * Upgrade the optimizer builder, edits the optimizer config, you are able to use any optimizer supported by Pytorch.\n    * Upgrade the data loading pipeline and training parameters, leading to significant improvements of DAMO-YOLO models, e.g., the mAP of DAMO-YOLO-T/S/M increased from 43.0/46.8/50.0 to 43.6/47.7/50.2 respectively. \n- **[2023/02/15: Baseline for The 3rd Anti-UAV Challenge.]**\n    * Welcome to join [the 3rd Anti-UAV Challenge](https://anti-uav.github.io/Evaluate/) on CVPR2023. The Challenge provides baseline models trained by DAMO-YOLO, which can be found on [DamoYolo_Anti-UAV-23_S](https://modelscope.cn/models/damo/cv_tinynas_uav-detection_damoyolo/summary).\n- **[2023/01/07: We release DAMO-YOLO v0.2.1!]**\n    * Add [TensorRT Int8 Quantization Tutorial](./tools/partial_quantization/README.md), achieves 19% speed up with only 0.3% accuracy loss.\n    * Add [general demo tools](#quick-start), support TensorRT/Onnx/Torch based vidoe/image/camera inference.\n    * Add more [industry application models](#industry-application-models), including [human detection](https://www.modelscope.cn/models/damo/cv_tinynas_human-detection_damoyolo/summary), [helmet detection](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_safety-helmet/summary), [facemask detection](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_facemask/summary) and [cigarette detection](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_cigarette/summary).\n    * Add [third-party resources](#third-party-resources), including [DAMO-YOLO Code Interpretation](https://blog.csdn.net/jyyqqq/article/details/128419143), [Practical Example for Finetuning on Custom Dataset](https://blog.csdn.net/Cwhgn/article/details/128447380?spm=1001.2014.3001.5501). \n- **[2022/12/15: We release  DAMO-YOLO v0.1.1!]**\n  * Add a detailed [Custom Dataset Finetune Tutorial](./assets/CustomDatasetTutorial.md).\n  * The stuck problem caused by no-label data (*e.g.*, [ISSUE#30](https://github.com/tinyvision/DAMO-YOLO/issues/30)) is solved. Feel free to contact us, we are 24h stand by.\n\n## Web Demo\n- [DAMO-YOLO-T](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo-t/summary), [DAMO-YOLO-S](https://modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo/summary), [DAMO-YOLO-M](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo-m/summary) is integrated into ModelScope. Training is supported on [ModelScope](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo/summary) now! **Come and try DAMO-YOLO with free GPU resources provided by ModelScope.** \n\n## Model Zoo\n### General Models\n\n|Model |size |mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95 | Latency T4\u003cbr\u003eTRT-FP16-BS1| FLOPs\u003cbr\u003e(G)| Params\u003cbr\u003e(M)| AliYun Download | Google Download|\n| ------        |:---: | :---:     |:---:|:---: | :---: | :---:| :---:|\n|[DAMO-YOLO-T](./configs/damoyolo_tinynasL20_T.py) | 640 | 42.0  | 2.78  | 18.1  | 8.5  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL20_T_420.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL20_T_420.onnx)|--|\n|[DAMO-YOLO-T*](./configs/damoyolo_tinynasL20_T.py) | 640 | 43.6  | 2.78  | 18.1  | 8.5  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL20_T_436.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL20_T_436.onnx)|--|\n|[DAMO-YOLO-S](./configs/damoyolo_tinynasL25_S.py) | 640 | 46.0  | 3.83  | 37.8  | 16.3  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL25_S_460.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL25_S_460.onnx)|--|\n|[DAMO-YOLO-S*](./configs/damoyolo_tinynasL25_S.py) | 640 | 47.7  | 3.83  | 37.8  | 16.3 |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL25_S_477.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL25_S_477.onnx) |--|\n|[DAMO-YOLO-M](./configs/damoyolo_tinynasL35_M.py) | 640 | 49.2  | 5.62  | 61.8  | 28.2  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL35_M_492.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL35_M_492.onnx)|--|\n|[DAMO-YOLO-M*](./configs/damoyolo_tinynasL35_M.py) | 640 | 50.2  | 5.62  | 61.8  | 28.2 |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL35_M_502.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL35_M_502.onnx)|--|\n|[DAMO-YOLO-L](./configs/damoyolo_tinynasL45_L.py) | 640 | 50.8  | 7.95  | 97.3  | 42.1  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL45_L_508.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL45_L_508.onnx)|--|\n|[DAMO-YOLO-L*](./configs/damoyolo_tinynasL45_L.py) | 640 | 51.9  | 7.95  | 97.3  | 42.1  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/clean_model_0317/damoyolo_tinynasL45_L_519.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/damoyolo_tinynasL45_L_519.onnx)|--|\n\n\u003cdetails\u003e\n\n\u003csummary\u003eLegacy models\u003c/summary\u003e\n\n|Model |size |mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95 | Latency T4\u003cbr\u003eTRT-FP16-BS1| FLOPs\u003cbr\u003e(G)| Params\u003cbr\u003e(M)| AliYun Download | Google Download|\n| ------        |:---: | :---:     |:---:|:---: | :---: | :---:| :---:|\n|[DAMO-YOLO-T](./configs/damoyolo_tinynasL20_T.py) | 640 | 41.8  | 2.78  | 18.1  | 8.5  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/before_distill/damoyolo_tinynasL20_T_418.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/before_distill/damoyolo_tinynasL20_T_418.onnx)|[torch](https://drive.google.com/file/d/1-9NzCRKJZs3ea_n35seEYSpq3M_RkhcT/view?usp=sharing),[onnx](https://drive.google.com/file/d/1-7s8fqK5KC8z4sXCuh3N900chMtMSYri/view?usp=sharing)|\n|[DAMO-YOLO-T*](./configs/damoyolo_tinynasL20_T.py) | 640 | 43.0  | 2.78  | 18.1  | 8.5  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/damoyolo_tinynasL20_T.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/damoyolo_tinynasL20_T.onnx) |[torch](https://drive.google.com/file/d/1-6fBf_oe9vITSTYgQkaYklL94REz2zCh/view?usp=sharing),[onnx](https://drive.google.com/file/d/1-1lK83OwVKL4lgHTlbgEZ8pYMYZHhEtE/view?usp=sharing)|\n|[DAMO-YOLO-S](./configs/damoyolo_tinynasL25_S.py) | 640 | 45.6  | 3.83  | 37.8  | 16.3  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/before_distill/damoyolo_tinynasL25_S_456.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/before_distill/damoyolo_tinynasL25_S_456.onnx)|[torch](https://drive.google.com/file/d/1-0GV1lxUS6bLHTOs7aNojsItgjDT6rK8/view?usp=sharing),[onnx](https://drive.google.com/file/d/1--CaKMHm-SjLnprZDMksO-jnbGbV9Zhp/view?usp=sharing)|\n|[DAMO-YOLO-S*](./configs/damoyolo_tinynasL25_S.py) | 640 | 46.8  | 3.83  | 37.8  | 16.3 |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/damoyolo_tinynasL25_S.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/damoyolo_tinynasL25_S.onnx) |[torch](https://drive.google.com/file/d/1-O-ObHN970GRVKkL1TiAxfoMCpYGJS6B/view?usp=sharing),[onnx](https://drive.google.com/file/d/1-NDqCpz2rs1IiKNyIzo1KSxoJACKV65N/view?usp=sharing)|\n|[DAMO-YOLO-M](./configs/damoyolo_tinynasL35_M.py) | 640 | 48.7  | 5.62  | 61.8  | 28.2  |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/before_distill/damoyolo_tinynasL35_M_487.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/before_distill/damoyolo_tinynasL35_M_487.onnx)|[torch](https://drive.google.com/file/d/1-RMevyb9nwpDBeTPttiV_iwfsiW_M9ST/view?usp=sharing),[onnx](https://drive.google.com/file/d/1-Cs4ozjAhTH_W32tGnq_L5TfE22vAD_c/view?usp=sharing)|\n|[DAMO-YOLO-M*](./configs/damoyolo_tinynasL35_M.py) | 640 | 50.0  | 5.62  | 61.8  | 28.2 |[torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/damoyolo_tinynasL35_M.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/damoyolo_tinynasL35_M.onnx)|[torch](https://drive.google.com/file/d/1-RoKaO7U9U1UrweJb7c4Hs_S_qKFDExc/view?usp=sharing),[onnx](https://drive.google.com/file/d/1-HRkLfGoFBjdQDiWudsS1zxicx53Pu5m/view?usp=sharing)|\n\n\u003c/details\u003e\n\n- We report the mAP of models on COCO2017 validation set, with multi-class NMS.\n- The latency in this table is measured without post-processing(NMS).\n- \\* denotes the model trained with distillation.\n- We use S as teacher to distill T, and M as teacher to distill S, ans L as teacher to distill M, while L is distilled by it self.\n\n\n### Light Models\n|Model |size |mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95 | Latency(ms) CPU\u003cbr\u003e OpenVino-Intel8163| FLOPs\u003cbr\u003e(G)| Params\u003cbr\u003e(M)| AliYun Download | Google Download|\n| ------        |:---: | :---:     |:---:|:---: | :---: | :---:| :---:|\n| [DAMO-YOLO-Ns](./configs/damoyolo_tinynasL18_Ns.py)| 416| 32.3 | 4.08| 1.56 | 1.41 | [torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/ckpt/before_distill/damoyolo_nano_small.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/before_distill/damoyolo_tinynasL18_Ns.onnx) | -- |\n| [DAMO-YOLO-Nm](./configs/damoyolo_tinynasL18_Nm.py)| 416| 38.2 | 5.05| 3.69 | 2.71 | [torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/ckpt/before_distill/damoyolo_nano_middle.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/before_distill/damoyolo_tinynasL18_Nm.onnx) | -- |\n| [DAMO-YOLO-Nl](./configs/damoyolo_tinynasL20_Nl.py)| 416| 40.5 | 6.69| 6.04 | 5.69 | [torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/ckpt/before_distill/damoyolo_nano_large.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/release_model/onnx/before_distill/damoyolo_tinynasL20_Nl.onnx) | -- |\n\n- We report the mAP of models on COCO2017 validation set, with multi-class NMS.\n- The latency in this table is measured without post-processing, following [picodet](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.6/configs/picodet).\n- The latency is evaluated based on [OpenVINO-2022.3.0](https://github.com/openvinotoolkit/openvino), using commands below:\n     ```shell\n    # onnx export, enable --benchmark to ignore postprocess\n    python tools/converter.py -f configs/damoyolo_tinynasL18_Ns.py -c ../damoyolo_tinynasL18_Ns.pth --batch_size 1  --img_size 416 --benchmark\n    # model transform\n    mo --input_model damoyolo_tinynasL18_Ns.onnx --data_type FP16\n    # latency benchmark\n    ./benchmark_app -m damoyolo_tinynasL18_Ns.xml -i ./assets/dog.jpg -api sync -d CPU -b 1 -hint latency \n    ```\n                                                        \n\n### 701 categories DAMO-YOLO Model\nWe provide DAMO-YOLO-S model with 701 categories for general object detection, which has been trained on a large dataset including COCO, Objects365 and OpenImage. This model can also serve as a pre-trained model for fine-tuning in downstream tasks, enabling you to achieve better performance with ease.\n\n|Pretrained Model | Downstream Task |mAP\u003csup\u003eval\u003cbr\u003e0.5:0.95 | AliYun Download | Google Download|\n| ------        |:---: | :---:     |:---:|:---: |\n| 80-categories-DAMO-YOLO-S | VisDrone | 24.6 | [torch](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/clean_models/before_distill/damoyolo_tinynasL25_S_456.pth),[onnx](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/onnx/before_distill/damoyolo_tinynasL25_S_456.onnx) | - |\n| 701-categories-DAMO-YOLO-S | VisDrone | 26.6 | [torch](http://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/Large-Scale-Training/damo_yolo_s_700%2B.pth),[onnx](http://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/Large-Scale-Training/damo_yolo_s_700%2B.onnx) | - |\n- Note: The downloadable model is a pretrained model with 701 categories datasets. We demonstrate the VisDrone results to show that our pretrained model can enhance the performance of downstream tasks.\n\u003cdiv align=\"left\"\u003e\u003cimg src=\"assets/701class_cmp_horizontal.png\" width=\"750\"\u003e\u003c/div\u003e\n\n## Quick Start\n\n\u003cdetails\u003e\n\u003csummary\u003eInstallation\u003c/summary\u003e\n\nStep1. Install DAMO-YOLO.\n```shell\ngit clone https://github.com/tinyvision/damo-yolo.git\ncd DAMO-YOLO/\nconda create -n DAMO-YOLO python=3.7 -y\nconda activate DAMO-YOLO\nconda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.2 -c pytorch\npip install -r requirements.txt\nexport PYTHONPATH=$PWD:$PYTHONPATH\n```\nStep2. Install [pycocotools](https://github.com/cocodataset/cocoapi).\n\n```shell\npip install cython;\npip install git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI # for Linux\npip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI # for Windows\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDemo\u003c/summary\u003e\n\nStep1. Download a pretrained torch, onnx or tensorRT engine from the benchmark table, e.g., damoyolo_tinynasL25_S.pth, damoyolo_tinynasL25_S.onnx, damoyolo_tinynasL25_S.trt.\n\nStep2. Use -f(config filename) to specify your detector's config, --path to specify input data path, image/video/camera are supported. For example:\n```shell\n# torch engine with image\npython tools/demo.py image -f ./configs/damoyolo_tinynasL25_S.py --engine ./damoyolo_tinynasL25_S.pth --conf 0.6 --infer_size 640 640 --device cuda --path ./assets/dog.jpg\n\n# onnx engine with video\npython tools/demo.py video -f ./configs/damoyolo_tinynasL25_S.py --engine ./damoyolo_tinynasL25_S.onnx --conf 0.6 --infer_size 640 640 --device cuda --path your_video.mp4\n\n# tensorRT engine with camera\npython tools/demo.py camera -f ./configs/damoyolo_tinynasL25_S.py --engine ./damoyolo_tinynasL25_S.trt --conf 0.6 --infer_size 640 640 --device cuda --camid 0\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eReproduce our results on COCO\u003c/summary\u003e\n\nStep1. Prepare COCO dataset\n```shell\ncd \u003cDAMO-YOLO Home\u003e\nln -s /path/to/your/coco ./datasets/coco\n```\n\nStep 2. Reproduce our results on COCO by specifying -f(config filename)\n```shell\npython -m torch.distributed.launch --nproc_per_node=8 tools/train.py -f configs/damoyolo_tinynasL25_S.py\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFinetune on your data\u003c/summary\u003e\n\nPlease refer to [custom dataset tutorial](./assets/CustomDatasetTutorial.md) for details.\n\n\u003c/details\u003e\n\n\n\n\u003cdetails\u003e\n\u003csummary\u003eEvaluation\u003c/summary\u003e\n\n```shell\npython -m torch.distributed.launch --nproc_per_node=8 tools/eval.py -f configs/damoyolo_tinynasL25_S.py --ckpt /path/to/your/damoyolo_tinynasL25_S.pth\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eCustomize tinynas backbone\u003c/summary\u003e\nStep1. If you want to customize your own backbone, please refer to [MAE-NAS Tutorial for DAMO-YOLO](https://github.com/alibaba/lightweight-neural-architecture-search/blob/main/scripts/damo-yolo/Tutorial_NAS_for_DAMO-YOLO_cn.md). This is a detailed tutorial about how to obtain an optimal backbone under the budget of latency/flops.  \n\nStep2. After the searching process completed, you can replace the structure text in configs with it. Finally, you can get your own custom ResNet-like or CSPNet-like backbone after setting the backbone name to TinyNAS_res or TinyNAS_csp. Please notice the difference of out_indices between TinyNAS_res and TinyNAS_csp. \n```\nstructure = self.read_structure('tinynas_customize.txt')\nTinyNAS = { 'name'='TinyNAS_res', # ResNet-like Tinynas backbone\n            'out_indices': (2,4,5)}\nTinyNAS = { 'name'='TinyNAS_csp', # CSPNet-like Tinynas backbone\n            'out_indices': (2,3,4)}\n\n```\n\u003c/details\u003e\n\n\n\n## Deploy\n\u003cdetails\u003e\n\u003csummary\u003eInstallation\u003c/summary\u003e\n\nStep1. Install ONNX.\n```shell\npip install onnx==1.8.1\npip install onnxruntime==1.8.0\npip install onnx-simplifier==0.3.5\n```\nStep2. Install CUDA、CuDNN、TensorRT and pyCUDA\n\n2.1 CUDA\n```shell\nwget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run\nsudo sh cuda_10.2.89_440.33.01_linux.run\nexport PATH=$PATH:/usr/local/cuda-10.2/bin\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.2/lib64\nsource ~/.bashrc\n```\n2.2 CuDNN\n```shell\nsudo cp cuda/include/* /usr/local/cuda/include/\nsudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/\nsudo chmod a+r /usr/local/cuda/include/cudnn.h\nsudo chmod a+r /usr/local/cuda/lib64/libcudnn*\n```\n2.3 TensorRT\n```shell\ncd TensorRT-7.2.1.6/python\npip install tensorrt-7.2.1.6-cp37-none-linux_x86_64.whl\nexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:TensorRT-7.2.1.6/lib\n```\n2.4 pycuda\n```shell\npip install pycuda==2022.1\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eModel Convert\u003c/summary\u003e\n\nNow we support trt_int8 quantization, you can specify trt_type as int8 to export the int8 tensorRT engine. You can also try partial quantization to achieve a good compromise between accuracy and latency. Refer to [partial_quantization](./tools/partial_quantization/README.md) for more details.\n\nStep.1 convert torch model to onnx or trt engine, and the output file would be generated in ./deploy. end2end means to export trt with nms. trt_eval means to evaluate the exported trt engine on coco_val dataset after the export compelete.\n```shell\n# onnx export \npython tools/converter.py -f configs/damoyolo_tinynasL25_S.py -c damoyolo_tinynasL25_S.pth --batch_size 1 --img_size 640\n\n# trt export\npython tools/converter.py -f configs/damoyolo_tinynasL25_S.py -c damoyolo_tinynasL25_S.pth --batch_size 1 --img_size 640 --trt --end2end --trt_eval\n```\n\nStep.2 trt engine evaluation on coco_val dataset. end2end means to using trt_with_nms to evaluation.\n```shell\npython tools/trt_eval.py -f configs/damoyolo_tinynasL25_S.py -trt deploy/damoyolo_tinynasL25_S_end2end_fp16_bs1.trt --batch_size 1 --img_size 640 --end2end\n```\n\nStep.3 onnx or trt engine inference demo and appoint test image/video by --path. end2end means to using trt_with_nms to inference.\n```shell\n# onnx inference\npython tools/demo.py image -f ./configs/damoyolo_tinynasL25_S.py --engine ./damoyolo_tinynasL25_S.onnx --conf 0.6 --infer_size 640 640 --device cuda --path ./assets/dog.jpg\n\n# trt inference\npython tools/demo.py image -f ./configs/damoyolo_tinynasL25_S.py --engine ./deploy/damoyolo_tinynasL25_S_end2end_fp16_bs1.trt --conf 0.6 --infer_size 640 640 --device cuda --path ./assets/dog.jpg --end2end\n```\n\u003c/details\u003e\n\n## Industry Application Models:\nWe provide DAMO-YOLO models for applications in real scenarios, which are listed as follows. More powerful models are coming, please stay tuned.\n\n|[**Human Detection**](https://www.modelscope.cn/models/damo/cv_tinynas_human-detection_damoyolo/summary)| [**Helmet Detection**](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_safety-helmet/summary)|[**Head Detection**](https://modelscope.cn/models/damo/cv_tinynas_head-detection_damoyolo/summary) | [**Smartphone Detectioin**](https://modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_phone/summary)|\n| :---: | :---: |  :---: | :---: | \n|\u003cimg src='./assets/applications/human_detection.png' height=\"100px\" \u003e| \u003cimg src='./assets/applications/helmet_detection.png' height=\"100px\"\u003e|\u003cimg src='./assets/applications/head_detection.png' height=\"100px\"\u003e | \u003cimg src='./assets/applications/smartphone_detection.png' height=\"100px\"\u003e|\n|[**Facemask Detection**](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_facemask/summary) |[**Cigarette Detection**](https://www.modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_cigarette/summary) |[**Traffic Sign Detection**](https://modelscope.cn/models/damo/cv_tinynas_object-detection_damoyolo_traffic_sign/summary) | [**NFL-helmet detection**](https://www.modelscope.cn/models/XianzheXu/cv_tinynas_object-detection_damoyolo_nfl-helmet/summary)|\n|\u003cimg src='./assets/applications/facemask_detection.png' height=\"100px\"\u003e| \u003cimg src='./assets/applications/cigarette_detection.png' height=\"100px\"\u003e|\u003cimg src='./assets/applications/trafficsign_detection.png' height=\"100px\"\u003e | \u003cimg src='./assets/applications/nflhelmet_detection.jpg' height=\"100px\"\u003e|\n\n\n\n## Third Party Resources\nIn order to promote communication among DAMO-YOLO users, we collect third-party resources in this section. If you have original content about DAMO-YOLO, please feel free to contact us at xianzhe.xxz@alibaba-inc.com.\n\n- DAMO-YOLO Overview: **slides**([中文](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/slides/DAMO-YOLO-Overview.pdf) | [English](https://idstcv.oss-cn-zhangjiakou.aliyuncs.com/DAMO-YOLO/slides/DAMO-YOLO-Overview-English.pdf)), **videos**([中文](https://www.bilibili.com/video/BV1hW4y1g7za/?spm_id_from=333.337.search-card.all.click) | [English](https://youtu.be/XYQPI7pvMiQ)).\n- [DAMO-YOLO Code Interpretation](https://blog.csdn.net/jyyqqq/article/details/128419143)\n- [Practical Example for Finetuning on Custom Dataset](https://blog.csdn.net/Cwhgn/article/details/128447380?spm=1001.2014.3001.5501)\n\n\n## Cite DAMO-YOLO\nIf you use DAMO-YOLO in your research, please cite our work by using the following BibTeX entry:\n\n```latex\n @article{damoyolo,\n   title={DAMO-YOLO: A Report on Real-Time Object Detection Design},\n   author={Xianzhe Xu, Yiqi Jiang, Weihua Chen, Yilun Huang, Yuan Zhang and Xiuyu Sun},\n   journal={arXiv preprint arXiv:2211.15444v2},\n   year={2022},\n }\n\n @inproceedings{sun2022mae,\n   title={Mae-det: Revisiting maximum entropy principle in zero-shot nas for efficient object detection},\n   author={Sun, Zhenhong and Lin, Ming and Sun, Xiuyu and Tan, Zhiyu and Li, Hao and Jin, Rong},\n   booktitle={International Conference on Machine Learning},\n   pages={20810--20826},\n   year={2022},\n   organization={PMLR}\n }\n\n@inproceedings{jiang2022giraffedet,\n  title={GiraffeDet: A Heavy-Neck Paradigm for Object Detection},\n  author={yiqi jiang and Zhiyu Tan and Junyan Wang and Xiuyu Sun and Ming Lin and Hao Li},\n  booktitle={International Conference on Learning Representations},\n  year={2022},\n}\n```\n\n","funding_links":[],"categories":["Python","🔥 Latest YOLO Implementations (2024-2025)","Uncategorized","对象检测_分割","Summary"],"sub_categories":["🌟 Other YOLO Variants","Uncategorized","资源传输下载"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyvision%2FDAMO-YOLO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyvision%2FDAMO-YOLO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyvision%2FDAMO-YOLO/lists"}