diff --git a/python/app/fedcv/.gitignore b/python/app/fedcv/.gitignore index c855822a44..0f601e8bd1 100644 --- a/python/app/fedcv/.gitignore +++ b/python/app/fedcv/.gitignore @@ -1,5 +1,12 @@ +__pycache__ +wandb +runs +*.cache *.zip -__MACOSX/ -__pycache__/ -*.tmp -mpi_host_file \ No newline at end of file +*.jpg +*.png +mlops +config/exp* +.idea +.DS_Store +devops \ No newline at end of file diff --git a/python/app/fedcv/README.md b/python/app/fedcv/README.md index f8432af697..5b0991514f 100644 --- a/python/app/fedcv/README.md +++ b/python/app/fedcv/README.md @@ -1,10 +1,4 @@ -# FedCV: A Federated Learning Framework for Diverse Computer Vision Tasks - -## Introduction - -![](fedcv_arch.jpg) - -Federated Learning (FL) is a distributed learning paradigm that can learn a global or personalized model from decentralized datasets on edge devices. However, in the computer vision domain, model performance in FL is far behind centralized training due to the lack of exploration in diverse tasks with a unified FL framework. FL has rarely been demonstrated effectively in advanced computer vision tasks such as object detection and image segmentation. To bridge the gap and facilitate the development of FL for computer vision tasks, in this work, we propose a federated learning library and benchmarking framework, named FedCV, to evaluate FL on the three most representative computer vision tasks: image classification, image segmentation, and object detection. We provide non-I.I.D. benchmarking datasets, models, and various reference FL algorithms. Our benchmark study suggests that there are multiple challenges that deserve future exploration: centralized training tricks may not be directly applied to FL; the non-I.I.D. dataset actually downgrades the model accuracy to some degree in different tasks; improving the system efficiency of federated training is challenging given the huge number of parameters and the per-client memory cost. We believe that such a library and benchmark, along with comparable evaluation settings, is necessary to make meaningful progress in FL on computer vision tasks. +# FedCV - Object Detection ## Prerequisites & Installation @@ -12,17 +6,12 @@ Federated Learning (FL) is a distributed learning paradigm that can learn a glob pip install fedml --upgrade ``` -There are other dependencies in some tasks that need to be installed. +## Prepare YOLOv6 -```bash -git clone https://github.com/FedML-AI/FedML -cd FedML/python/app/fedcv/[image_classification, image_segmentation, object_detection] +Download the YOLOv6-S6 checkpoint from `https://github.com/meituan/YOLOv6` and add the checkpoint path to `./YOLOv6/configs/yolov6s6_finetune.py`. -cd config/ -bash bootstrap.sh - -cd .. -``` +## Prepare VOC dataset +Download the VOC dataset from `https://yolov6-docs.readthedocs.io/zh_CN/latest/%E5%85%A8%E6%B5%81%E7%A8%8B%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/%E8%AE%AD%E7%BB%83%E8%AF%84%E4%BC%B0%E6%8E%A8%E7%90%86%E6%B5%81%E7%A8%8B.html#id2` and run `python ./YOLOv6/yolov6/data/voc2yolo.py --voc_path your_path/to/VOCdevkit`. Then, fill in the path in `./YOLOv6/data/voc.yaml`. ### Run the MPI simulation @@ -38,50 +27,30 @@ train_args: client_id_list: client_num_in_total: 2 # change here! client_num_per_round: 2 # change here! - comm_round: 20 - epochs: 5 - batch_size: 1 + comm_round: 10000 + epochs: 1 + steps: 8 + batch_size: 8 ``` ### Run the server and client using MQTT If you want to run the edge server and client using MQTT, you need to run the following commands. +> !!IMPORTANT!! In order to avoid crosstalk during use, it is strongly recommended to modify `run_id` in `run_server.sh` and `run_client.sh` to avoid conflict. + ```bash bash run_server.sh your_run_id # in a new terminal window # run the client 1 -bash run_client.sh 1 your_run_id +bash run_client.sh [CLIENT_ID] your_run_id # run the client with client_id bash run_client.sh [CLIENT_ID] your_run_id ``` -To customize the number of client, you can change the following variables in `config/fedml_config.yaml`: - -```bash -train_args: - federated_optimizer: "FedAvg" - client_id_list: - client_num_in_total: 2 # change here! - client_num_per_round: 2 # change here! - comm_round: 20 - epochs: 5 - batch_size: 1 -``` - -### Run the application using MLOps - -You just need to select the YOLOv5 Object Detection application and start a new run. - -Run the following command to login to MLOps. - -```bash -fedml login [ACCOUNT_ID] -``` - ### Build your own application 1. Build package @@ -92,101 +61,3 @@ bash build_mlops_pkg.sh ``` 2. Create an application and upload package in mlops folder to MLOps - -## FedCV Experiments - -1. [Image Classification](#image-classification) - - Model: - - - CNN - - DenseNet - - MobileNetv3 - - EfficientNet - - Dataset: - - - CIFAR-10 - - CIFAR-100 - - CINIC-10 - - FedCIFAR-100 - - FederatedEMNIST - - ImageNet - - Landmark - - MNIST - -2. [Image Segmentation](#image-segmentation) - - Model: - - - UNet - - DeeplabV3 - - TransUnet - - Dataset: - - - Cityscapes - - COCO - - PascalVOC - -3. [Object Detection](#object-detection) - - Model: - - - YOLOv5 - - Dataset: - - - COCO - - COCO128 - -## How to Add Your Own Model? - -Our framework supports `PyTorch` based models. To add your own specific model, - -1. Create a `PyTorch` model and place it under `model` folder. -2. Prepare a `trainer module` by inheriting the base class `ClientTrainer`. -3. Prepare an experiment file similar to `fedml_*.py` and shell script similar to `run_*.sh`. -4. Adjust the `fedml_config.yaml` file with the model-specific parameters. - -## How to Add More Datasets, Domain-Specific Splits & Non-I.I.D.ness Generation Mechanisms? - -Create new folder for your dataset under `data/` folder and provide utilities to before feeding the data to federated pre-processing utilities listed in `data/data_loader.py` based on your new dataset. - -Splits and Non-I.I.D.'ness methods specific to each task are also located under `data/data_loader.py`. By default, we provide I.I.D. and non-I.I.D. sampling, Dirichlet distribution sampling based on sample size of the dataset. To create custom splitting method based on the sample size, you can create a new function or modify `load_partition_data_*` function. - -## Code Structure of FedCV - -- `config`: Experiment and GPU mapping configurations. - -- `data`: Provide data downloading scripts and store the downloaded datasets. FedCV supports more advanced datasets and models for federated training of computer vision tasks. -- `model`: advanced CV models. -- `trainer`: please define your own trainer.py by inheriting the base class in `fedml.core.alg_frame.client_trainer.ClientTrainer `. Some tasks can share the same trainer. -- `utils`: utility functions. - -You can see the `README.md` file in each folder for more details. - -## Citation - -Please cite our FedML and FedCV papers if it helps your research. - -```text -@article{he2021fedcv, - title={Fedcv: a federated learning framework for diverse computer vision tasks}, - author={He, Chaoyang and Shah, Alay Dilipbhai and Tang, Zhenheng and Sivashunmugam, Di Fan1Adarshan Naiynar and Bhogaraju, Keerti and Shimpi, Mita and Shen, Li and Chu, Xiaowen and Soltanolkotabi, Mahdi and Avestimehr, Salman}, - journal={arXiv preprint arXiv:2111.11066}, - year={2021} -} -@misc{he2020fedml, - title={FedML: A Research Library and Benchmark for Federated Machine Learning}, - author={Chaoyang He and Songze Li and Jinhyun So and Xiao Zeng and Mi Zhang and Hongyi Wang and Xiaoyang Wang and Praneeth Vepakomma and Abhishek Singh and Hang Qiu and Xinghua Zhu and Jianzong Wang and Li Shen and Peilin Zhao and Yan Kang and Yang Liu and Ramesh Raskar and Qiang Yang and Murali Annavaram and Salman Avestimehr}, - year={2020}, - eprint={2007.13518}, - archivePrefix={arXiv}, - primaryClass={cs.LG} -} -``` - -## Contact - -Please find contact information at the homepage. diff --git a/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/config.yml b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..3ba13e0cec --- /dev/null +++ b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/python/app/fedcv/object_detection/model/yolov5/.github/ISSUE_TEMPLATE/feature-request.yml b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/feature_request.yml similarity index 56% rename from python/app/fedcv/object_detection/model/yolov5/.github/ISSUE_TEMPLATE/feature-request.yml rename to python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/feature_request.yml index 68ef985186..06e741dce1 100644 --- a/python/app/fedcv/object_detection/model/yolov5/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,21 +1,21 @@ name: 🚀 Feature Request -description: Suggest a YOLOv5 idea +description: Suggest a YOLOv6 idea # title: " " labels: [enhancement] body: - type: markdown attributes: value: | - Thank you for submitting a YOLOv5 🚀 Feature Request! + Thank you for submitting a YOLOv6 Feature Request! - type: checkboxes attributes: label: Search before asking description: > - Please search the [issues](https://github.com/ultralytics/yolov5/issues) to see if a similar feature request already exists. + Please search the [issues](https://github.com/meituan/YOLOv6/issues) to see if a similar feature request already exists. options: - label: > - I have searched the YOLOv5 [issues](https://github.com/ultralytics/yolov5/issues) and found no similar feature requests. + I have searched the YOLOv6 [issues](https://github.com/meituan/YOLOv6/issues) and found no similar feature requests. required: true - type: textarea @@ -23,7 +23,7 @@ body: label: Description description: A short description of your feature. placeholder: | - What new feature would you like to see in YOLOv5? + What new feature would you like to see in YOLOv6? (你希望YOLOv6可以支持哪些新功能?) validations: required: true @@ -33,7 +33,7 @@ body: description: | Describe the use case of your feature request. It will help us understand and prioritize the feature request. placeholder: | - How would this feature be used, and who would use it? + How would this feature be used, and who would use it?(请描述一下这个新功能的应用场景?) - type: textarea attributes: @@ -44,7 +44,6 @@ body: attributes: label: Are you willing to submit a PR? description: > - (Optional) We encourage you to submit a [Pull Request](https://github.com/ultralytics/yolov5/pulls) (PR) to help improve YOLOv5 for everyone, especially if you have a good understanding of how to implement a fix or feature. - See the YOLOv5 [Contributing Guide](https://github.com/ultralytics/yolov5/blob/master/CONTRIBUTING.md) to get started. + (Optional) We encourage you to submit a [Pull Request](https://github.com/meituan/YOLOv6/pulls) (PR) to help improve YOLOv6 for everyone, especially if you have a good understanding of how to implement a fix or feature. options: - label: Yes I'd like to help by submitting a PR! diff --git a/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/question.yml b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000000..a652f25ce3 --- /dev/null +++ b/python/app/fedcv/YOLOv6/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,54 @@ +name: ❓ Question +description: Ask a YOLOv6 question +# title: " " +labels: [question] +body: + - type: markdown + attributes: + value: | + Thanks for your attention. We will try our best to solve your problem, but more concrete information is necessary to reproduce your problem. + - type: checkboxes + attributes: + label: Before Asking + description: > + Please check and try following methods to solve it by yourself + options: + - label: > + I have read the [README](https://github.com/meituan/YOLOv6/blob/main/README.md) carefully. + 我已经仔细阅读了README上的操作指引。 + required: true + - label: > + I want to train my custom dataset, and I have read the [tutorials for training your custom data](https://github.com/meituan/YOLOv6/blob/main/docs/Train_custom_data.md) carefully and organize my dataset correctly; + (FYI: We recommand you to apply the config files of xx_finetune.py.) + 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。(FYI: 我们推荐使用xx_finetune.py等配置文件训练自定义数据集。) + required: False + - label: > + I have pulled the latest code of main branch to run again and the problem still existed. + 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。 + required: true + + + - type: checkboxes + attributes: + label: Search before asking + description: > + Please search the [issues](https://github.com/meituan/YOLOv6/issues) to see if a similar question already exists. + options: + - label: > + I have searched the YOLOv6 [issues](https://github.com/meituan/YOLOv6/issues) and found no similar questions. + required: true + + - type: textarea + attributes: + label: Question + description: What is your question? + placeholder: | + 💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks, training commands etc.) to receive the most helpful response. + (请仔细阅读上面的信息先进行问题排查,如果仍不能解决您的问题,请将问题尽可能地描述详细,以及提供相关命令、超参配置、报错日志等信息或截图,以便更快地定位和解决问题。) + validations: + required: true + + - type: textarea + attributes: + label: Additional + description: Anything else you would like to share? diff --git a/python/app/fedcv/YOLOv6/.gitignore b/python/app/fedcv/YOLOv6/.gitignore new file mode 100644 index 0000000000..354eb6e714 --- /dev/null +++ b/python/app/fedcv/YOLOv6/.gitignore @@ -0,0 +1,117 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +**/*.pyc + +# C extensions + +# Distribution / packaging + +.Python +videos/ +build/ +runs/ +weights/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# custom +.DS_Store + +# Pytorch +*.pth + +#vscode +.vscode/* + +#user scripts +*.sh + +# model files +*.onnx +*.pt +*.engine diff --git a/python/app/fedcv/YOLOv6/.pre-commit-config.yaml b/python/app/fedcv/YOLOv6/.pre-commit-config.yaml new file mode 100644 index 0000000000..fd16ba2dc3 --- /dev/null +++ b/python/app/fedcv/YOLOv6/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files diff --git a/python/app/fedcv/object_detection/model/yolov6/LICENSE b/python/app/fedcv/YOLOv6/LICENSE similarity index 100% rename from python/app/fedcv/object_detection/model/yolov6/LICENSE rename to python/app/fedcv/YOLOv6/LICENSE diff --git a/python/app/fedcv/YOLOv6/README.md b/python/app/fedcv/YOLOv6/README.md new file mode 100644 index 0000000000..6ea26ee507 --- /dev/null +++ b/python/app/fedcv/YOLOv6/README.md @@ -0,0 +1,286 @@ +

+ +

+ +English | [简体中文](README_cn.md) + +
+ +
+ + Open In Colab + Open In Kaggle +
+
+ +## YOLOv6 + +Implementation of paper: +- [YOLOv6 v3.0: A Full-Scale Reloading](https://arxiv.org/abs/2301.05586) 🔥 +- [YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications](https://arxiv.org/abs/2209.02976) + +

+ +

+ + +## What's New +- [2023.04.28] Release [YOLOv6Lite](configs/yolov6_lite/README.md) models on mobile or CPU. ⭐️ [Mobile Benchmark](#Mobile-Benchmark) +- [2023.03.10] Release [YOLOv6-Face](https://github.com/meituan/YOLOv6/tree/yolov6-face). 🔥 [Performance](https://github.com/meituan/YOLOv6/tree/yolov6-face#performance-on-widerface) +- [2023.03.02] Update [base models](configs/base/README.md) to version 3.0. +- [2023.01.06] Release P6 models and enhance the performance of P5 models. ⭐️ [Benchmark](#Benchmark) +- [2022.11.04] Release [base models](configs/base/README.md) to simplify the training and deployment process. +- [2022.09.06] Customized quantization methods. 🚀 [Quantization Tutorial](./tools/qat/README.md) +- [2022.09.05] Release M/L models and update N/T/S models with enhanced performance. +- [2022.06.23] Release N/T/S models with excellent performance. + +## Benchmark +| Model | Size | mAPval
0.5:0.95 | SpeedT4
trt fp16 b1
(fps) | SpeedT4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | :----------------------- | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6n.pt) | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 | +| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s.pt) | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 | +| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m.pt) | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 | +| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l.pt) | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 | +| | | | | | +| [**YOLOv6-N6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6n6.pt) | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 | +| [**YOLOv6-S6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s6.pt) | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 | +| [**YOLOv6-M6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m6.pt) | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 | +| [**YOLOv6-L6**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l6.pt) | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 | +
+Table Notes + +- All checkpoints are trained with self-distillation except for YOLOv6-N6/S6 models trained to 300 epochs without distillation. +- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset with the input resolution of 640×640 for P5 models and 1280x1280 for P6 models. +- Speed is tested with TensorRT 7.2 on T4. +- Refer to [Test speed](./docs/Test_speed.md) tutorial to reproduce the speed results of YOLOv6. +- Params and FLOPs of YOLOv6 are estimated on deployed models. +
+ +
+Legacy models + +| Model | Size | mAPval
0.5:0.95 | SpeedT4
trt fp16 b1
(fps) | SpeedT4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6n.pt) | 640 | 35.9300e
36.3400e | 802 | 1234 | 4.3 | 11.1 | +| [**YOLOv6-T**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6t.pt) | 640 | 40.3300e
41.1400e | 449 | 659 | 15.0 | 36.7 | +| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6s.pt) | 640 | 43.5300e
43.8400e | 358 | 495 | 17.2 | 44.2 | +| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6m.pt) | 640 | 49.5 | 179 | 233 | 34.3 | 82.2 | +| [**YOLOv6-L-ReLU**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l_relu.pt) | 640 | 51.7 | 113 | 149 | 58.5 | 144.0 | +| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l.pt) | 640 | 52.5 | 98 | 121 | 58.5 | 144.0 | +- Speed is tested with TensorRT 7.2 on T4. +### Quantized model 🚀 + +| Model | Size | Precision | mAPval
0.5:0.95 | SpeedT4
trt b1
(fps) | SpeedT4
trt b32
(fps) | +| :-------------------- | ---- | --------- | :----------------------- | ---------------------------------- | ----------------------------------- | +| **YOLOv6-N RepOpt** | 640 | INT8 | 34.8 | 1114 | 1828 | +| **YOLOv6-N** | 640 | FP16 | 35.9 | 802 | 1234 | +| **YOLOv6-T RepOpt** | 640 | INT8 | 39.8 | 741 | 1167 | +| **YOLOv6-T** | 640 | FP16 | 40.3 | 449 | 659 | +| **YOLOv6-S RepOpt** | 640 | INT8 | 43.3 | 619 | 924 | +| **YOLOv6-S** | 640 | FP16 | 43.5 | 377 | 541 | + +- Speed is tested with TensorRT 8.4 on T4. +- Precision is figured on models for 300 epochs. + +
+ +## Mobile Benchmark +| Model | Size | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | +| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | + +
+Table Notes + +- From the perspective of model size and input image ratio, we have built a series of models on the mobile terminal to facilitate flexible applications in different scenarios. +- All checkpoints are trained with 400 epochs without distillation. +- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset, and the input resolution is the Size in the table. +- Speed is tested on MNN 2.3.0 AArch64 with 2 threads by arm82 acceleration. The inference warm-up is performed 10 times, and the cycle is performed 100 times. +- Qualcomm 888(sm8350), Dimensity 720(mt6853) and Qualcomm 660(sdm660) correspond to chips with different performances at the high, middle and low end respectively, which can be used as a reference for model capabilities under different chips. +- Refer to [Test NCNN Speed](./docs/Test_NCNN_speed.md) tutorial to reproduce the NCNN speed results of YOLOv6Lite. + +
+ +## Quick Start +
+ Install + + +```shell +git clone https://github.com/meituan/YOLOv6 +cd YOLOv6 +pip install -r requirements.txt +``` +
+ + + +
+ Reproduce our results on COCO + +Please refer to [Train COCO Dataset](./docs/Train_coco_data.md). + +
+ +
+ Finetune on custom data + +Single GPU + +```shell +# P5 models +python tools/train.py --batch 32 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0 +# P6 models +python tools/train.py --batch 32 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0 +``` + +Multi GPUs (DDP mode recommended) + +```shell +# P5 models +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0,1,2,3,4,5,6,7 +# P6 models +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0,1,2,3,4,5,6,7 +``` +- fuse_ab: add anchor-based auxiliary branch and use Anchor Aided Training Mode (Not supported on P6 models currently) +- conf: select config file to specify network/optimizer/hyperparameters. We recommend to apply yolov6n/s/m/l_finetune.py when training on your custom dataset. +- data: prepare dataset and specify dataset paths in data.yaml ( [COCO](http://cocodataset.org), [YOLO format coco labels](https://github.com/meituan/YOLOv6/releases/download/0.1.0/coco2017labels.zip) ) +- make sure your dataset structure as follows: +``` +├── coco +│ ├── annotations +│ │ ├── instances_train2017.json +│ │ └── instances_val2017.json +│ ├── images +│ │ ├── train2017 +│ │ └── val2017 +│ ├── labels +│ │ ├── train2017 +│ │ ├── val2017 +│ ├── LICENSE +│ ├── README.txt +``` + +YOLOv6 supports different input resolution modes. For details, see [How to Set the Input Size](./docs/About_training_size.md). + +
+ +
+Resume training + +If your training process is corrupted, you can resume training by +``` +# single GPU training. +python tools/train.py --resume + +# multi GPU training. +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --resume +``` +Above command will automatically find the latest checkpoint in YOLOv6 directory, then resume the training process. + +Your can also specify a checkpoint path to `--resume` parameter by +``` +# remember to replace /path/to/your/checkpoint/path to the checkpoint path which you want to resume training. +--resume /path/to/your/checkpoint/path +``` +This will resume from the specific checkpoint you provide. + +
+ +
+ Evaluation + +Reproduce mAP on COCO val2017 dataset with 640×640 or 1280x1280 resolution + +```shell +# P5 models +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val --reproduce_640_eval +# P6 models +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s6.pt --task val --reproduce_640_eval --img 1280 +``` +- verbose: set True to print mAP of each classes. +- do_coco_metric: set True / False to enable / disable pycocotools evaluation method. +- do_pr_metric: set True / False to print or not to print the precision and recall metrics. +- config-file: specify a config file to define all the eval params, for example: [yolov6n_with_eval_params.py](configs/experiment/yolov6n_with_eval_params.py) +
+ + +
+Inference + +First, download a pretrained model from the YOLOv6 [release](https://github.com/meituan/YOLOv6/releases/tag/0.4.0) or use your trained model to do inference. + +Second, run inference with `tools/infer.py` + +```shell +# P5 models +python tools/infer.py --weights yolov6s.pt --source img.jpg / imgdir / video.mp4 +# P6 models +python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --source img.jpg / imgdir / video.mp4 +``` +If you want to inference on local camera or web camera, you can run: +```shell +# P5 models +python tools/infer.py --weights yolov6s.pt --webcam --webcam-addr 0 +# P6 models +python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-addr 0 +``` +`webcam-addr` can be local camera number id or rtsp address. +
+ +
+ Deployment + +* [ONNX](./deploy/ONNX) +* [OpenCV Python/C++](./deploy/ONNX/OpenCV) +* [OpenVINO](./deploy/OpenVINO) +* [TensorRT](./deploy/TensorRT) +* [NCNN](./deploy/NCNN) +* [Android](./deploy/NCNN/Android) +
+ +
+ Tutorials + +* [User Guide(zh_CN)](https://yolov6-docs.readthedocs.io/zh_CN/latest/) +* [Train COCO Dataset](./docs/Train_coco_data.md) +* [Train custom data](./docs/Train_custom_data.md) +* [Test speed](./docs/Test_speed.md) +* [Tutorial of Quantization for YOLOv6](./docs/Tutorial%20of%20Quantization.md) +
+ +
+ Third-party resources + + * YOLOv6 NCNN Android app demo: [ncnn-android-yolov6](https://github.com/FeiGeChuanShu/ncnn-android-yolov6) from [FeiGeChuanShu](https://github.com/FeiGeChuanShu) + + * YOLOv6 ONNXRuntime/MNN/TNN C++: [YOLOv6-ORT](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/ort/cv/yolov6.cpp), [YOLOv6-MNN](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/mnn/cv/mnn_yolov6.cpp) and [YOLOv6-TNN](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/tnn/cv/tnn_yolov6.cpp) from [DefTruth](https://github.com/DefTruth) + + * YOLOv6 TensorRT Python: [yolov6-tensorrt-python](https://github.com/Linaom1214/TensorRT-For-YOLO-Series) from [Linaom1214](https://github.com/Linaom1214) + + * YOLOv6 TensorRT Windows C++: [yolort](https://github.com/zhiqwang/yolov5-rt-stack/tree/main/deployment/tensorrt-yolov6) from [Wei Zeng](https://github.com/Wulingtian) + + * [YOLOv6 web demo](https://huggingface.co/spaces/nateraw/yolov6) on [Huggingface Spaces](https://huggingface.co/spaces) with [Gradio](https://github.com/gradio-app/gradio). [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/nateraw/yolov6) + + * [Interactive demo](https://yolov6.dagshubusercontent.com/) on [DagsHub](https://dagshub.com) with [Streamlit](https://github.com/streamlit/streamlit) + + * Tutorial: [How to train YOLOv6 on a custom dataset](https://blog.roboflow.com/how-to-train-yolov6-on-a-custom-dataset/) Open In Colab + + * YouTube Tutorial: [How to train YOLOv6 on a custom dataset](https://youtu.be/fFCWrMFH2UY) + + * Demo of YOLOv6 inference on Google Colab [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mahdilamb/YOLOv6/blob/main/inference.ipynb) + + * Blog post: [YOLOv6 Object Detection – Paper Explanation and Inference](https://learnopencv.com/yolov6-object-detection/) + +
+ +### [FAQ(Continuously updated)](https://github.com/meituan/YOLOv6/wiki/FAQ%EF%BC%88Continuously-updated%EF%BC%89) + +If you have any questions, welcome to join our WeChat group to discuss and exchange. +

+ +

diff --git a/python/app/fedcv/YOLOv6/README_cn.md b/python/app/fedcv/YOLOv6/README_cn.md new file mode 100644 index 0000000000..d7181bc02e --- /dev/null +++ b/python/app/fedcv/YOLOv6/README_cn.md @@ -0,0 +1,266 @@ +

+ +

+ +简体中文 | [English](README.md) + +## YOLOv6 + +官方论文: +- [YOLOv6 v3.0: A Full-Scale Reloading](https://arxiv.org/abs/2301.05586) 🔥 +- [YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications](https://arxiv.org/abs/2209.02976) + +

+ +

+ + +## 更新日志 +- [2023.04.28] 发布 移动端轻量级模型 [YOLOv6Lite](configs/yolov6_lite/README.md). ⭐️ [移动端模型指标](#移动端模型指标) +- [2023.03.10] 发布 [YOLOv6-Face](https://github.com/meituan/YOLOv6/tree/yolov6-face). 🔥 [人脸检测模型指标](https://github.com/meituan/YOLOv6/blob/yolov6-face/README_cn.md#widerface-%E6%A8%A1%E5%9E%8B%E6%8C%87%E6%A0%87) +- [2023.03.02] 更新 [基础版模型](configs/base/README_cn.md) 到 3.0 版本 +- [2023.01.06] 发布大分辨率 P6 模型以及对 P5 模型做了全面的升级 ⭐️ [模型指标](#模型指标) +- [2022.11.04] 发布 [基础版模型](configs/base/README_cn.md) 简化训练部署流程 +- [2022.09.06] 定制化的模型量化加速方法 🚀 [量化教程](./tools/qat/README.md) +- [2022.09.05] 发布 M/L 模型,并且进一步提高了 N/T/S 模型的性能 +- [2022.06.23] 发布 N/T/S v1.0 版本模型 + +## 模型指标 +| 模型 | 输入尺寸 | mAPval
0.5:0.95 | 速度T4
trt fp16 b1
(fps) | 速度T4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n.pt) | 640 | 37.5 | 779 | 1187 | 4.7 | 11.4 | +| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s.pt) | 640 | 45.0 | 339 | 484 | 18.5 | 45.3 | +| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m.pt) | 640 | 50.0 | 175 | 226 | 34.9 | 85.8 | +| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l.pt) | 640 | 52.8 | 98 | 116 | 59.6 | 150.7 | +| | | | | | +| [**YOLOv6-N6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n6.pt) | 1280 | 44.9 | 228 | 281 | 10.4 | 49.8 | +| [**YOLOv6-S6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s6.pt) | 1280 | 50.3 | 98 | 108 | 41.4 | 198.0 | +| [**YOLOv6-M6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m6.pt) | 1280 | 55.2 | 47 | 55 | 79.6 | 379.5 | +| [**YOLOv6-L6**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l6.pt) | 1280 | 57.2 | 26 | 29 | 140.4 | 673.4 | + +
+表格笔记 + +- 除了 YOLOv6-N6/S6 模型是训练了300轮的结果,其余模型均为自蒸馏训练之后的结果; +- mAP 和速度指标是在 [COCO val2017](https://cocodataset.org/#download) 数据集上评估的,P5模型输入分辨率为 640×640,P6模型输入分辨率为 1280×1280; +- 速度是在 T4 上测试的,TensorRT 版本为 7.2; +- 复现 YOLOv6 的速度指标,请查看 [速度测试](./docs/Test_speed.md) 教程; +- YOLOv6 的参数和计算量是在推理模式下计算的; +
+ +
+旧版模型 + +| 模型 | 输入尺寸 | mAPval
0.5:0.95 | 速度T4
trt fp16 b1
(fps) | 速度T4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | :------------------------------------ | --------------------------------------- | ---------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6n.pt) | 640 | 35.9300e
36.3400e | 802 | 1234 | 4.3 | 11.1 | +| [**YOLOv6-T**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6t.pt) | 640 | 40.3300e
41.1400e | 449 | 659 | 15.0 | 36.7 | +| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6s.pt) | 640 | 43.5300e
43.8400e | 358 | 495 | 17.2 | 44.2 | +| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6m.pt) | 640 | 49.5 | 179 | 233 | 34.3 | 82.2 | +| [**YOLOv6-L-ReLU**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l_relu.pt) | 640 | 51.7 | 113 | 149 | 58.5 | 144.0 | +| [**YOLOv6-L**](https://github.com/meituan/YOLOv6/releases/download/0.2.0/yolov6l.pt) | 640 | 52.5 | 98 | 121 | 58.5 | 144.0 | +- 速度是在 T4 上测试的,TensorRT 版本为 7.2; + +### 量化模型 + +| 模型 | 输入尺寸 | 精度 | mAPval
0.5:0.95 | 速度T4
trt b1
(fps) | 速度T4
trt b32
(fps) | +| :-------------------- | ---- | --------- | :----------------------- | ---------------------------------- | ----------------------------------- | +| **YOLOv6-N RepOpt** | 640 | INT8 | 34.8 | 1114 | 1828 | +| **YOLOv6-N** | 640 | FP16 | 35.9 | 802 | 1234 | +| **YOLOv6-T RepOpt** | 640 | INT8 | 39.8 | 741 | 1167 | +| **YOLOv6-T** | 640 | FP16 | 40.3 | 449 | 659 | +| **YOLOv6-S RepOpt** | 640 | INT8 | 43.3 | 619 | 924 | +| **YOLOv6-S** | 640 | FP16 | 43.5 | 377 | 541 | + +- 速度是在 T4 上测试的,TensorRT 版本为 8.4; +- 精度是在训练 300 epoch 的模型上测试的; + +
+ +## 移动端模型指标 + +| 模型 | 输入尺寸 | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | +| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | + +
+表格笔记 + +- 从模型尺寸和输入图片比例两种角度,在构建了移动端系列模型,方便不同场景下的灵活应用。 +- 所有权重都经过 400 个 epoch 的训练,并且没有使用蒸馏技术。 +- mAP 和速度指标是在 COCO val2017 数据集上评估的,输入分辨率为表格中对应展示的。 +- 使用 MNN 2.3.0 AArch64 进行速度测试。测速时,采用2个线程,并开启arm82加速,推理预热10次,循环100次。 +- 高通888(sm8350)、天玑720(mt6853)和高通660(sdm660)分别对应高中低端不同性能的芯片,可以作为不同芯片下机型能力的参考。 +- [NCNN 速度测试](./docs/Test_NCNN_speed.md)教程可以帮助展示及复现 YOLOv6Lite 的 NCNN 速度结果。 + +
+ +## 快速开始 + +
+ 安装 + + +```shell +git clone https://github.com/meituan/YOLOv6 +cd YOLOv6 +pip install -r requirements.txt +``` +
+ +
+ 在 COCO 数据集上复现我们的结果 + +请参考教程 [训练 COCO 数据集](./docs/Train_coco_data.md). + +
+ +
+ 在自定义数据集上微调模型 + +单卡 + +```shell +# P5 models +python tools/train.py --batch 32 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0 +# P6 models +python tools/train.py --batch 32 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0 +``` + +多卡 (我们推荐使用 DDP 模式) + +```shell +# P5 models +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 256 --conf configs/yolov6s_finetune.py --data data/dataset.yaml --fuse_ab --device 0,1,2,3,4,5,6,7 +# P6 models +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --batch 128 --conf configs/yolov6s6_finetune.py --data data/dataset.yaml --img 1280 --device 0,1,2,3,4,5,6,7 +``` +- fuse_ab: 增加anchor-based预测分支并使用联合锚点训练模式 (P6模型暂不支持此功能) +- conf: 配置文件路径,里面包含网络结构、优化器配置、超参数信息。如果您是在自己的数据集训练,我们推荐您使用yolov6n/s/m/l_finetune.py配置文件; +- data: 数据集配置文件,以 COCO 数据集为例,您可以在 [COCO](http://cocodataset.org) 下载数据, 在这里下载 [YOLO 格式标签](https://github.com/meituan/YOLOv6/releases/download/0.1.0/coco2017labels.zip); +- 确保您的数据集按照下面这种格式来组织; +``` +├── coco +│ ├── annotations +│ │ ├── instances_train2017.json +│ │ └── instances_val2017.json +│ ├── images +│ │ ├── train2017 +│ │ └── val2017 +│ ├── labels +│ │ ├── train2017 +│ │ ├── val2017 +``` + +YOLOv6 支持不同的输入分辨率模式,详情请参见 [如何设置输入大小](./docs/About_training_size_cn.md). + +
+ +
+恢复训练 + + +如果您的训练进程中断了,您可以这样恢复先前的训练进程。 +``` +# 单卡训练 +python tools/train.py --resume + +# 多卡训练 +python -m torch.distributed.launch --nproc_per_node 8 tools/train.py --resume +``` +上面的命令将自动在 YOLOv6 目录中找到最新保存的模型,然后恢复训练。 + +您也可以通过 `--resume` 参数指定要恢复的模型路径 +``` +# 记得把 /path/to/your/checkpoint/path 替换为您要恢复训练的模型权重路径 +--resume /path/to/your/checkpoint/path +``` +这将从您提供的模型路径恢复训练。 + +
+ + +
+ 评估 +在 COCO val2017 数据集上复现我们的结果(输入分辨率 640x640 或 1280x1280) + +```shell +# P5 models +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s.pt --task val --reproduce_640_eval +# P6 models +python tools/eval.py --data data/coco.yaml --batch 32 --weights yolov6s6.pt --task val --reproduce_640_eval --img 1280 +``` +- verbose: 如果要打印每一类的精度信息,请设置为 True; +- do_coco_metric: 设置 True / False 来打开或关闭 pycocotools 的评估; +- do_pr_metric: 设置 True / False 来显示或不显示精度和召回的指标; +- config-file: 指定一个包含所有评估参数的配置文件,例如 [yolov6n_with_eval_params.py](configs/experiment/yolov6n_with_eval_params.py) +
+ + +
+推理 + +首先,从 [release页面](https://github.com/meituan/YOLOv6/releases/tag/0.3.0) 下载一个训练好的模型权重文件,或选择您自己训练的模型; + +然后,通过 `tools/infer.py`文件进行推理。 + +```shell +# P5 models +python tools/infer.py --weights yolov6s.pt --source img.jpg / imgdir / video.mp4 +# P6 models +python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --source img.jpg / imgdir / video.mp4 +``` +如果您想使用本地摄像头或者网络摄像头,您可以运行: +```shell +# P5 models +python tools/infer.py --weights yolov6s.pt --webcam --webcam-addr 0 +# P6 models +python tools/infer.py --weights yolov6s6.pt --img 1280 1280 --webcam --webcam-addr 0 +``` +`webcam-addr` 可以是本地摄像头的 ID,或者是 RTSP 地址。 +
+ +
+ 部署 + +* [ONNX](./deploy/ONNX) +* [OpenCV Python/C++](./deploy/ONNX/OpenCV) +* [OpenVINO](./deploy/OpenVINO) +* [TensorRT](./deploy/TensorRT) +* [NCNN](./deploy/NCNN) +* [Android](./deploy/NCNN/Android) +
+ +
+ 教程 + +* [用户手册(中文版)](https://yolov6-docs.readthedocs.io/zh_CN/latest/) +* [训练 COCO 数据集](./docs/Train_coco_data.md) +* [训练自定义数据集](./docs/Train_custom_data.md) +* [测速](./docs/Test_speed.md) +* [ YOLOv6 量化教程](./docs/Tutorial%20of%20Quantization.md) +
+ + +
+ 第三方资源 + + * YOLOv6 NCNN Android app demo: [ncnn-android-yolov6](https://github.com/FeiGeChuanShu/ncnn-android-yolov6) from [FeiGeChuanShu](https://github.com/FeiGeChuanShu) + * YOLOv6 ONNXRuntime/MNN/TNN C++: [YOLOv6-ORT](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/ort/cv/yolov6.cpp), [YOLOv6-MNN](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/mnn/cv/mnn_yolov6.cpp) and [YOLOv6-TNN](https://github.com/DefTruth/lite.ai.toolkit/blob/main/lite/tnn/cv/tnn_yolov6.cpp) from [DefTruth](https://github.com/DefTruth) + * YOLOv6 TensorRT Python: [yolov6-tensorrt-python](https://github.com/Linaom1214/TensorRT-For-YOLO-Series) from [Linaom1214](https://github.com/Linaom1214) + * YOLOv6 TensorRT Windows C++: [yolort](https://github.com/zhiqwang/yolov5-rt-stack/tree/main/deployment/tensorrt-yolov6) from [Wei Zeng](https://github.com/Wulingtian) + * [YOLOv6 web demo](https://huggingface.co/spaces/nateraw/yolov6) on [Huggingface Spaces](https://huggingface.co/spaces) with [Gradio](https://github.com/gradio-app/gradio). [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/nateraw/yolov6) + * 教程: [如何用 YOLOv6 训练自己的数据集](https://blog.roboflow.com/how-to-train-yolov6-on-a-custom-dataset/) Open In Colab + * YOLOv6 在 Google Colab 上的推理 Demo [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mahdilamb/YOLOv6/blob/main/inference.ipynb) +
+ +### [FAQ(持续更新)](https://github.com/meituan/YOLOv6/wiki/FAQ%EF%BC%88Continuously-updated%EF%BC%89) + +如果您有任何问题,欢迎加入我们的微信群一起讨论交流! +

+ +

diff --git a/python/app/fedcv/YOLOv6/configs/base/README.md b/python/app/fedcv/YOLOv6/configs/base/README.md new file mode 100644 index 0000000000..77ef5a4e9c --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/README.md @@ -0,0 +1,26 @@ +## YOLOv6 base model + +English | [简体中文](./README_cn.md) + +### Features + +- Use only regular convolution and Relu activation functions. + +- Apply CSP (1/2 channel dim) blocks in the network structure, except for Nano base model. + +Advantage: +- Adopt a unified network structure and configuration, and the accuracy loss of the PTQ 8-bit quantization model is negligible. +- Suitable for users who are just getting started or who need to apply, optimize and deploy an 8-bit quantization model quickly and frequently. + + +### Performance + +| Model | Size | mAPval
0.5:0.95 | SpeedT4
TRT FP16 b1
(FPS) | SpeedT4
TRT FP16 b32
(FPS) | SpeedT4
TRT INT8 b1
(FPS) | SpeedT4
TRT INT8 b32
(FPS) | Params
(M) | FLOPs
(G) | +| :--------------------------------------------------------------------------------------------- | --- | ----------------- | ----- | ---- | ---- | ---- | ----- | ------ | +| [**YOLOv6-N-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n_base.pt) | 640 | 36.6distill | 727 | 1302 | 814 | 1805 | 4.65 | 11.46 | +| [**YOLOv6-S-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s_base.pt) | 640 | 45.3distill | 346 | 525 | 487 | 908 | 13.14 | 30.6 | +| [**YOLOv6-M-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m_base.pt) | 640 | 49.4distill | 179 | 245 | 284 | 439 | 28.33 | 72.30 | +| [**YOLOv6-L-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l_base.pt) | 640 | 51.1distill | 116 | 157 | 196 | 288 | 59.61 | 150.89 | + +- Speed is tested with TensorRT 8.2.4.2 on T4. +- The processes of model training, evaluation, and inference are the same as the original ones. For details, please refer to [this README](https://github.com/meituan/YOLOv6#quick-start). diff --git a/python/app/fedcv/YOLOv6/configs/base/README_cn.md b/python/app/fedcv/YOLOv6/configs/base/README_cn.md new file mode 100644 index 0000000000..b6b01d1448 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/README_cn.md @@ -0,0 +1,25 @@ +## YOLOv6 基础版模型 + +简体中文 | [English](./README.md) + +### 模型特点 + +- 仅使用常规卷积和Relu激活函数 + +- 网络结构均采用CSP (1/2通道) block,Nano网络除外。 + +优势: +- 采用统一的网络结构和配置,且 PTQ 8位量化模型精度损失较小,适合刚入门或有快速迭代部署8位量化模型需求的用户。 + + +### 模型指标 + +| 模型 | 尺寸 | mAPval
0.5:0.95 | 速度T4
TRT FP16 b1
(FPS) | 速度T4
TRT FP16 b32
(FPS) | 速度T4
TRT INT8 b1
(FPS) | 速度T4
TRT INT8 b32
(FPS) | Params
(M) | FLOPs
(G) | +| :--------------------------------------------------------------------------------------------- | --- | ----------------- | ----- | ---- | ---- | ---- | ----- | ------ | +| [**YOLOv6-N-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n_base.pt) | 640 | 36.6distill | 727 | 1302 | 814 | 1805 | 4.65 | 11.46 | +| [**YOLOv6-S-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s_base.pt) | 640 | 45.3distill | 346 | 525 | 487 | 908 | 13.14 | 30.6 | +| [**YOLOv6-M-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m_base.pt) | 640 | 49.4distill | 179 | 245 | 284 | 439 | 28.33 | 72.30 | +| [**YOLOv6-L-base**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6l_base.pt) | 640 | 51.1distill | 116 | 157 | 196 | 288 | 59.61 | 150.89 | + +- 速度是在 T4 上测试的,TensorRT 版本为 8.4.2.4; +- 模型训练、评估、推理流程与原来保持一致,具体可参考 [首页 README 文档](https://github.com/meituan/YOLOv6/blob/main/README_cn.md#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)。 diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6l_base.py b/python/app/fedcv/YOLOv6/configs/base/yolov6l_base.py new file mode 100644 index 0000000000..ef2dbbb239 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6l_base.py @@ -0,0 +1,67 @@ +# YOLOv6l large base model +model = dict( + type='YOLOv6l_base', + pretrained=None, + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6s_finetune.py b/python/app/fedcv/YOLOv6/configs/base/yolov6l_base_finetune.py similarity index 64% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6s_finetune.py rename to python/app/fedcv/YOLOv6/configs/base/yolov6l_base_finetune.py index 66e6600dc1..7e8dc06267 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6s_finetune.py +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6l_base_finetune.py @@ -1,18 +1,21 @@ -# YOLOv6s model +# YOLOv6 large base model model = dict( - type='YOLOv6s', - pretrained='./weights/yolov6s.pt', - depth_multiple=0.33, - width_multiple=0.50, + type='YOLOv6l_base', + depth_multiple=1.0, + width_multiple=1.0, + pretrained=None, backbone=dict( - type='EfficientRep', + type='CSPBepBackbone', num_repeats=[1, 6, 12, 18, 6], out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, ), neck=dict( - type='RepPAN', + type='CSPRepBiFPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, ), head=dict( type='EffiDeHead', @@ -22,7 +25,13 @@ anchors=1, out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='siou' + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, ) ) @@ -51,3 +60,4 @@ mosaic=1.0, mixup=0.243, ) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6m_base.py b/python/app/fedcv/YOLOv6/configs/base/yolov6m_base.py new file mode 100644 index 0000000000..5670f096cf --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6m_base.py @@ -0,0 +1,67 @@ +# YOLOv6m medium/large base model +model = dict( + type='YOLOv6m_base', + pretrained=None, + depth_multiple=0.80, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 0.8, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6m_base_finetune.py b/python/app/fedcv/YOLOv6/configs/base/yolov6m_base_finetune.py new file mode 100644 index 0000000000..af5449ec19 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6m_base_finetune.py @@ -0,0 +1,67 @@ +# YOLOv6m medium/large base model +model = dict( + type='YOLOv6m_base', + pretrained=None, + depth_multiple=0.80, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 0.8, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6n_base.py b/python/app/fedcv/YOLOv6/configs/base/yolov6n_base.py new file mode 100644 index 0000000000..8340ca6024 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6n_base.py @@ -0,0 +1,66 @@ +# YOLOv6s nano base model +model = dict( + type='YOLOv6n_base', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, # set to True if you want to further train with distillation + reg_max=16, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6n_base_finetune.py b/python/app/fedcv/YOLOv6/configs/base/yolov6n_base_finetune.py new file mode 100644 index 0000000000..593c3def90 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6n_base_finetune.py @@ -0,0 +1,66 @@ +# YOLOv6s nanao base model +model = dict( + type='YOLOv6n_base', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6s_base.py b/python/app/fedcv/YOLOv6/configs/base/yolov6s_base.py new file mode 100644 index 0000000000..4e28c17858 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6s_base.py @@ -0,0 +1,68 @@ +# YOLOv6s small base model +model = dict( + type='YOLOv6s_base', + pretrained=None, + depth_multiple=0.70, + width_multiple=0.50, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='CSPRepBiFPANNeck',#CSPRepPANNeck + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, # set to True if you want to further train with distillation + reg_max=16, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/base/yolov6s_base_finetune.py b/python/app/fedcv/YOLOv6/configs/base/yolov6s_base_finetune.py new file mode 100644 index 0000000000..eb4d2159aa --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/base/yolov6s_base_finetune.py @@ -0,0 +1,68 @@ +# YOLOv6s small base model +model = dict( + type='YOLOv6s_base', + pretrained=None, + depth_multiple=0.70, + width_multiple=0.50, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) +training_mode = "conv_relu" diff --git a/python/app/fedcv/YOLOv6/configs/experiment/eval_640_repro.py b/python/app/fedcv/YOLOv6/configs/experiment/eval_640_repro.py new file mode 100644 index 0000000000..1f6a6217e5 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/experiment/eval_640_repro.py @@ -0,0 +1,79 @@ +# eval param for different scale + +eval_params = dict( + default = dict( + img_size=640, + shrink_size=2, + infer_on_rect=False, + ), + yolov6n = dict( + img_size=640, + shrink_size=4, + infer_on_rect=False, + ), + yolov6t = dict( + img_size=640, + shrink_size=6, + infer_on_rect=False, + ), + yolov6s = dict( + img_size=640, + shrink_size=6, + infer_on_rect=False, + ), + yolov6m = dict( + img_size=640, + shrink_size=4, + infer_on_rect=False, + ), + yolov6l = dict( + img_size=640, + shrink_size=4, + infer_on_rect=False, + ), + yolov6l_relu = dict( + img_size=640, + shrink_size=2, + infer_on_rect=False, + ), + yolov6n6 = dict( + img_size=1280, + shrink_size=17, + infer_on_rect=False, + ), + yolov6s6 = dict( + img_size=1280, + shrink_size=8, + infer_on_rect=False, + ), + yolov6m6 = dict( + img_size=1280, + shrink_size=64, + infer_on_rect=False, + ), + yolov6l6 = dict( + img_size=1280, + shrink_size=41, + infer_on_rect=False, + ), + yolov6s_mbla = dict( + img_size=640, + shrink_size=7, + infer_on_rect=False, + ), + yolov6m_mbla = dict( + img_size=640, + shrink_size=7, + infer_on_rect=False, + ), + yolov6l_mbla = dict( + img_size=640, + shrink_size=7, + infer_on_rect=False, + ), + yolov6x_mbla = dict( + img_size=640, + shrink_size=3, + infer_on_rect=False, + ) +) diff --git a/python/app/fedcv/YOLOv6/configs/experiment/yolov6n_with_eval_params.py b/python/app/fedcv/YOLOv6/configs/experiment/yolov6n_with_eval_params.py new file mode 100644 index 0000000000..e7366b3347 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/experiment/yolov6n_with_eval_params.py @@ -0,0 +1,76 @@ +# YOLOv6n model with eval param(when traing) +model = dict( + type='YOLOv6n', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.02, #0.01 # 0.02 + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +# Eval params when eval model. +# If eval_params item is list, eg conf_thres=[0.03, 0.03], +# first will be used in train.py and second will be used in eval.py. +eval_params = dict( + batch_size=None, #None mean will be the same as batch on one device * 2 + img_size=None, #None mean will be the same as train image size + conf_thres=0.03, + iou_thres=0.65, + + #pading and scale coord + shrink_size=None, # None mean will not shrink the image. + infer_on_rect=True, + + #metric + verbose=False, + do_coco_metric=True, + do_pr_metric=False, + plot_curve=False, + plot_confusion_matrix=False +) diff --git a/python/app/fedcv/YOLOv6/configs/experiment/yolov6s_csp_scaled.py b/python/app/fedcv/YOLOv6/configs/experiment/yolov6s_csp_scaled.py new file mode 100644 index 0000000000..ba28843acf --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/experiment/yolov6s_csp_scaled.py @@ -0,0 +1,57 @@ +# YOLOv6m model +model = dict( + type='YOLOv6s_csp', + pretrained=None, + depth_multiple=0.70, + width_multiple=0.50, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + ), + neck=dict( + type='CSPRepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + iou_type='giou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny.py b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t.py similarity index 83% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny.py rename to python/app/fedcv/YOLOv6/configs/experiment/yolov6t.py index be455de25f..afacd436ce 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny.py +++ b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t.py @@ -2,15 +2,15 @@ model = dict( type='YOLOv6t', pretrained=None, - depth_multiple=0.25, - width_multiple=0.50, + depth_multiple=0.33, + width_multiple=0.375, backbone=dict( type='EfficientRep', num_repeats=[1, 6, 12, 18, 6], out_channels=[64, 128, 256, 512, 1024], ), neck=dict( - type='RepPAN', + type='RepPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], ), @@ -22,7 +22,9 @@ anchors=1, out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='ciou' + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 ) ) diff --git a/python/app/fedcv/YOLOv6/configs/experiment/yolov6t_csp_scaled.py b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t_csp_scaled.py new file mode 100644 index 0000000000..e8ba99a906 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t_csp_scaled.py @@ -0,0 +1,57 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n_csp', + pretrained=None, + depth_multiple=0.60, + width_multiple=0.50, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + ), + neck=dict( + type='CSPRepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + iou_type='giou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny_finetune.py b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t_finetune.py similarity index 80% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny_finetune.py rename to python/app/fedcv/YOLOv6/configs/experiment/yolov6t_finetune.py index d751eff06a..8be474166e 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6_tiny_finetune.py +++ b/python/app/fedcv/YOLOv6/configs/experiment/yolov6t_finetune.py @@ -1,16 +1,16 @@ # YOLOv6t model model = dict( type='YOLOv6t', - pretrained='./weights/yolov6t.pt', - depth_multiple=0.25, - width_multiple=0.50, + pretrained='weights/yolov6t.pt', + depth_multiple=0.33, + width_multiple=0.375, backbone=dict( type='EfficientRep', num_repeats=[1, 6, 12, 18, 6], out_channels=[64, 128, 256, 512, 1024], ), neck=dict( - type='RepPAN', + type='RepPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], ), @@ -22,7 +22,9 @@ anchors=1, out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='ciou' + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 ) ) diff --git a/python/app/fedcv/YOLOv6/configs/mbla/README.md b/python/app/fedcv/YOLOv6/configs/mbla/README.md new file mode 100644 index 0000000000..d163124d68 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/README.md @@ -0,0 +1,28 @@ +## YOLOv6 mbla model + +English | [简体中文](./README_cn.md) + +### Features + +- Apply MBLABlock(Multi Branch Layer Aggregation Block) blocks in the network structure. + +Advantage: +- Adopt a unified network structure and configuration. + +- Better performance for Small model comparing to yolov6 3.0 release. + +- Better performance comparing to yolov6 3.0 base. + + + +### Performance + +| Model | Size | mAPval
0.5:0.95 | SpeedT4
trt fp16 b1
(fps) | SpeedT4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | -------- | :----------------------- | -------------------------------------- | --------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-S-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s_mbla.pt) | 640 | 47.0distill | 300 | 424 | 11.6 | 29.8 | +| [**YOLOv6-M-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m_mbla.pt) | 640 | 50.3distill | 168 | 216 | 26.1 | 66.7 | +| [**YOLOv6-L-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l_base.pt) | 640 | 52.0distill | 129 | 154 | 46.3 | 118.2 | +| [**YOLOv6-X-base**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6x_base.pt) | 640 | 53.5distill | 78 | 94 | 78.8 | 199.0 | + +- Speed is tested with TensorRT 8.4.2.4 on T4. +- The processes of model training, evaluation, and inference are the same as the original ones. For details, please refer to [this README](https://github.com/meituan/YOLOv6#quick-start). diff --git a/python/app/fedcv/YOLOv6/configs/mbla/README_cn.md b/python/app/fedcv/YOLOv6/configs/mbla/README_cn.md new file mode 100644 index 0000000000..ad399fe094 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/README_cn.md @@ -0,0 +1,26 @@ +## YOLOv6 MBLA版模型 + +简体中文 | [English](./README.md) + +### 模型特点 + +- 网络主体结构均采用MBLABlock(Multi Branch Layer Aggregation Block) + +优势: +- 采用统一的网络结构和配置 + +- 相比3.0版本在s尺度效果提升,相比3.0base版本各尺度效果提升 + + + +### 模型指标 + +| 模型 | 输入尺寸 | mAPval
0.5:0.95 | 速度T4
trt fp16 b1
(fps) | 速度T4
trt fp16 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | -------- | :----------------------- | -------------------------------------- | --------------------------------------- | -------------------- | ------------------- | +| [**YOLOv6-S-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6s_mbla.pt) | 640 | 47.0distill | 300 | 424 | 11.6 | 29.8 | +| [**YOLOv6-M-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6m_mbla.pt) | 640 | 50.3distill | 168 | 216 | 26.1 | 66.7 | +| [**YOLOv6-L-mbla**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6l_base.pt) | 640 | 52.0distill | 129 | 154 | 46.3 | 118.2 | +| [**YOLOv6-X-base**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6x_base.pt) | 640 | 53.5distill | 78 | 94 | 78.8 | 199.0 | + +- 速度是在 T4 上测试的,TensorRT 版本为 8.4.2.4; +- 模型训练、评估、推理流程与原来保持一致,具体可参考 [首页 README 文档](https://github.com/meituan/YOLOv6/blob/main/README_cn.md#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)。 diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla.py new file mode 100644 index 0000000000..7534b70541 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6l_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla_finetune.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla_finetune.py new file mode 100644 index 0000000000..6ea88967c5 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6l_mbla_finetune.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6l_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla.py new file mode 100644 index 0000000000..f84fc43d14 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6m_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla_finetune.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla_finetune.py new file mode 100644 index 0000000000..aa0bc816a6 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6m_mbla_finetune.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6m_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla.py new file mode 100644 index 0000000000..eedc76eec2 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6s_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=0.5, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla_finetune.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla_finetune.py new file mode 100644 index 0000000000..a9812c7166 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6s_mbla_finetune.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6s_mbla', + pretrained=None, + depth_multiple=0.5, + width_multiple=0.5, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla.py new file mode 100644 index 0000000000..b7b9703c2e --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6x_mbla', + pretrained=None, + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla_finetune.py b/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla_finetune.py new file mode 100644 index 0000000000..65c57cb21e --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/mbla/yolov6x_mbla_finetune.py @@ -0,0 +1,70 @@ +# YOLOv6l model +model = dict( + type='YOLOv6x_mbla', + pretrained=None, + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 4, 8, 8, 4], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + stage_block_type="MBLABlock", + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[8, 8, 8, 8], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + stage_block_type="MBLABlock", + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) + +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/qarepvgg/README.md b/python/app/fedcv/YOLOv6/configs/qarepvgg/README.md new file mode 100644 index 0000000000..81b130d28b --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/qarepvgg/README.md @@ -0,0 +1,26 @@ +## YOLOv6 base model + +English | [简体中文](./README_cn.md) + +### Features + +- This is a RepOpt-version implementation of YOLOv6 according to [QARepVGG](https://arxiv.org/abs/2212.01593). + +- The QARep version models possess slightly lower float accuracy on COCO than the RepVGG version models, but achieve highly improved quantized accuracy. + +- The INT8 accuracies listed were obtained using a simple PTQ process, as implemented in the [`onnx_to_trt.py`](../../deploy/TensorRT/onnx_to_trt.py) script. However, higher accuracies could be achieved using Quantization-Aware Training (QAT) due to the specific architecture design of the QARepVGG model. + +### Performance + +| Model | Size | Float
mAPval
0.5:0.95 | INT8
mAPval
0.5:0.95 | SpeedT4
trt fp16 b32
(fps) | SpeedT4
trt int8 b32
(fps) | Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | -------- | :----------------------- | -------------------------------------- | --------------------------------------- | -------------------- | ------------------- | -------------------- | +| [**YOLOv6-N**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n.pt) | 640 | 37.5 | 34.3 | 1286 | 1773 |4.7 | 11.4 | +| [**YOLOv6-N-qa**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6n_qa.pt) | 640 | 37.1 | 36.4 | 1286 | 1773 | 4.7 | 11.4 | +| [**YOLOv6-S**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s.pt) | 640 | 45.0 | 41.3 | 513 | 1117 | 18.5 | 45.3 | +| [**YOLOv6-S-qa**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6s_qa.pt) | 640 | 44.7 | 44.0 | 513 | 1117 | 18.5 | 45.3 | +| [**YOLOv6-M**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m.pt) | 640 | 50.0 | 48.1 | 250 | 439 | 34.9 | 85.8 | +| [**YOLOv6-M-qa**](https://github.com/meituan/YOLOv6/releases/download/0.3.0/yolov6m_qa.pt) | 640 | 49.7 | 49.4 | 250 | 439 | 34.9 | 85.8 | + +- Speed is tested with TensorRT 8.4 on T4. +- We have not conducted experiments on the YOLOv6-L model since it does not use the RepVGG architecture. +- The processes of model training, evaluation, and inference are the same as the original ones. For details, please refer to [this README](https://github.com/meituan/YOLOv6#quick-start). diff --git a/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6m_qa.py b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6m_qa.py new file mode 100644 index 0000000000..c0690f15e7 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6m_qa.py @@ -0,0 +1,68 @@ +# YOLOv6m model +model = dict( + type='YOLOv6m', + pretrained=None, + depth_multiple=0.60, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(2)/3, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(2)/3, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 0.8, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) + +training_mode='qarepvggv2' diff --git a/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6n_qa.py b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6n_qa.py new file mode 100644 index 0000000000..b42d9ddb4b --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6n_qa.py @@ -0,0 +1,66 @@ +# YOLOv6s model +model = dict( + type='YOLOv6n', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.02, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) +training_mode='qarepvggv2' diff --git a/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6s_qa.py b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6s_qa.py new file mode 100644 index 0000000000..3051679a25 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/qarepvgg/yolov6s_qa.py @@ -0,0 +1,67 @@ +# YOLOv6s model +model = dict( + type='YOLOv6s', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +training_mode='qarepvggv2' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_hs.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_hs.py new file mode 100644 index 0000000000..70a74279c8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_hs.py @@ -0,0 +1,59 @@ +# YOLOv6t model +model = dict( + type='YOLOv6t', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.375, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='hyper_search' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt.py new file mode 100644 index 0000000000..95dbf3178a --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt.py @@ -0,0 +1,59 @@ +# YOLOv6t model +model = dict( + type='YOLOv6t', + pretrained=None, + scales='../yolov6_assert/v6t_v2_scale_last.pt', + depth_multiple=0.33, + width_multiple=0.375, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt_qat.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt_qat.py new file mode 100644 index 0000000000..701bf4f1d8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6_tiny_opt_qat.py @@ -0,0 +1,83 @@ +# YOLOv6t model +model = dict( + type='YOLOv6t', + pretrained='./assets/v6s_t.pt', + scales='./assets/v6t_v2_scale_last.pt', + depth_multiple=0.33, + width_multiple=0.375, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.00001, + lrf=0.001, + momentum=0.937, + weight_decay=0.00005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +ptq = dict( + num_bits = 8, + calib_batches = 4, + # 'max', 'histogram' + calib_method = 'max', + # 'entropy', 'percentile', 'mse' + histogram_amax_method='entropy', + histogram_amax_percentile=99.99, + calib_output_path='./', + sensitive_layers_skip=False, + sensitive_layers_list=[], +) + +qat = dict( + calib_pt = './assets/v6s_t_calib_max.pt', + sensitive_layers_skip = False, + sensitive_layers_list=[], +) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6n.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_hs.py similarity index 76% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6n.py rename to python/app/fedcv/YOLOv6/configs/repopt/yolov6n_hs.py index 40b6e0c4ac..67607ba282 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6n.py +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_hs.py @@ -10,7 +10,7 @@ out_channels=[64, 128, 256, 512, 1024], ), neck=dict( - type='RepPAN', + type='RepPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], ), @@ -22,14 +22,17 @@ anchors=1, out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='ciou' + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 ) ) solver = dict( optim='SGD', lr_scheduler='Cosine', - lr0=0.01, + lr0=0.02, #0.01 # 0.02 lrf=0.01, momentum=0.937, weight_decay=0.0005, @@ -51,3 +54,6 @@ mosaic=1.0, mixup=0.0, ) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='hyper_search' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt.py new file mode 100644 index 0000000000..9b3db4fbf5 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt.py @@ -0,0 +1,59 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n', + pretrained=None, + scales='../yolov6_assert/v6n_v2_scale_last.pt', + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.02, #0.01 # 0.02 + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt_qat.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt_qat.py new file mode 100644 index 0000000000..4e76dfd3c4 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6n_opt_qat.py @@ -0,0 +1,82 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n', + pretrained='./assets/v6s_n.pt', + scales='./assets/v6n_v2_scale_last.pt', + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, + reg_max=0, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.00001, #0.01 # 0.02 + lrf=0.001, + momentum=0.937, + weight_decay=0.00005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +ptq = dict( + num_bits = 8, + calib_batches = 4, + # 'max', 'histogram' + calib_method = 'max', + # 'entropy', 'percentile', 'mse' + histogram_amax_method='entropy', + histogram_amax_percentile=99.99, + calib_output_path='./', + sensitive_layers_skip=False, + sensitive_layers_list=[], +) + +qat = dict( + calib_pt = './assets/v6s_n_calib_max.pt', + sensitive_layers_skip = False, + sensitive_layers_list=[], +) +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6s.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_hs.py similarity index 80% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6s.py rename to python/app/fedcv/YOLOv6/configs/repopt/yolov6s_hs.py index 8b281bf612..60c7286a1b 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6s.py +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_hs.py @@ -10,7 +10,7 @@ out_channels=[64, 128, 256, 512, 1024], ), neck=dict( - type='RepPAN', + type='RepPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], ), @@ -22,7 +22,10 @@ anchors=1, out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='siou' + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, + reg_max=0 ) ) @@ -51,3 +54,6 @@ mosaic=1.0, mixup=0.0, ) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='hyper_search' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt.py new file mode 100644 index 0000000000..2676eb4f14 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt.py @@ -0,0 +1,60 @@ +# YOLOv6s model +model = dict( + type='YOLOv6s', + pretrained=None, + scales='../yolov6_assert/v6s_v2_scale.pt', + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, + reg_max=0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt_qat.py b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt_qat.py new file mode 100644 index 0000000000..a41ea085c8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/repopt/yolov6s_opt_qat.py @@ -0,0 +1,113 @@ +# YOLOv6s model +model = dict( + type='YOLOv6s', + pretrained='./assets/yolov6s_v2_reopt_43.1.pt', + scales='./assets/yolov6s_v2_scale.pt', + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + ), + neck=dict( + type='RepPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=1, + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type = 'giou', + use_dfl = False, + reg_max = 0, # if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.00001, + lrf=0.001, + momentum=0.937, + weight_decay=0.00005, + warmup_epochs=3, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) + +ptq = dict( + num_bits = 8, + calib_batches = 4, + # 'max', 'histogram' + calib_method = 'histogram', + # 'entropy', 'percentile', 'mse' + histogram_amax_method='entropy', + histogram_amax_percentile=99.99, + calib_output_path='./', + sensitive_layers_skip=False, + sensitive_layers_list=['detect.stems.0.conv', + 'detect.stems.1.conv', + 'detect.stems.2.conv', + 'detect.cls_convs.0.conv', + 'detect.cls_convs.1.conv', + 'detect.cls_convs.2.conv', + 'detect.reg_convs.0.conv', + 'detect.reg_convs.1.conv', + 'detect.reg_convs.2.conv', + 'detect.cls_preds.0', + 'detect.cls_preds.1', + 'detect.cls_preds.2', + 'detect.reg_preds.0', + 'detect.reg_preds.1', + 'detect.reg_preds.2', + ], +) + +qat = dict( + calib_pt = './assets/yolov6s_v2_reopt_43.1_calib_histogram.pt', + sensitive_layers_skip = False, + sensitive_layers_list=['detect.stems.0.conv', + 'detect.stems.1.conv', + 'detect.stems.2.conv', + 'detect.cls_convs.0.conv', + 'detect.cls_convs.1.conv', + 'detect.cls_convs.2.conv', + 'detect.reg_convs.0.conv', + 'detect.reg_convs.1.conv', + 'detect.reg_convs.2.conv', + 'detect.cls_preds.0', + 'detect.cls_preds.1', + 'detect.cls_preds.2', + 'detect.reg_preds.0', + 'detect.reg_preds.1', + 'detect.reg_preds.2', + ], +) + +# Choose Rep-block by the training Mode, choices=["repvgg", "hyper-search", "repopt"] +training_mode='repopt' diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/README.md b/python/app/fedcv/YOLOv6/configs/yolov6_lite/README.md new file mode 100644 index 0000000000..170d12d921 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/README.md @@ -0,0 +1,22 @@ +## YOLOv6Lite model + +English | [简体中文](./README_cn.md) + +## Mobile Benchmark +| Model | Size | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | +| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | + +
+Table Notes + +- From the perspective of model size and input image ratio, we have built a series of models on the mobile terminal to facilitate flexible applications in different scenarios. +- All checkpoints are trained with 400 epochs without distillation. +- Results of the mAP and speed are evaluated on [COCO val2017](https://cocodataset.org/#download) dataset, and the input resolution is the Size in the table. +- Speed is tested on MNN 2.3.0 AArch64 with 2 threads by arm82 acceleration. The inference warm-up is performed 10 times, and the cycle is performed 100 times. +- Qualcomm 888(sm8350), Dimensity 720(mt6853) and Qualcomm 660(sdm660) correspond to chips with different performances at the high, middle and low end respectively, which can be used as a reference for model capabilities under different chips. +- Refer to [Test NCNN Speed](./docs/Test_NCNN_speed.md) tutorial to reproduce the NCNN speed results of YOLOv6Lite. diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/README_cn.md b/python/app/fedcv/YOLOv6/configs/yolov6_lite/README_cn.md new file mode 100644 index 0000000000..23dd715e13 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/README_cn.md @@ -0,0 +1,23 @@ +## YOLOv6 轻量级模型 + +简体中文 | [English](./README.md) + +## 移动端模型指标 + +| 模型 | 输入尺寸 | mAPval
0.5:0.95 | sm8350
(ms) | mt6853
(ms) | sdm660
(ms) |Params
(M) | FLOPs
(G) | +| :----------------------------------------------------------- | ---- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | -------------------- | +| [**YOLOv6Lite-S**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_s.pt) | 320*320 | 22.4 | 7.99 | 11.99 | 41.86 | 0.55 | 0.56 | +| [**YOLOv6Lite-M**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_m.pt) | 320*320 | 25.1 | 9.08 | 13.27 | 47.95 | 0.79 | 0.67 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*320 | 28.0 | 11.37 | 16.20 | 61.40 | 1.09 | 0.87 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 320*192 | 25.0 | 7.02 | 9.66 | 36.13 | 1.09 | 0.52 | +| [**YOLOv6Lite-L**](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6lite_l.pt) | 224*128 | 18.9 | 3.63 | 4.99 | 17.76 | 1.09 | 0.24 | + +
+表格笔记 + +- 从模型尺寸和输入图片比例两种角度,在构建了移动端系列模型,方便不同场景下的灵活应用。 +- 所有权重都经过 400 个 epoch 的训练,并且没有使用蒸馏技术。 +- mAP 和速度指标是在 COCO val2017 数据集上评估的,输入分辨率为表格中对应展示的。 +- 使用 MNN 2.3.0 AArch64 进行速度测试。测速时,采用2个线程,并开启arm82加速,推理预热10次,循环100次。 +- 高通888(sm8350)、天玑720(mt6853)和高通660(sdm660)分别对应高中低端不同性能的芯片,可以作为不同芯片下机型能力的参考。 +- [NCNN 速度测试](./docs/Test_NCNN_speed.md)教程可以帮助展示及复现 YOLOv6Lite 的 NCNN 速度结果。 diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l.py new file mode 100644 index 0000000000..212c8c73bc --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-l model +model = dict( + type='YOLOv6-lite-l', + pretrained=None, + width_multiple=1.5, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.1 * 4, + lrf=0.01, + momentum=0.9, + weight_decay=0.00004, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l_finetune.py new file mode 100644 index 0000000000..6effa765e3 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_l_finetune.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-l model +model = dict( + type='YOLOv6-lite-l', + pretrained='weights/yolov6_lite_l.pt', + width_multiple=1.5, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m.py new file mode 100644 index 0000000000..8f0de368d2 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-m model +model = dict( + type='YOLOv6-lite-m', + pretrained=None, + width_multiple=1.1, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.1 * 4, + lrf=0.01, + momentum=0.9, + weight_decay=0.00004, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m_finetune.py new file mode 100644 index 0000000000..09fcd5c5fb --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_m_finetune.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-m model +model = dict( + type='YOLOv6-lite-m', + pretrained='weights/yolov6_lite_m.pt', + width_multiple=1.1, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s.py new file mode 100644 index 0000000000..42a52e373b --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-s model +model = dict( + type='YOLOv6-lite-s', + pretrained=None, + width_multiple=0.7, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.1 * 4, + lrf=0.01, + momentum=0.9, + weight_decay=0.00004, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s_finetune.py new file mode 100644 index 0000000000..967e167664 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6_lite/yolov6_lite_s_finetune.py @@ -0,0 +1,54 @@ +# YOLOv6-lite-s model +model = dict( + type='YOLOv6-lite-s', + pretrained='weights/yolov6_lite_s.pt', + width_multiple=0.7, + backbone=dict( + type='Lite_EffiBackbone', + num_repeats=[1, 3, 7, 3], + out_channels=[24, 32, 64, 128, 256], + scale_size=0.5, + ), + neck=dict( + type='Lite_EffiNeck', + in_channels=[256, 128, 64], + unified_channels=96 + ), + head=dict( + type='Lite_EffideHead', + in_channels=[96, 96, 96, 96], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6l.py b/python/app/fedcv/YOLOv6/configs/yolov6l.py new file mode 100644 index 0000000000..bfa6728b52 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6l.py @@ -0,0 +1,68 @@ +# YOLOv6l model +model = dict( + type='YOLOv6l', + pretrained=None, + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) +training_mode = "conv_silu" +# use normal conv to speed up training and further improve accuracy. diff --git a/python/app/fedcv/YOLOv6/configs/yolov6l6.py b/python/app/fedcv/YOLOv6/configs/yolov6l6.py new file mode 100644 index 0000000000..3bb77c5f56 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6l6.py @@ -0,0 +1,62 @@ +# YOLOv6l6 model +model = dict( + type='YOLOv6l6', + pretrained=None, + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone_P6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck_P6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.2, +) +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/yolov6l6_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6l6_finetune.py new file mode 100644 index 0000000000..2ffb8ada89 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6l6_finetune.py @@ -0,0 +1,62 @@ +# YOLOv6l6 model +model = dict( + type='YOLOv6l6', + pretrained='weights/yolov6l6.pt', + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone_P6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck_P6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) +training_mode = "conv_silu" diff --git a/python/app/fedcv/YOLOv6/configs/yolov6l_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6l_finetune.py new file mode 100644 index 0000000000..9b3012338e --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6l_finetune.py @@ -0,0 +1,68 @@ +# YOLOv6l model +model = dict( + type='YOLOv6l', + pretrained='weights/yolov6l.pt', + depth_multiple=1.0, + width_multiple=1.0, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(1)/2, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(1)/2, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 2.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) +training_mode = "conv_silu" +# use normal conv to speed up training and further improve accuracy. diff --git a/python/app/fedcv/YOLOv6/configs/yolov6m.py b/python/app/fedcv/YOLOv6/configs/yolov6m.py new file mode 100644 index 0000000000..29fae396ea --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6m.py @@ -0,0 +1,66 @@ +# YOLOv6m model +model = dict( + type='YOLOv6m', + pretrained=None, + depth_multiple=0.60, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(2)/3, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(2)/3, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 0.8, + 'dfl': 1.0, + }, + ) +) + +solver=dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6m6.py b/python/app/fedcv/YOLOv6/configs/yolov6m6.py new file mode 100644 index 0000000000..e741bbc03a --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6m6.py @@ -0,0 +1,61 @@ +# YOLOv6m6 model +model = dict( + type='YOLOv6m6', + pretrained=None, + depth_multiple=0.60, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone_P6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + csp_e=float(2)/3, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck_P6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + csp_e=float(2)/3, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.9, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.1, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6m6_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6m6_finetune.py new file mode 100644 index 0000000000..83760d3a1d --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6m6_finetune.py @@ -0,0 +1,61 @@ +# YOLOv6m6 model +model = dict( + type='YOLOv6m6', + pretrained='weights/yolov6m6.pt', + depth_multiple=0.60, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone_P6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + csp_e=float(2)/3, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck_P6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + csp_e=float(2)/3, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6m_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6m_finetune.py new file mode 100644 index 0000000000..cfe0fa9358 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6m_finetune.py @@ -0,0 +1,66 @@ +# YOLOv6m model +model = dict( + type='YOLOv6m', + pretrained='weights/yolov6m.pt', + depth_multiple=0.60, + width_multiple=0.75, + backbone=dict( + type='CSPBepBackbone', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + csp_e=float(2)/3, + fuse_P2=True, + ), + neck=dict( + type='CSPRepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + csp_e=float(2)/3, + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=True, + reg_max=16, #if use_dfl is False, please set reg_max to 0 + distill_weight={ + 'class': 0.8, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6n.py b/python/app/fedcv/YOLOv6/configs/yolov6n.py new file mode 100644 index 0000000000..74f9386d79 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6n.py @@ -0,0 +1,65 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.02, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6n6.py b/python/app/fedcv/YOLOv6/configs/yolov6n6.py new file mode 100644 index 0000000000..0abe3a44d5 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6n6.py @@ -0,0 +1,56 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n6', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + fuse_P2=True, # if use RepBiFPANNeck6, please set fuse_P2 to True. + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.02, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6n6_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6n6_finetune.py new file mode 100644 index 0000000000..01100f0f63 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6n6_finetune.py @@ -0,0 +1,56 @@ +# YOLOv6n model +model = dict( + type='YOLOv6n6', + pretrained='weights/yolov6n6.pt', + depth_multiple=0.33, + width_multiple=0.25, + backbone=dict( + type='EfficientRep6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + fuse_P2=True, # if use RepBiFPANNeck6, please set fuse_P2 to True. + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='siou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6n_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6n_finetune.py similarity index 61% rename from python/app/fedcv/object_detection/model/yolov6/configs/yolov6n_finetune.py rename to python/app/fedcv/YOLOv6/configs/yolov6n_finetune.py index 7d1fab5a2c..03b6d1baab 100644 --- a/python/app/fedcv/object_detection/model/yolov6/configs/yolov6n_finetune.py +++ b/python/app/fedcv/YOLOv6/configs/yolov6n_finetune.py @@ -1,16 +1,18 @@ -# YOLOv6n model +# YOLOv6s model model = dict( type='YOLOv6n', - pretrained='./weights/yolov6n.pt', + pretrained='weights/yolov6n.pt', depth_multiple=0.33, width_multiple=0.25, backbone=dict( type='EfficientRep', num_repeats=[1, 6, 12, 18, 6], out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, ), neck=dict( - type='RepPAN', + type='RepBiFPANNeck', num_repeats=[12, 12, 12, 12], out_channels=[256, 128, 128, 256, 256, 512], ), @@ -19,10 +21,20 @@ in_channels=[128, 256, 512], num_layers=3, begin_indices=24, - anchors=1, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], out_indices=[17, 20, 23], strides=[8, 16, 32], - iou_type='ciou' + atss_warmup_epoch=0, + iou_type='siou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, ) ) @@ -49,5 +61,5 @@ flipud=0.00856, fliplr=0.5, mosaic=1.0, - mixup=0.243 + mixup=0.243, ) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6s.py b/python/app/fedcv/YOLOv6/configs/yolov6s.py new file mode 100644 index 0000000000..8d8b6739cd --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6s.py @@ -0,0 +1,65 @@ +# YOLOv6s model +model = dict( + type='YOLOv6s', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6s6.py b/python/app/fedcv/YOLOv6/configs/yolov6s6.py new file mode 100644 index 0000000000..091bfffca5 --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6s6.py @@ -0,0 +1,56 @@ +# YOLOv6n model +model = dict( + type='YOLOv6s6', + pretrained=None, + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + fuse_P2=True, # if use RepBiFPANNeck6, please set fuse_P2 to True. + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.01, + lrf=0.01, + momentum=0.937, + weight_decay=0.0005, + warmup_epochs=3.0, + warmup_momentum=0.8, + warmup_bias_lr=0.1 +) + +data_aug = dict( + hsv_h=0.015, + hsv_s=0.7, + hsv_v=0.4, + degrees=0.0, + translate=0.1, + scale=0.5, + shear=0.0, + flipud=0.0, + fliplr=0.5, + mosaic=1.0, + mixup=0.0, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6s6_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6s6_finetune.py new file mode 100644 index 0000000000..2986c94ddd --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6s6_finetune.py @@ -0,0 +1,56 @@ +# YOLOv6n model +model = dict( + type='YOLOv6s6', + pretrained='/mnt/data/xiaoyang/yolov6s6.pt', + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep6', + num_repeats=[1, 6, 12, 18, 6, 6], + out_channels=[64, 128, 256, 512, 768, 1024], + fuse_P2=True, # if use RepBiFPANNeck6, please set fuse_P2 to True. + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck6', + num_repeats=[12, 12, 12, 12, 12, 12], + out_channels=[512, 256, 128, 256, 512, 1024], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512, 1024], + num_layers=4, + anchors=1, + strides=[8, 16, 32, 64], + atss_warmup_epoch=4, + iou_type='giou', + use_dfl=False, + reg_max=0 #if use_dfl is False, please set reg_max to 0 + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/YOLOv6/configs/yolov6s_finetune.py b/python/app/fedcv/YOLOv6/configs/yolov6s_finetune.py new file mode 100644 index 0000000000..d6fb27fe8a --- /dev/null +++ b/python/app/fedcv/YOLOv6/configs/yolov6s_finetune.py @@ -0,0 +1,65 @@ +# YOLOv6s model +model = dict( + type='YOLOv6s', + pretrained='weights/yolov6s.pt', + depth_multiple=0.33, + width_multiple=0.50, + backbone=dict( + type='EfficientRep', + num_repeats=[1, 6, 12, 18, 6], + out_channels=[64, 128, 256, 512, 1024], + fuse_P2=True, + cspsppf=True, + ), + neck=dict( + type='RepBiFPANNeck', + num_repeats=[12, 12, 12, 12], + out_channels=[256, 128, 128, 256, 256, 512], + ), + head=dict( + type='EffiDeHead', + in_channels=[128, 256, 512], + num_layers=3, + begin_indices=24, + anchors=3, + anchors_init=[[10,13, 19,19, 33,23], + [30,61, 59,59, 59,119], + [116,90, 185,185, 373,326]], + out_indices=[17, 20, 23], + strides=[8, 16, 32], + atss_warmup_epoch=0, + iou_type='giou', + use_dfl=False, # set to True if you want to further train with distillation + reg_max=0, # set to 16 if you want to further train with distillation + distill_weight={ + 'class': 1.0, + 'dfl': 1.0, + }, + ) +) + +solver = dict( + optim='SGD', + lr_scheduler='Cosine', + lr0=0.0032, + lrf=0.12, + momentum=0.843, + weight_decay=0.00036, + warmup_epochs=2.0, + warmup_momentum=0.5, + warmup_bias_lr=0.05 +) + +data_aug = dict( + hsv_h=0.0138, + hsv_s=0.664, + hsv_v=0.464, + degrees=0.373, + translate=0.245, + scale=0.898, + shear=0.602, + flipud=0.00856, + fliplr=0.5, + mosaic=1.0, + mixup=0.243, +) diff --git a/python/app/fedcv/object_detection/model/yolov6/data/coco.yaml b/python/app/fedcv/YOLOv6/data/coco.yaml similarity index 93% rename from python/app/fedcv/object_detection/model/yolov6/data/coco.yaml rename to python/app/fedcv/YOLOv6/data/coco.yaml index 699551b91f..d20d411e68 100644 --- a/python/app/fedcv/object_detection/model/yolov6/data/coco.yaml +++ b/python/app/fedcv/YOLOv6/data/coco.yaml @@ -3,8 +3,11 @@ train: ../coco/images/train2017 # 118287 images val: ../coco/images/val2017 # 5000 images test: ../coco/images/test2017 anno_path: ../coco/annotations/instances_val2017.json + # number of classes nc: 80 +# whether it is coco dataset, only coco dataset should be set to True. +is_coco: True # class names names: [ 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light', diff --git a/python/app/fedcv/YOLOv6/data/dataset.yaml b/python/app/fedcv/YOLOv6/data/dataset.yaml new file mode 100644 index 0000000000..6e02692159 --- /dev/null +++ b/python/app/fedcv/YOLOv6/data/dataset.yaml @@ -0,0 +1,11 @@ +# Please insure that your custom_dataset are put in same parent dir with YOLOv6_DIR +train: ../custom_dataset/images/train # train images +val: ../custom_dataset/images/val # val images +test: ../custom_dataset/images/test # test images (optional) + +# whether it is coco dataset, only coco dataset should be set to True. +is_coco: False +# Classes +nc: 20 # number of classes +names: ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', + 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'] # class names diff --git a/python/app/fedcv/YOLOv6/data/voc.yaml b/python/app/fedcv/YOLOv6/data/voc.yaml new file mode 100644 index 0000000000..ba0e329719 --- /dev/null +++ b/python/app/fedcv/YOLOv6/data/voc.yaml @@ -0,0 +1,10 @@ +train: /mnt/data/xiaoyang/VOCdevkit/voc_07_12/images/train # train images +val: /mnt/data/xiaoyang/VOCdevkit/voc_07_12/images/val # val images +test: /mnt/data/xiaoyang/VOCdevkit/voc_07_12/images/val # test images (optional) + +# whether it is coco dataset, only coco dataset should be set to True. +is_coco: False +# Classes +nc: 20 # number of classes +names: ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', + 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'] # class names diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/README.md b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/README.md new file mode 100644 index 0000000000..50b03db8a7 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/README.md @@ -0,0 +1,42 @@ +# ncnn-android-yolov6 + +The YOLOv6 object detection demo of `Android`. +You can directly download apk file from [Android Demo here](https://github.com/meituan/YOLOv6/releases/download/0.4.0/yolov6-android-demo.apk), many thanks to [triple Mu](https://github.com/triple-Mu). + +This is a sample ncnn android project, it depends on ncnn library and opencv + +- [ncnn](https://github.com/Tencent/ncnn) + +- [opencv-mobile](https://github.com/nihui/opencv-mobile) + + +## How to build and run +### step1 + +* Download [ncnn-YYYYMMDD-android-vulkan.zip](https://github.com/Tencent/ncnn/releases) or build ncnn for android yourself +* Extract `ncnn-YYYYMMDD-android-vulkan.zip` into `app/src/main/jni` and change the `ncnn_DIR` path to yours in `app/src/main/jni/CMakeLists.txt` + +### step2 + +* Download [opencv-mobile-XYZ-android.zip](https://github.com/nihui/opencv-mobile) +* Extract `opencv-mobile-XYZ-android.zip` into `app/src/main/jni` and change the `OpenCV_DIR` path to yours in `app/src/main/jni/CMakeLists.txt` + +### step3 +* download [AndroidAssets.zip +](https://github.com/meituan/YOLOv6/releases/download/0.4.0/AndroidAssets.zip) +* Unzip `AndroidAssets.zip`, you will get a directory named as `assets`, move it +into `app/src/`. + +### step4 +* Open this project with Android Studio, build it and enjoy! + +## some notes +* Android ndk camera is used for best efficiency +* Crash may happen on very old devices for lacking HAL3 camera interface +* All models are manually modified to accept dynamic input shape +* Most small models run slower on GPU than on CPU, this is common +* FPS may be lower in dark environment because of longer camera exposure time + +## Reference: +- [ncnn-android-nanodet](https://github.com/nihui/ncnn-android-nanodet) +- [ncnn](https://github.com/Tencent/ncnn) diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/build.gradle b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/build.gradle new file mode 100644 index 0000000000..8f40b22f3f --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/build.gradle @@ -0,0 +1,29 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 24 + + defaultConfig { + applicationId "com.tencent.yolov6ncnn" + archivesBaseName = "$applicationId" + + minSdkVersion 24 + } + + externalNativeBuild { + cmake { + version "3.10.2" + path file('src/main/jni/CMakeLists.txt') + } + } + + dependencies { + implementation 'com.android.support:support-v4:24.0.0' + } + ndkVersion '24.0.8215888' + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + namespace 'com.tencent.yolov6ncnn' +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/AndroidManifest.xml b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..ec48a5281e --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.bin b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.bin new file mode 100644 index 0000000000..2084b07450 Binary files /dev/null and b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.bin differ diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.param b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.param new file mode 100644 index 0000000000..35386a8aa8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l0.param @@ -0,0 +1,379 @@ +7767517 +377 421 +Input in0 0 1 in0 +Convolution conv_28 1 1 in0 1 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 +HardSwish hswish_154 1 1 1 2 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_0 1 2 2 3 4 +ConvolutionDepthWise convdw_270 1 1 4 5 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Convolution conv_29 1 1 5 6 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +Convolution conv_30 1 1 3 7 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_156 1 1 7 8 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_271 1 1 8 9 0=12 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=108 7=12 +Split splitncnn_1 1 2 9 10 11 +Pooling gap_4 1 1 11 12 0=1 4=1 +Convolution convrelu_0 1 1 12 13 0=3 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 9=1 +Convolution conv_32 1 1 13 14 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 +HardSigmoid hsigmoid_140 1 1 14 15 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_0 2 1 10 15 16 0=2 +Convolution conv_33 1 1 16 17 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_157 1 1 17 18 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_155 1 1 6 19 0=1.666667e-01 1=5.000000e-01 +Concat cat_0 2 1 19 18 20 0=0 +ConvolutionDepthWise convdw_272 1 1 20 21 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +HardSwish hswish_158 1 1 21 22 0=1.666667e-01 1=5.000000e-01 +Convolution conv_34 1 1 22 23 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_159 1 1 23 24 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_2 1 2 24 25 26 +ConvolutionDepthWise convdw_273 1 1 26 27 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Convolution conv_35 1 1 27 28 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_36 1 1 25 29 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_161 1 1 29 30 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_274 1 1 30 31 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Split splitncnn_3 1 2 31 32 33 +Pooling gap_5 1 1 33 34 0=1 4=1 +Convolution convrelu_1 1 1 34 35 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_38 1 1 35 36 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_141 1 1 36 37 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_1 2 1 32 37 38 0=2 +Convolution conv_39 1 1 38 39 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_162 1 1 39 40 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_160 1 1 28 41 0=1.666667e-01 1=5.000000e-01 +Concat cat_1 2 1 41 40 42 0=0 +ConvolutionDepthWise convdw_275 1 1 42 43 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +HardSwish hswish_163 1 1 43 44 0=1.666667e-01 1=5.000000e-01 +Convolution conv_40 1 1 44 45 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_164 1 1 45 46 0=1.666667e-01 1=5.000000e-01 +Slice split_0 1 2 46 47 48 -23300=2,48,48 1=0 +Convolution conv_41 1 1 48 49 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_165 1 1 49 50 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_276 1 1 50 51 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_4 1 2 51 52 53 +Pooling gap_6 1 1 53 54 0=1 4=1 +Convolution convrelu_2 1 1 54 55 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_43 1 1 55 56 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_142 1 1 56 57 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_2 2 1 52 57 58 0=2 +Convolution conv_44 1 1 58 59 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_166 1 1 59 60 0=1.666667e-01 1=5.000000e-01 +Concat cat_2 2 1 47 60 61 0=0 +ShuffleChannel channelshuffle_18 1 1 61 62 0=2 1=0 +Slice split_1 1 2 62 63 64 -23300=2,48,48 1=0 +Convolution conv_45 1 1 64 65 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_167 1 1 65 66 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_277 1 1 66 67 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_5 1 2 67 68 69 +Pooling gap_7 1 1 69 70 0=1 4=1 +Convolution convrelu_3 1 1 70 71 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_47 1 1 71 72 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_143 1 1 72 73 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_3 2 1 68 73 74 0=2 +Convolution conv_48 1 1 74 75 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_168 1 1 75 76 0=1.666667e-01 1=5.000000e-01 +Concat cat_3 2 1 63 76 77 0=0 +ShuffleChannel channelshuffle_19 1 1 77 78 0=2 1=0 +Split splitncnn_6 1 3 78 79 80 81 +ConvolutionDepthWise convdw_278 1 1 81 82 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Convolution conv_49 1 1 82 83 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +Convolution conv_50 1 1 80 84 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_170 1 1 84 85 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_279 1 1 85 86 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Split splitncnn_7 1 2 86 87 88 +Pooling gap_8 1 1 88 89 0=1 4=1 +Convolution convrelu_4 1 1 89 90 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_52 1 1 90 91 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_144 1 1 91 92 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_4 2 1 87 92 93 0=2 +Convolution conv_53 1 1 93 94 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_171 1 1 94 95 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_169 1 1 83 96 0=1.666667e-01 1=5.000000e-01 +Concat cat_4 2 1 96 95 97 0=0 +ConvolutionDepthWise convdw_280 1 1 97 98 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +HardSwish hswish_172 1 1 98 99 0=1.666667e-01 1=5.000000e-01 +Convolution conv_54 1 1 99 100 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_173 1 1 100 101 0=1.666667e-01 1=5.000000e-01 +Slice split_2 1 2 101 102 103 -23300=2,96,96 1=0 +Convolution conv_55 1 1 103 104 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_174 1 1 104 105 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_281 1 1 105 106 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_8 1 2 106 107 108 +Pooling gap_9 1 1 108 109 0=1 4=1 +Convolution convrelu_5 1 1 109 110 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_57 1 1 110 111 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_145 1 1 111 112 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_5 2 1 107 112 113 0=2 +Convolution conv_58 1 1 113 114 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_175 1 1 114 115 0=1.666667e-01 1=5.000000e-01 +Concat cat_5 2 1 102 115 116 0=0 +ShuffleChannel channelshuffle_20 1 1 116 117 0=2 1=0 +Slice split_3 1 2 117 118 119 -23300=2,96,96 1=0 +Convolution conv_59 1 1 119 120 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_176 1 1 120 121 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_282 1 1 121 122 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_9 1 2 122 123 124 +Pooling gap_10 1 1 124 125 0=1 4=1 +Convolution convrelu_6 1 1 125 126 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_61 1 1 126 127 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_146 1 1 127 128 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_6 2 1 123 128 129 0=2 +Convolution conv_62 1 1 129 130 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_177 1 1 130 131 0=1.666667e-01 1=5.000000e-01 +Concat cat_6 2 1 118 131 132 0=0 +ShuffleChannel channelshuffle_21 1 1 132 133 0=2 1=0 +Slice split_4 1 2 133 134 135 -23300=2,96,96 1=0 +Convolution conv_63 1 1 135 136 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_178 1 1 136 137 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_283 1 1 137 138 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_10 1 2 138 139 140 +Pooling gap_11 1 1 140 141 0=1 4=1 +Convolution convrelu_7 1 1 141 142 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_65 1 1 142 143 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_147 1 1 143 144 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_7 2 1 139 144 145 0=2 +Convolution conv_66 1 1 145 146 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_179 1 1 146 147 0=1.666667e-01 1=5.000000e-01 +Concat cat_7 2 1 134 147 148 0=0 +ShuffleChannel channelshuffle_22 1 1 148 149 0=2 1=0 +Slice split_5 1 2 149 150 151 -23300=2,96,96 1=0 +Convolution conv_67 1 1 151 152 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_180 1 1 152 153 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_284 1 1 153 154 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_11 1 2 154 155 156 +Pooling gap_12 1 1 156 157 0=1 4=1 +Convolution convrelu_8 1 1 157 158 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_69 1 1 158 159 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_148 1 1 159 160 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_8 2 1 155 160 161 0=2 +Convolution conv_70 1 1 161 162 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_181 1 1 162 163 0=1.666667e-01 1=5.000000e-01 +Concat cat_8 2 1 150 163 164 0=0 +ShuffleChannel channelshuffle_23 1 1 164 165 0=2 1=0 +Slice split_6 1 2 165 166 167 -23300=2,96,96 1=0 +Convolution conv_71 1 1 167 168 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_182 1 1 168 169 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_285 1 1 169 170 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_12 1 2 170 171 172 +Pooling gap_13 1 1 172 173 0=1 4=1 +Convolution convrelu_9 1 1 173 174 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_73 1 1 174 175 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_149 1 1 175 176 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_9 2 1 171 176 177 0=2 +Convolution conv_74 1 1 177 178 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_183 1 1 178 179 0=1.666667e-01 1=5.000000e-01 +Concat cat_9 2 1 166 179 180 0=0 +ShuffleChannel channelshuffle_24 1 1 180 181 0=2 1=0 +Slice split_7 1 2 181 182 183 -23300=2,96,96 1=0 +Convolution conv_75 1 1 183 184 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_184 1 1 184 185 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_286 1 1 185 186 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_13 1 2 186 187 188 +Pooling gap_14 1 1 188 189 0=1 4=1 +Convolution convrelu_10 1 1 189 190 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_77 1 1 190 191 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_150 1 1 191 192 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_10 2 1 187 192 193 0=2 +Convolution conv_78 1 1 193 194 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_185 1 1 194 195 0=1.666667e-01 1=5.000000e-01 +Concat cat_10 2 1 182 195 196 0=0 +ShuffleChannel channelshuffle_25 1 1 196 197 0=2 1=0 +Split splitncnn_14 1 3 197 198 199 200 +ConvolutionDepthWise convdw_287 1 1 200 201 0=192 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=1728 7=192 +Convolution conv_79 1 1 201 202 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_80 1 1 199 203 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_187 1 1 203 204 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_288 1 1 204 205 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Split splitncnn_15 1 2 205 206 207 +Pooling gap_15 1 1 207 208 0=1 4=1 +Convolution convrelu_11 1 1 208 209 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_82 1 1 209 210 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_151 1 1 210 211 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_11 2 1 206 211 212 0=2 +Convolution conv_83 1 1 212 213 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_188 1 1 213 214 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_186 1 1 202 215 0=1.666667e-01 1=5.000000e-01 +Concat cat_11 2 1 215 214 216 0=0 +ConvolutionDepthWise convdw_289 1 1 216 217 0=384 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=3456 7=384 +HardSwish hswish_189 1 1 217 218 0=1.666667e-01 1=5.000000e-01 +Convolution conv_84 1 1 218 219 0=384 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=147456 +HardSwish hswish_190 1 1 219 220 0=1.666667e-01 1=5.000000e-01 +Slice split_8 1 2 220 221 222 -23300=2,192,192 1=0 +Convolution conv_85 1 1 222 223 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_191 1 1 223 224 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_290 1 1 224 225 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_16 1 2 225 226 227 +Pooling gap_16 1 1 227 228 0=1 4=1 +Convolution convrelu_12 1 1 228 229 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_87 1 1 229 230 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_152 1 1 230 231 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_12 2 1 226 231 232 0=2 +Convolution conv_88 1 1 232 233 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_192 1 1 233 234 0=1.666667e-01 1=5.000000e-01 +Concat cat_12 2 1 221 234 235 0=0 +ShuffleChannel channelshuffle_26 1 1 235 236 0=2 1=0 +Slice split_9 1 2 236 237 238 -23300=2,192,192 1=0 +Convolution conv_89 1 1 238 239 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_193 1 1 239 240 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_291 1 1 240 241 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_17 1 2 241 242 243 +Pooling gap_17 1 1 243 244 0=1 4=1 +Convolution convrelu_13 1 1 244 245 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_91 1 1 245 246 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_153 1 1 246 247 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_13 2 1 242 247 248 0=2 +Convolution conv_92 1 1 248 249 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_194 1 1 249 250 0=1.666667e-01 1=5.000000e-01 +Concat cat_13 2 1 237 250 251 0=0 +ShuffleChannel channelshuffle_27 1 1 251 252 0=2 1=0 +Convolution conv_93 1 1 252 253 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_94 1 1 198 254 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +Convolution conv_95 1 1 79 255 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_195 1 1 253 256 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_18 1 3 256 257 258 259 +HardSwish hswish_196 1 1 254 260 0=1.666667e-01 1=5.000000e-01 +Interp upsample_268 1 1 258 261 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_14 2 1 261 260 262 0=0 +Split splitncnn_19 1 2 262 263 264 +Convolution conv_96 1 1 264 265 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_198 1 1 265 266 0=1.666667e-01 1=5.000000e-01 +Convolution conv_97 1 1 266 267 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_199 1 1 267 268 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_292 1 1 268 269 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_200 1 1 269 270 0=1.666667e-01 1=5.000000e-01 +Convolution conv_98 1 1 270 271 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_99 1 1 263 272 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_202 1 1 272 273 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_201 1 1 271 274 0=1.666667e-01 1=5.000000e-01 +Concat cat_15 2 1 274 273 275 0=0 +Convolution conv_100 1 1 275 276 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_203 1 1 276 277 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_20 1 2 277 278 279 +HardSwish hswish_197 1 1 255 280 0=1.666667e-01 1=5.000000e-01 +Interp upsample_269 1 1 279 281 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_16 2 1 281 280 282 0=0 +Split splitncnn_21 1 2 282 283 284 +Convolution conv_101 1 1 284 285 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_204 1 1 285 286 0=1.666667e-01 1=5.000000e-01 +Convolution conv_102 1 1 286 287 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_205 1 1 287 288 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_293 1 1 288 289 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_206 1 1 289 290 0=1.666667e-01 1=5.000000e-01 +Convolution conv_103 1 1 290 291 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_104 1 1 283 292 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_208 1 1 292 293 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_207 1 1 291 294 0=1.666667e-01 1=5.000000e-01 +Concat cat_17 2 1 294 293 295 0=0 +Convolution conv_105 1 1 295 296 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_209 1 1 296 297 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_22 1 2 297 298 299 +ConvolutionDepthWise convdw_294 1 1 299 300 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_210 1 1 300 301 0=1.666667e-01 1=5.000000e-01 +Convolution conv_106 1 1 301 302 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_211 1 1 302 303 0=1.666667e-01 1=5.000000e-01 +Concat cat_18 2 1 303 278 304 0=0 +Split splitncnn_23 1 2 304 305 306 +Convolution conv_107 1 1 306 307 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_212 1 1 307 308 0=1.666667e-01 1=5.000000e-01 +Convolution conv_108 1 1 308 309 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_213 1 1 309 310 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_295 1 1 310 311 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_214 1 1 311 312 0=1.666667e-01 1=5.000000e-01 +Convolution conv_109 1 1 312 313 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_110 1 1 305 314 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_216 1 1 314 315 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_215 1 1 313 316 0=1.666667e-01 1=5.000000e-01 +Concat cat_19 2 1 316 315 317 0=0 +Convolution conv_111 1 1 317 318 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_217 1 1 318 319 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_24 1 2 319 320 321 +ConvolutionDepthWise convdw_296 1 1 321 322 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_218 1 1 322 323 0=1.666667e-01 1=5.000000e-01 +Convolution conv_112 1 1 323 324 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_219 1 1 324 325 0=1.666667e-01 1=5.000000e-01 +Concat cat_20 2 1 325 257 326 0=0 +Split splitncnn_25 1 2 326 327 328 +Convolution conv_113 1 1 328 329 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_220 1 1 329 330 0=1.666667e-01 1=5.000000e-01 +Convolution conv_114 1 1 330 331 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_221 1 1 331 332 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_297 1 1 332 333 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_222 1 1 333 334 0=1.666667e-01 1=5.000000e-01 +Convolution conv_115 1 1 334 335 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_116 1 1 327 336 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_224 1 1 336 337 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_223 1 1 335 338 0=1.666667e-01 1=5.000000e-01 +Concat cat_21 2 1 338 337 339 0=0 +Convolution conv_117 1 1 339 340 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_298 1 1 259 341 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_226 1 1 341 342 0=1.666667e-01 1=5.000000e-01 +Convolution conv_118 1 1 342 343 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_225 1 1 340 344 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_26 1 2 344 345 346 +ConvolutionDepthWise convdw_299 1 1 346 347 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_228 1 1 347 348 0=1.666667e-01 1=5.000000e-01 +Convolution conv_119 1 1 348 349 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_229 1 1 349 350 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_227 1 1 343 351 0=1.666667e-01 1=5.000000e-01 +BinaryOp add_14 2 1 351 350 352 0=0 +ConvolutionDepthWise convdw_300 1 1 298 353 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_230 1 1 353 354 0=1.666667e-01 1=5.000000e-01 +Convolution conv_120 1 1 354 355 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_231 1 1 355 356 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_27 1 2 356 357 358 +ConvolutionDepthWise convdw_301 1 1 358 359 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_232 1 1 359 360 0=1.666667e-01 1=5.000000e-01 +Convolution conv_121 1 1 360 361 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_302 1 1 357 362 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_234 1 1 362 363 0=1.666667e-01 1=5.000000e-01 +Convolution conv_123 1 1 363 364 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_303 1 1 320 365 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_236 1 1 365 366 0=1.666667e-01 1=5.000000e-01 +Convolution conv_125 1 1 366 367 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_237 1 1 367 368 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_28 1 2 368 369 370 +ConvolutionDepthWise convdw_304 1 1 370 371 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_238 1 1 371 372 0=1.666667e-01 1=5.000000e-01 +Convolution conv_126 1 1 372 373 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_305 1 1 369 374 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_240 1 1 374 375 0=1.666667e-01 1=5.000000e-01 +Convolution conv_128 1 1 375 376 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_306 1 1 345 377 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_242 1 1 377 378 0=1.666667e-01 1=5.000000e-01 +Convolution conv_130 1 1 378 379 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_243 1 1 379 380 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_29 1 2 380 381 382 +ConvolutionDepthWise convdw_307 1 1 382 383 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_244 1 1 383 384 0=1.666667e-01 1=5.000000e-01 +Convolution conv_131 1 1 384 385 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_308 1 1 381 386 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_246 1 1 386 387 0=1.666667e-01 1=5.000000e-01 +Convolution conv_133 1 1 387 388 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_309 1 1 352 389 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_248 1 1 389 390 0=1.666667e-01 1=5.000000e-01 +Convolution conv_135 1 1 390 391 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_249 1 1 391 392 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_30 1 2 392 393 394 +ConvolutionDepthWise convdw_310 1 1 394 395 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_250 1 1 395 396 0=1.666667e-01 1=5.000000e-01 +Convolution conv_136 1 1 396 397 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_311 1 1 393 398 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_252 1 1 398 399 0=1.666667e-01 1=5.000000e-01 +Convolution conv_138 1 1 399 400 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_251 1 1 397 401 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_253 1 1 400 402 0=1.666667e-01 1=5.000000e-01 +Convolution conv_139 1 1 402 403 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_14 1 1 401 404 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_22 2 1 404 403 out3 0=0 +HardSwish hswish_245 1 1 385 406 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_247 1 1 388 407 0=1.666667e-01 1=5.000000e-01 +Convolution conv_134 1 1 407 408 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_15 1 1 406 409 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_23 2 1 409 408 out2 0=0 +HardSwish hswish_239 1 1 373 411 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_241 1 1 376 412 0=1.666667e-01 1=5.000000e-01 +Convolution conv_129 1 1 412 413 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_16 1 1 411 414 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_24 2 1 414 413 out1 0=0 +HardSwish hswish_233 1 1 361 416 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_235 1 1 364 417 0=1.666667e-01 1=5.000000e-01 +Convolution conv_124 1 1 417 418 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_17 1 1 416 419 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_25 2 1 419 418 out0 0=0 diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.bin b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.bin new file mode 100644 index 0000000000..2084b07450 Binary files /dev/null and b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.bin differ diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.param b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.param new file mode 100644 index 0000000000..35386a8aa8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l1.param @@ -0,0 +1,379 @@ +7767517 +377 421 +Input in0 0 1 in0 +Convolution conv_28 1 1 in0 1 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 +HardSwish hswish_154 1 1 1 2 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_0 1 2 2 3 4 +ConvolutionDepthWise convdw_270 1 1 4 5 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Convolution conv_29 1 1 5 6 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +Convolution conv_30 1 1 3 7 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_156 1 1 7 8 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_271 1 1 8 9 0=12 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=108 7=12 +Split splitncnn_1 1 2 9 10 11 +Pooling gap_4 1 1 11 12 0=1 4=1 +Convolution convrelu_0 1 1 12 13 0=3 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 9=1 +Convolution conv_32 1 1 13 14 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 +HardSigmoid hsigmoid_140 1 1 14 15 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_0 2 1 10 15 16 0=2 +Convolution conv_33 1 1 16 17 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_157 1 1 17 18 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_155 1 1 6 19 0=1.666667e-01 1=5.000000e-01 +Concat cat_0 2 1 19 18 20 0=0 +ConvolutionDepthWise convdw_272 1 1 20 21 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +HardSwish hswish_158 1 1 21 22 0=1.666667e-01 1=5.000000e-01 +Convolution conv_34 1 1 22 23 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_159 1 1 23 24 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_2 1 2 24 25 26 +ConvolutionDepthWise convdw_273 1 1 26 27 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Convolution conv_35 1 1 27 28 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_36 1 1 25 29 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_161 1 1 29 30 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_274 1 1 30 31 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Split splitncnn_3 1 2 31 32 33 +Pooling gap_5 1 1 33 34 0=1 4=1 +Convolution convrelu_1 1 1 34 35 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_38 1 1 35 36 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_141 1 1 36 37 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_1 2 1 32 37 38 0=2 +Convolution conv_39 1 1 38 39 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_162 1 1 39 40 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_160 1 1 28 41 0=1.666667e-01 1=5.000000e-01 +Concat cat_1 2 1 41 40 42 0=0 +ConvolutionDepthWise convdw_275 1 1 42 43 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +HardSwish hswish_163 1 1 43 44 0=1.666667e-01 1=5.000000e-01 +Convolution conv_40 1 1 44 45 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_164 1 1 45 46 0=1.666667e-01 1=5.000000e-01 +Slice split_0 1 2 46 47 48 -23300=2,48,48 1=0 +Convolution conv_41 1 1 48 49 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_165 1 1 49 50 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_276 1 1 50 51 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_4 1 2 51 52 53 +Pooling gap_6 1 1 53 54 0=1 4=1 +Convolution convrelu_2 1 1 54 55 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_43 1 1 55 56 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_142 1 1 56 57 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_2 2 1 52 57 58 0=2 +Convolution conv_44 1 1 58 59 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_166 1 1 59 60 0=1.666667e-01 1=5.000000e-01 +Concat cat_2 2 1 47 60 61 0=0 +ShuffleChannel channelshuffle_18 1 1 61 62 0=2 1=0 +Slice split_1 1 2 62 63 64 -23300=2,48,48 1=0 +Convolution conv_45 1 1 64 65 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_167 1 1 65 66 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_277 1 1 66 67 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_5 1 2 67 68 69 +Pooling gap_7 1 1 69 70 0=1 4=1 +Convolution convrelu_3 1 1 70 71 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_47 1 1 71 72 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_143 1 1 72 73 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_3 2 1 68 73 74 0=2 +Convolution conv_48 1 1 74 75 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_168 1 1 75 76 0=1.666667e-01 1=5.000000e-01 +Concat cat_3 2 1 63 76 77 0=0 +ShuffleChannel channelshuffle_19 1 1 77 78 0=2 1=0 +Split splitncnn_6 1 3 78 79 80 81 +ConvolutionDepthWise convdw_278 1 1 81 82 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Convolution conv_49 1 1 82 83 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +Convolution conv_50 1 1 80 84 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_170 1 1 84 85 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_279 1 1 85 86 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Split splitncnn_7 1 2 86 87 88 +Pooling gap_8 1 1 88 89 0=1 4=1 +Convolution convrelu_4 1 1 89 90 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_52 1 1 90 91 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_144 1 1 91 92 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_4 2 1 87 92 93 0=2 +Convolution conv_53 1 1 93 94 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_171 1 1 94 95 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_169 1 1 83 96 0=1.666667e-01 1=5.000000e-01 +Concat cat_4 2 1 96 95 97 0=0 +ConvolutionDepthWise convdw_280 1 1 97 98 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +HardSwish hswish_172 1 1 98 99 0=1.666667e-01 1=5.000000e-01 +Convolution conv_54 1 1 99 100 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_173 1 1 100 101 0=1.666667e-01 1=5.000000e-01 +Slice split_2 1 2 101 102 103 -23300=2,96,96 1=0 +Convolution conv_55 1 1 103 104 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_174 1 1 104 105 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_281 1 1 105 106 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_8 1 2 106 107 108 +Pooling gap_9 1 1 108 109 0=1 4=1 +Convolution convrelu_5 1 1 109 110 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_57 1 1 110 111 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_145 1 1 111 112 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_5 2 1 107 112 113 0=2 +Convolution conv_58 1 1 113 114 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_175 1 1 114 115 0=1.666667e-01 1=5.000000e-01 +Concat cat_5 2 1 102 115 116 0=0 +ShuffleChannel channelshuffle_20 1 1 116 117 0=2 1=0 +Slice split_3 1 2 117 118 119 -23300=2,96,96 1=0 +Convolution conv_59 1 1 119 120 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_176 1 1 120 121 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_282 1 1 121 122 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_9 1 2 122 123 124 +Pooling gap_10 1 1 124 125 0=1 4=1 +Convolution convrelu_6 1 1 125 126 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_61 1 1 126 127 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_146 1 1 127 128 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_6 2 1 123 128 129 0=2 +Convolution conv_62 1 1 129 130 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_177 1 1 130 131 0=1.666667e-01 1=5.000000e-01 +Concat cat_6 2 1 118 131 132 0=0 +ShuffleChannel channelshuffle_21 1 1 132 133 0=2 1=0 +Slice split_4 1 2 133 134 135 -23300=2,96,96 1=0 +Convolution conv_63 1 1 135 136 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_178 1 1 136 137 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_283 1 1 137 138 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_10 1 2 138 139 140 +Pooling gap_11 1 1 140 141 0=1 4=1 +Convolution convrelu_7 1 1 141 142 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_65 1 1 142 143 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_147 1 1 143 144 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_7 2 1 139 144 145 0=2 +Convolution conv_66 1 1 145 146 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_179 1 1 146 147 0=1.666667e-01 1=5.000000e-01 +Concat cat_7 2 1 134 147 148 0=0 +ShuffleChannel channelshuffle_22 1 1 148 149 0=2 1=0 +Slice split_5 1 2 149 150 151 -23300=2,96,96 1=0 +Convolution conv_67 1 1 151 152 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_180 1 1 152 153 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_284 1 1 153 154 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_11 1 2 154 155 156 +Pooling gap_12 1 1 156 157 0=1 4=1 +Convolution convrelu_8 1 1 157 158 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_69 1 1 158 159 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_148 1 1 159 160 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_8 2 1 155 160 161 0=2 +Convolution conv_70 1 1 161 162 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_181 1 1 162 163 0=1.666667e-01 1=5.000000e-01 +Concat cat_8 2 1 150 163 164 0=0 +ShuffleChannel channelshuffle_23 1 1 164 165 0=2 1=0 +Slice split_6 1 2 165 166 167 -23300=2,96,96 1=0 +Convolution conv_71 1 1 167 168 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_182 1 1 168 169 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_285 1 1 169 170 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_12 1 2 170 171 172 +Pooling gap_13 1 1 172 173 0=1 4=1 +Convolution convrelu_9 1 1 173 174 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_73 1 1 174 175 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_149 1 1 175 176 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_9 2 1 171 176 177 0=2 +Convolution conv_74 1 1 177 178 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_183 1 1 178 179 0=1.666667e-01 1=5.000000e-01 +Concat cat_9 2 1 166 179 180 0=0 +ShuffleChannel channelshuffle_24 1 1 180 181 0=2 1=0 +Slice split_7 1 2 181 182 183 -23300=2,96,96 1=0 +Convolution conv_75 1 1 183 184 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_184 1 1 184 185 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_286 1 1 185 186 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_13 1 2 186 187 188 +Pooling gap_14 1 1 188 189 0=1 4=1 +Convolution convrelu_10 1 1 189 190 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_77 1 1 190 191 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_150 1 1 191 192 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_10 2 1 187 192 193 0=2 +Convolution conv_78 1 1 193 194 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_185 1 1 194 195 0=1.666667e-01 1=5.000000e-01 +Concat cat_10 2 1 182 195 196 0=0 +ShuffleChannel channelshuffle_25 1 1 196 197 0=2 1=0 +Split splitncnn_14 1 3 197 198 199 200 +ConvolutionDepthWise convdw_287 1 1 200 201 0=192 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=1728 7=192 +Convolution conv_79 1 1 201 202 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_80 1 1 199 203 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_187 1 1 203 204 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_288 1 1 204 205 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Split splitncnn_15 1 2 205 206 207 +Pooling gap_15 1 1 207 208 0=1 4=1 +Convolution convrelu_11 1 1 208 209 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_82 1 1 209 210 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_151 1 1 210 211 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_11 2 1 206 211 212 0=2 +Convolution conv_83 1 1 212 213 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_188 1 1 213 214 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_186 1 1 202 215 0=1.666667e-01 1=5.000000e-01 +Concat cat_11 2 1 215 214 216 0=0 +ConvolutionDepthWise convdw_289 1 1 216 217 0=384 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=3456 7=384 +HardSwish hswish_189 1 1 217 218 0=1.666667e-01 1=5.000000e-01 +Convolution conv_84 1 1 218 219 0=384 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=147456 +HardSwish hswish_190 1 1 219 220 0=1.666667e-01 1=5.000000e-01 +Slice split_8 1 2 220 221 222 -23300=2,192,192 1=0 +Convolution conv_85 1 1 222 223 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_191 1 1 223 224 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_290 1 1 224 225 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_16 1 2 225 226 227 +Pooling gap_16 1 1 227 228 0=1 4=1 +Convolution convrelu_12 1 1 228 229 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_87 1 1 229 230 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_152 1 1 230 231 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_12 2 1 226 231 232 0=2 +Convolution conv_88 1 1 232 233 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_192 1 1 233 234 0=1.666667e-01 1=5.000000e-01 +Concat cat_12 2 1 221 234 235 0=0 +ShuffleChannel channelshuffle_26 1 1 235 236 0=2 1=0 +Slice split_9 1 2 236 237 238 -23300=2,192,192 1=0 +Convolution conv_89 1 1 238 239 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_193 1 1 239 240 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_291 1 1 240 241 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_17 1 2 241 242 243 +Pooling gap_17 1 1 243 244 0=1 4=1 +Convolution convrelu_13 1 1 244 245 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_91 1 1 245 246 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_153 1 1 246 247 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_13 2 1 242 247 248 0=2 +Convolution conv_92 1 1 248 249 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_194 1 1 249 250 0=1.666667e-01 1=5.000000e-01 +Concat cat_13 2 1 237 250 251 0=0 +ShuffleChannel channelshuffle_27 1 1 251 252 0=2 1=0 +Convolution conv_93 1 1 252 253 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_94 1 1 198 254 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +Convolution conv_95 1 1 79 255 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_195 1 1 253 256 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_18 1 3 256 257 258 259 +HardSwish hswish_196 1 1 254 260 0=1.666667e-01 1=5.000000e-01 +Interp upsample_268 1 1 258 261 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_14 2 1 261 260 262 0=0 +Split splitncnn_19 1 2 262 263 264 +Convolution conv_96 1 1 264 265 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_198 1 1 265 266 0=1.666667e-01 1=5.000000e-01 +Convolution conv_97 1 1 266 267 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_199 1 1 267 268 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_292 1 1 268 269 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_200 1 1 269 270 0=1.666667e-01 1=5.000000e-01 +Convolution conv_98 1 1 270 271 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_99 1 1 263 272 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_202 1 1 272 273 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_201 1 1 271 274 0=1.666667e-01 1=5.000000e-01 +Concat cat_15 2 1 274 273 275 0=0 +Convolution conv_100 1 1 275 276 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_203 1 1 276 277 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_20 1 2 277 278 279 +HardSwish hswish_197 1 1 255 280 0=1.666667e-01 1=5.000000e-01 +Interp upsample_269 1 1 279 281 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_16 2 1 281 280 282 0=0 +Split splitncnn_21 1 2 282 283 284 +Convolution conv_101 1 1 284 285 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_204 1 1 285 286 0=1.666667e-01 1=5.000000e-01 +Convolution conv_102 1 1 286 287 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_205 1 1 287 288 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_293 1 1 288 289 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_206 1 1 289 290 0=1.666667e-01 1=5.000000e-01 +Convolution conv_103 1 1 290 291 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_104 1 1 283 292 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_208 1 1 292 293 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_207 1 1 291 294 0=1.666667e-01 1=5.000000e-01 +Concat cat_17 2 1 294 293 295 0=0 +Convolution conv_105 1 1 295 296 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_209 1 1 296 297 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_22 1 2 297 298 299 +ConvolutionDepthWise convdw_294 1 1 299 300 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_210 1 1 300 301 0=1.666667e-01 1=5.000000e-01 +Convolution conv_106 1 1 301 302 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_211 1 1 302 303 0=1.666667e-01 1=5.000000e-01 +Concat cat_18 2 1 303 278 304 0=0 +Split splitncnn_23 1 2 304 305 306 +Convolution conv_107 1 1 306 307 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_212 1 1 307 308 0=1.666667e-01 1=5.000000e-01 +Convolution conv_108 1 1 308 309 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_213 1 1 309 310 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_295 1 1 310 311 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_214 1 1 311 312 0=1.666667e-01 1=5.000000e-01 +Convolution conv_109 1 1 312 313 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_110 1 1 305 314 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_216 1 1 314 315 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_215 1 1 313 316 0=1.666667e-01 1=5.000000e-01 +Concat cat_19 2 1 316 315 317 0=0 +Convolution conv_111 1 1 317 318 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_217 1 1 318 319 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_24 1 2 319 320 321 +ConvolutionDepthWise convdw_296 1 1 321 322 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_218 1 1 322 323 0=1.666667e-01 1=5.000000e-01 +Convolution conv_112 1 1 323 324 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_219 1 1 324 325 0=1.666667e-01 1=5.000000e-01 +Concat cat_20 2 1 325 257 326 0=0 +Split splitncnn_25 1 2 326 327 328 +Convolution conv_113 1 1 328 329 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_220 1 1 329 330 0=1.666667e-01 1=5.000000e-01 +Convolution conv_114 1 1 330 331 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_221 1 1 331 332 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_297 1 1 332 333 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_222 1 1 333 334 0=1.666667e-01 1=5.000000e-01 +Convolution conv_115 1 1 334 335 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_116 1 1 327 336 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_224 1 1 336 337 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_223 1 1 335 338 0=1.666667e-01 1=5.000000e-01 +Concat cat_21 2 1 338 337 339 0=0 +Convolution conv_117 1 1 339 340 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_298 1 1 259 341 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_226 1 1 341 342 0=1.666667e-01 1=5.000000e-01 +Convolution conv_118 1 1 342 343 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_225 1 1 340 344 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_26 1 2 344 345 346 +ConvolutionDepthWise convdw_299 1 1 346 347 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_228 1 1 347 348 0=1.666667e-01 1=5.000000e-01 +Convolution conv_119 1 1 348 349 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_229 1 1 349 350 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_227 1 1 343 351 0=1.666667e-01 1=5.000000e-01 +BinaryOp add_14 2 1 351 350 352 0=0 +ConvolutionDepthWise convdw_300 1 1 298 353 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_230 1 1 353 354 0=1.666667e-01 1=5.000000e-01 +Convolution conv_120 1 1 354 355 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_231 1 1 355 356 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_27 1 2 356 357 358 +ConvolutionDepthWise convdw_301 1 1 358 359 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_232 1 1 359 360 0=1.666667e-01 1=5.000000e-01 +Convolution conv_121 1 1 360 361 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_302 1 1 357 362 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_234 1 1 362 363 0=1.666667e-01 1=5.000000e-01 +Convolution conv_123 1 1 363 364 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_303 1 1 320 365 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_236 1 1 365 366 0=1.666667e-01 1=5.000000e-01 +Convolution conv_125 1 1 366 367 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_237 1 1 367 368 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_28 1 2 368 369 370 +ConvolutionDepthWise convdw_304 1 1 370 371 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_238 1 1 371 372 0=1.666667e-01 1=5.000000e-01 +Convolution conv_126 1 1 372 373 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_305 1 1 369 374 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_240 1 1 374 375 0=1.666667e-01 1=5.000000e-01 +Convolution conv_128 1 1 375 376 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_306 1 1 345 377 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_242 1 1 377 378 0=1.666667e-01 1=5.000000e-01 +Convolution conv_130 1 1 378 379 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_243 1 1 379 380 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_29 1 2 380 381 382 +ConvolutionDepthWise convdw_307 1 1 382 383 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_244 1 1 383 384 0=1.666667e-01 1=5.000000e-01 +Convolution conv_131 1 1 384 385 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_308 1 1 381 386 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_246 1 1 386 387 0=1.666667e-01 1=5.000000e-01 +Convolution conv_133 1 1 387 388 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_309 1 1 352 389 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_248 1 1 389 390 0=1.666667e-01 1=5.000000e-01 +Convolution conv_135 1 1 390 391 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_249 1 1 391 392 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_30 1 2 392 393 394 +ConvolutionDepthWise convdw_310 1 1 394 395 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_250 1 1 395 396 0=1.666667e-01 1=5.000000e-01 +Convolution conv_136 1 1 396 397 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_311 1 1 393 398 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_252 1 1 398 399 0=1.666667e-01 1=5.000000e-01 +Convolution conv_138 1 1 399 400 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_251 1 1 397 401 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_253 1 1 400 402 0=1.666667e-01 1=5.000000e-01 +Convolution conv_139 1 1 402 403 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_14 1 1 401 404 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_22 2 1 404 403 out3 0=0 +HardSwish hswish_245 1 1 385 406 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_247 1 1 388 407 0=1.666667e-01 1=5.000000e-01 +Convolution conv_134 1 1 407 408 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_15 1 1 406 409 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_23 2 1 409 408 out2 0=0 +HardSwish hswish_239 1 1 373 411 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_241 1 1 376 412 0=1.666667e-01 1=5.000000e-01 +Convolution conv_129 1 1 412 413 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_16 1 1 411 414 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_24 2 1 414 413 out1 0=0 +HardSwish hswish_233 1 1 361 416 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_235 1 1 364 417 0=1.666667e-01 1=5.000000e-01 +Convolution conv_124 1 1 417 418 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_17 1 1 416 419 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_25 2 1 419 418 out0 0=0 diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.bin b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.bin new file mode 100644 index 0000000000..2084b07450 Binary files /dev/null and b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.bin differ diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.param b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.param new file mode 100644 index 0000000000..35386a8aa8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-l2.param @@ -0,0 +1,379 @@ +7767517 +377 421 +Input in0 0 1 in0 +Convolution conv_28 1 1 in0 1 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 +HardSwish hswish_154 1 1 1 2 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_0 1 2 2 3 4 +ConvolutionDepthWise convdw_270 1 1 4 5 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Convolution conv_29 1 1 5 6 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +Convolution conv_30 1 1 3 7 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_156 1 1 7 8 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_271 1 1 8 9 0=12 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=108 7=12 +Split splitncnn_1 1 2 9 10 11 +Pooling gap_4 1 1 11 12 0=1 4=1 +Convolution convrelu_0 1 1 12 13 0=3 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 9=1 +Convolution conv_32 1 1 13 14 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 +HardSigmoid hsigmoid_140 1 1 14 15 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_0 2 1 10 15 16 0=2 +Convolution conv_33 1 1 16 17 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_157 1 1 17 18 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_155 1 1 6 19 0=1.666667e-01 1=5.000000e-01 +Concat cat_0 2 1 19 18 20 0=0 +ConvolutionDepthWise convdw_272 1 1 20 21 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +HardSwish hswish_158 1 1 21 22 0=1.666667e-01 1=5.000000e-01 +Convolution conv_34 1 1 22 23 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_159 1 1 23 24 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_2 1 2 24 25 26 +ConvolutionDepthWise convdw_273 1 1 26 27 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Convolution conv_35 1 1 27 28 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_36 1 1 25 29 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_161 1 1 29 30 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_274 1 1 30 31 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Split splitncnn_3 1 2 31 32 33 +Pooling gap_5 1 1 33 34 0=1 4=1 +Convolution convrelu_1 1 1 34 35 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_38 1 1 35 36 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_141 1 1 36 37 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_1 2 1 32 37 38 0=2 +Convolution conv_39 1 1 38 39 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_162 1 1 39 40 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_160 1 1 28 41 0=1.666667e-01 1=5.000000e-01 +Concat cat_1 2 1 41 40 42 0=0 +ConvolutionDepthWise convdw_275 1 1 42 43 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +HardSwish hswish_163 1 1 43 44 0=1.666667e-01 1=5.000000e-01 +Convolution conv_40 1 1 44 45 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_164 1 1 45 46 0=1.666667e-01 1=5.000000e-01 +Slice split_0 1 2 46 47 48 -23300=2,48,48 1=0 +Convolution conv_41 1 1 48 49 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_165 1 1 49 50 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_276 1 1 50 51 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_4 1 2 51 52 53 +Pooling gap_6 1 1 53 54 0=1 4=1 +Convolution convrelu_2 1 1 54 55 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_43 1 1 55 56 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_142 1 1 56 57 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_2 2 1 52 57 58 0=2 +Convolution conv_44 1 1 58 59 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_166 1 1 59 60 0=1.666667e-01 1=5.000000e-01 +Concat cat_2 2 1 47 60 61 0=0 +ShuffleChannel channelshuffle_18 1 1 61 62 0=2 1=0 +Slice split_1 1 2 62 63 64 -23300=2,48,48 1=0 +Convolution conv_45 1 1 64 65 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_167 1 1 65 66 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_277 1 1 66 67 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_5 1 2 67 68 69 +Pooling gap_7 1 1 69 70 0=1 4=1 +Convolution convrelu_3 1 1 70 71 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_47 1 1 71 72 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_143 1 1 72 73 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_3 2 1 68 73 74 0=2 +Convolution conv_48 1 1 74 75 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_168 1 1 75 76 0=1.666667e-01 1=5.000000e-01 +Concat cat_3 2 1 63 76 77 0=0 +ShuffleChannel channelshuffle_19 1 1 77 78 0=2 1=0 +Split splitncnn_6 1 3 78 79 80 81 +ConvolutionDepthWise convdw_278 1 1 81 82 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Convolution conv_49 1 1 82 83 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +Convolution conv_50 1 1 80 84 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_170 1 1 84 85 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_279 1 1 85 86 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Split splitncnn_7 1 2 86 87 88 +Pooling gap_8 1 1 88 89 0=1 4=1 +Convolution convrelu_4 1 1 89 90 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_52 1 1 90 91 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_144 1 1 91 92 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_4 2 1 87 92 93 0=2 +Convolution conv_53 1 1 93 94 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_171 1 1 94 95 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_169 1 1 83 96 0=1.666667e-01 1=5.000000e-01 +Concat cat_4 2 1 96 95 97 0=0 +ConvolutionDepthWise convdw_280 1 1 97 98 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +HardSwish hswish_172 1 1 98 99 0=1.666667e-01 1=5.000000e-01 +Convolution conv_54 1 1 99 100 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_173 1 1 100 101 0=1.666667e-01 1=5.000000e-01 +Slice split_2 1 2 101 102 103 -23300=2,96,96 1=0 +Convolution conv_55 1 1 103 104 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_174 1 1 104 105 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_281 1 1 105 106 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_8 1 2 106 107 108 +Pooling gap_9 1 1 108 109 0=1 4=1 +Convolution convrelu_5 1 1 109 110 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_57 1 1 110 111 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_145 1 1 111 112 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_5 2 1 107 112 113 0=2 +Convolution conv_58 1 1 113 114 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_175 1 1 114 115 0=1.666667e-01 1=5.000000e-01 +Concat cat_5 2 1 102 115 116 0=0 +ShuffleChannel channelshuffle_20 1 1 116 117 0=2 1=0 +Slice split_3 1 2 117 118 119 -23300=2,96,96 1=0 +Convolution conv_59 1 1 119 120 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_176 1 1 120 121 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_282 1 1 121 122 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_9 1 2 122 123 124 +Pooling gap_10 1 1 124 125 0=1 4=1 +Convolution convrelu_6 1 1 125 126 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_61 1 1 126 127 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_146 1 1 127 128 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_6 2 1 123 128 129 0=2 +Convolution conv_62 1 1 129 130 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_177 1 1 130 131 0=1.666667e-01 1=5.000000e-01 +Concat cat_6 2 1 118 131 132 0=0 +ShuffleChannel channelshuffle_21 1 1 132 133 0=2 1=0 +Slice split_4 1 2 133 134 135 -23300=2,96,96 1=0 +Convolution conv_63 1 1 135 136 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_178 1 1 136 137 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_283 1 1 137 138 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_10 1 2 138 139 140 +Pooling gap_11 1 1 140 141 0=1 4=1 +Convolution convrelu_7 1 1 141 142 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_65 1 1 142 143 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_147 1 1 143 144 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_7 2 1 139 144 145 0=2 +Convolution conv_66 1 1 145 146 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_179 1 1 146 147 0=1.666667e-01 1=5.000000e-01 +Concat cat_7 2 1 134 147 148 0=0 +ShuffleChannel channelshuffle_22 1 1 148 149 0=2 1=0 +Slice split_5 1 2 149 150 151 -23300=2,96,96 1=0 +Convolution conv_67 1 1 151 152 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_180 1 1 152 153 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_284 1 1 153 154 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_11 1 2 154 155 156 +Pooling gap_12 1 1 156 157 0=1 4=1 +Convolution convrelu_8 1 1 157 158 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_69 1 1 158 159 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_148 1 1 159 160 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_8 2 1 155 160 161 0=2 +Convolution conv_70 1 1 161 162 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_181 1 1 162 163 0=1.666667e-01 1=5.000000e-01 +Concat cat_8 2 1 150 163 164 0=0 +ShuffleChannel channelshuffle_23 1 1 164 165 0=2 1=0 +Slice split_6 1 2 165 166 167 -23300=2,96,96 1=0 +Convolution conv_71 1 1 167 168 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_182 1 1 168 169 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_285 1 1 169 170 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_12 1 2 170 171 172 +Pooling gap_13 1 1 172 173 0=1 4=1 +Convolution convrelu_9 1 1 173 174 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_73 1 1 174 175 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_149 1 1 175 176 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_9 2 1 171 176 177 0=2 +Convolution conv_74 1 1 177 178 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_183 1 1 178 179 0=1.666667e-01 1=5.000000e-01 +Concat cat_9 2 1 166 179 180 0=0 +ShuffleChannel channelshuffle_24 1 1 180 181 0=2 1=0 +Slice split_7 1 2 181 182 183 -23300=2,96,96 1=0 +Convolution conv_75 1 1 183 184 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_184 1 1 184 185 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_286 1 1 185 186 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +Split splitncnn_13 1 2 186 187 188 +Pooling gap_14 1 1 188 189 0=1 4=1 +Convolution convrelu_10 1 1 189 190 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_77 1 1 190 191 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_150 1 1 191 192 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_10 2 1 187 192 193 0=2 +Convolution conv_78 1 1 193 194 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_185 1 1 194 195 0=1.666667e-01 1=5.000000e-01 +Concat cat_10 2 1 182 195 196 0=0 +ShuffleChannel channelshuffle_25 1 1 196 197 0=2 1=0 +Split splitncnn_14 1 3 197 198 199 200 +ConvolutionDepthWise convdw_287 1 1 200 201 0=192 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=1728 7=192 +Convolution conv_79 1 1 201 202 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_80 1 1 199 203 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_187 1 1 203 204 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_288 1 1 204 205 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Split splitncnn_15 1 2 205 206 207 +Pooling gap_15 1 1 207 208 0=1 4=1 +Convolution convrelu_11 1 1 208 209 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 9=1 +Convolution conv_82 1 1 209 210 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSigmoid hsigmoid_151 1 1 210 211 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_11 2 1 206 211 212 0=2 +Convolution conv_83 1 1 212 213 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +HardSwish hswish_188 1 1 213 214 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_186 1 1 202 215 0=1.666667e-01 1=5.000000e-01 +Concat cat_11 2 1 215 214 216 0=0 +ConvolutionDepthWise convdw_289 1 1 216 217 0=384 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=3456 7=384 +HardSwish hswish_189 1 1 217 218 0=1.666667e-01 1=5.000000e-01 +Convolution conv_84 1 1 218 219 0=384 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=147456 +HardSwish hswish_190 1 1 219 220 0=1.666667e-01 1=5.000000e-01 +Slice split_8 1 2 220 221 222 -23300=2,192,192 1=0 +Convolution conv_85 1 1 222 223 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_191 1 1 223 224 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_290 1 1 224 225 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_16 1 2 225 226 227 +Pooling gap_16 1 1 227 228 0=1 4=1 +Convolution convrelu_12 1 1 228 229 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_87 1 1 229 230 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_152 1 1 230 231 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_12 2 1 226 231 232 0=2 +Convolution conv_88 1 1 232 233 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_192 1 1 233 234 0=1.666667e-01 1=5.000000e-01 +Concat cat_12 2 1 221 234 235 0=0 +ShuffleChannel channelshuffle_26 1 1 235 236 0=2 1=0 +Slice split_9 1 2 236 237 238 -23300=2,192,192 1=0 +Convolution conv_89 1 1 238 239 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_193 1 1 239 240 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_291 1 1 240 241 0=192 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1728 7=192 +Split splitncnn_17 1 2 241 242 243 +Pooling gap_17 1 1 243 244 0=1 4=1 +Convolution convrelu_13 1 1 244 245 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 9=1 +Convolution conv_91 1 1 245 246 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSigmoid hsigmoid_153 1 1 246 247 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_13 2 1 242 247 248 0=2 +Convolution conv_92 1 1 248 249 0=192 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +HardSwish hswish_194 1 1 249 250 0=1.666667e-01 1=5.000000e-01 +Concat cat_13 2 1 237 250 251 0=0 +ShuffleChannel channelshuffle_27 1 1 251 252 0=2 1=0 +Convolution conv_93 1 1 252 253 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36864 +Convolution conv_94 1 1 198 254 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=18432 +Convolution conv_95 1 1 79 255 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_195 1 1 253 256 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_18 1 3 256 257 258 259 +HardSwish hswish_196 1 1 254 260 0=1.666667e-01 1=5.000000e-01 +Interp upsample_268 1 1 258 261 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_14 2 1 261 260 262 0=0 +Split splitncnn_19 1 2 262 263 264 +Convolution conv_96 1 1 264 265 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_198 1 1 265 266 0=1.666667e-01 1=5.000000e-01 +Convolution conv_97 1 1 266 267 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_199 1 1 267 268 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_292 1 1 268 269 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_200 1 1 269 270 0=1.666667e-01 1=5.000000e-01 +Convolution conv_98 1 1 270 271 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_99 1 1 263 272 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_202 1 1 272 273 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_201 1 1 271 274 0=1.666667e-01 1=5.000000e-01 +Concat cat_15 2 1 274 273 275 0=0 +Convolution conv_100 1 1 275 276 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_203 1 1 276 277 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_20 1 2 277 278 279 +HardSwish hswish_197 1 1 255 280 0=1.666667e-01 1=5.000000e-01 +Interp upsample_269 1 1 279 281 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_16 2 1 281 280 282 0=0 +Split splitncnn_21 1 2 282 283 284 +Convolution conv_101 1 1 284 285 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_204 1 1 285 286 0=1.666667e-01 1=5.000000e-01 +Convolution conv_102 1 1 286 287 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_205 1 1 287 288 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_293 1 1 288 289 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_206 1 1 289 290 0=1.666667e-01 1=5.000000e-01 +Convolution conv_103 1 1 290 291 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_104 1 1 283 292 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_208 1 1 292 293 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_207 1 1 291 294 0=1.666667e-01 1=5.000000e-01 +Concat cat_17 2 1 294 293 295 0=0 +Convolution conv_105 1 1 295 296 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_209 1 1 296 297 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_22 1 2 297 298 299 +ConvolutionDepthWise convdw_294 1 1 299 300 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_210 1 1 300 301 0=1.666667e-01 1=5.000000e-01 +Convolution conv_106 1 1 301 302 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_211 1 1 302 303 0=1.666667e-01 1=5.000000e-01 +Concat cat_18 2 1 303 278 304 0=0 +Split splitncnn_23 1 2 304 305 306 +Convolution conv_107 1 1 306 307 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_212 1 1 307 308 0=1.666667e-01 1=5.000000e-01 +Convolution conv_108 1 1 308 309 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_213 1 1 309 310 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_295 1 1 310 311 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_214 1 1 311 312 0=1.666667e-01 1=5.000000e-01 +Convolution conv_109 1 1 312 313 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_110 1 1 305 314 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_216 1 1 314 315 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_215 1 1 313 316 0=1.666667e-01 1=5.000000e-01 +Concat cat_19 2 1 316 315 317 0=0 +Convolution conv_111 1 1 317 318 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_217 1 1 318 319 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_24 1 2 319 320 321 +ConvolutionDepthWise convdw_296 1 1 321 322 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_218 1 1 322 323 0=1.666667e-01 1=5.000000e-01 +Convolution conv_112 1 1 323 324 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_219 1 1 324 325 0=1.666667e-01 1=5.000000e-01 +Concat cat_20 2 1 325 257 326 0=0 +Split splitncnn_25 1 2 326 327 328 +Convolution conv_113 1 1 328 329 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_220 1 1 329 330 0=1.666667e-01 1=5.000000e-01 +Convolution conv_114 1 1 330 331 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_221 1 1 331 332 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_297 1 1 332 333 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_222 1 1 333 334 0=1.666667e-01 1=5.000000e-01 +Convolution conv_115 1 1 334 335 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_116 1 1 327 336 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_224 1 1 336 337 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_223 1 1 335 338 0=1.666667e-01 1=5.000000e-01 +Concat cat_21 2 1 338 337 339 0=0 +Convolution conv_117 1 1 339 340 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_298 1 1 259 341 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_226 1 1 341 342 0=1.666667e-01 1=5.000000e-01 +Convolution conv_118 1 1 342 343 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_225 1 1 340 344 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_26 1 2 344 345 346 +ConvolutionDepthWise convdw_299 1 1 346 347 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_228 1 1 347 348 0=1.666667e-01 1=5.000000e-01 +Convolution conv_119 1 1 348 349 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_229 1 1 349 350 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_227 1 1 343 351 0=1.666667e-01 1=5.000000e-01 +BinaryOp add_14 2 1 351 350 352 0=0 +ConvolutionDepthWise convdw_300 1 1 298 353 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_230 1 1 353 354 0=1.666667e-01 1=5.000000e-01 +Convolution conv_120 1 1 354 355 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_231 1 1 355 356 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_27 1 2 356 357 358 +ConvolutionDepthWise convdw_301 1 1 358 359 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_232 1 1 359 360 0=1.666667e-01 1=5.000000e-01 +Convolution conv_121 1 1 360 361 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_302 1 1 357 362 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_234 1 1 362 363 0=1.666667e-01 1=5.000000e-01 +Convolution conv_123 1 1 363 364 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_303 1 1 320 365 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_236 1 1 365 366 0=1.666667e-01 1=5.000000e-01 +Convolution conv_125 1 1 366 367 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_237 1 1 367 368 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_28 1 2 368 369 370 +ConvolutionDepthWise convdw_304 1 1 370 371 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_238 1 1 371 372 0=1.666667e-01 1=5.000000e-01 +Convolution conv_126 1 1 372 373 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_305 1 1 369 374 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_240 1 1 374 375 0=1.666667e-01 1=5.000000e-01 +Convolution conv_128 1 1 375 376 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_306 1 1 345 377 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_242 1 1 377 378 0=1.666667e-01 1=5.000000e-01 +Convolution conv_130 1 1 378 379 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_243 1 1 379 380 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_29 1 2 380 381 382 +ConvolutionDepthWise convdw_307 1 1 382 383 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_244 1 1 383 384 0=1.666667e-01 1=5.000000e-01 +Convolution conv_131 1 1 384 385 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_308 1 1 381 386 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_246 1 1 386 387 0=1.666667e-01 1=5.000000e-01 +Convolution conv_133 1 1 387 388 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_309 1 1 352 389 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_248 1 1 389 390 0=1.666667e-01 1=5.000000e-01 +Convolution conv_135 1 1 390 391 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_249 1 1 391 392 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_30 1 2 392 393 394 +ConvolutionDepthWise convdw_310 1 1 394 395 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_250 1 1 395 396 0=1.666667e-01 1=5.000000e-01 +Convolution conv_136 1 1 396 397 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_311 1 1 393 398 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_252 1 1 398 399 0=1.666667e-01 1=5.000000e-01 +Convolution conv_138 1 1 399 400 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_251 1 1 397 401 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_253 1 1 400 402 0=1.666667e-01 1=5.000000e-01 +Convolution conv_139 1 1 402 403 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_14 1 1 401 404 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_22 2 1 404 403 out3 0=0 +HardSwish hswish_245 1 1 385 406 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_247 1 1 388 407 0=1.666667e-01 1=5.000000e-01 +Convolution conv_134 1 1 407 408 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_15 1 1 406 409 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_23 2 1 409 408 out2 0=0 +HardSwish hswish_239 1 1 373 411 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_241 1 1 376 412 0=1.666667e-01 1=5.000000e-01 +Convolution conv_129 1 1 412 413 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_16 1 1 411 414 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_24 2 1 414 413 out1 0=0 +HardSwish hswish_233 1 1 361 416 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_235 1 1 364 417 0=1.666667e-01 1=5.000000e-01 +Convolution conv_124 1 1 417 418 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_17 1 1 416 419 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_25 2 1 419 418 out0 0=0 diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.bin b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.bin new file mode 100644 index 0000000000..4fce03a2d2 Binary files /dev/null and b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.bin differ diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.param b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.param new file mode 100644 index 0000000000..5985c289f0 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-m.param @@ -0,0 +1,379 @@ +7767517 +377 421 +Input in0 0 1 in0 +Convolution conv_28 1 1 in0 1 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 +HardSwish hswish_154 1 1 1 2 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_0 1 2 2 3 4 +ConvolutionDepthWise convdw_270 1 1 4 5 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Convolution conv_29 1 1 5 6 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution conv_30 1 1 3 7 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=192 +HardSwish hswish_156 1 1 7 8 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_271 1 1 8 9 0=8 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=72 7=8 +Split splitncnn_1 1 2 9 10 11 +Pooling gap_4 1 1 11 12 0=1 4=1 +Convolution convrelu_0 1 1 12 13 0=2 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=16 9=1 +Convolution conv_32 1 1 13 14 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=16 +HardSigmoid hsigmoid_140 1 1 14 15 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_0 2 1 10 15 16 0=2 +Convolution conv_33 1 1 16 17 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=128 +HardSwish hswish_157 1 1 17 18 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_155 1 1 6 19 0=1.666667e-01 1=5.000000e-01 +Concat cat_0 2 1 19 18 20 0=0 +ConvolutionDepthWise convdw_272 1 1 20 21 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=288 7=32 +HardSwish hswish_158 1 1 21 22 0=1.666667e-01 1=5.000000e-01 +Convolution conv_34 1 1 22 23 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_159 1 1 23 24 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_2 1 2 24 25 26 +ConvolutionDepthWise convdw_273 1 1 26 27 0=32 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=288 7=32 +Convolution conv_35 1 1 27 28 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +Convolution conv_36 1 1 25 29 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=512 +HardSwish hswish_161 1 1 29 30 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_274 1 1 30 31 0=16 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=144 7=16 +Split splitncnn_3 1 2 31 32 33 +Pooling gap_5 1 1 33 34 0=1 4=1 +Convolution convrelu_1 1 1 34 35 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=64 9=1 +Convolution conv_38 1 1 35 36 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=64 +HardSigmoid hsigmoid_141 1 1 36 37 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_1 2 1 32 37 38 0=2 +Convolution conv_39 1 1 38 39 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=512 +HardSwish hswish_162 1 1 39 40 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_160 1 1 28 41 0=1.666667e-01 1=5.000000e-01 +Concat cat_1 2 1 41 40 42 0=0 +ConvolutionDepthWise convdw_275 1 1 42 43 0=64 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=576 7=64 +HardSwish hswish_163 1 1 43 44 0=1.666667e-01 1=5.000000e-01 +Convolution conv_40 1 1 44 45 0=64 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4096 +HardSwish hswish_164 1 1 45 46 0=1.666667e-01 1=5.000000e-01 +Slice split_0 1 2 46 47 48 -23300=2,32,32 1=0 +Convolution conv_41 1 1 48 49 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_165 1 1 49 50 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_276 1 1 50 51 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=288 7=32 +Split splitncnn_4 1 2 51 52 53 +Pooling gap_6 1 1 53 54 0=1 4=1 +Convolution convrelu_2 1 1 54 55 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=256 9=1 +Convolution conv_43 1 1 55 56 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=256 +HardSigmoid hsigmoid_142 1 1 56 57 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_2 2 1 52 57 58 0=2 +Convolution conv_44 1 1 58 59 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_166 1 1 59 60 0=1.666667e-01 1=5.000000e-01 +Concat cat_2 2 1 47 60 61 0=0 +ShuffleChannel channelshuffle_18 1 1 61 62 0=2 1=0 +Slice split_1 1 2 62 63 64 -23300=2,32,32 1=0 +Convolution conv_45 1 1 64 65 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_167 1 1 65 66 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_277 1 1 66 67 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=288 7=32 +Split splitncnn_5 1 2 67 68 69 +Pooling gap_7 1 1 69 70 0=1 4=1 +Convolution convrelu_3 1 1 70 71 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=256 9=1 +Convolution conv_47 1 1 71 72 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=256 +HardSigmoid hsigmoid_143 1 1 72 73 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_3 2 1 68 73 74 0=2 +Convolution conv_48 1 1 74 75 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_168 1 1 75 76 0=1.666667e-01 1=5.000000e-01 +Concat cat_3 2 1 63 76 77 0=0 +ShuffleChannel channelshuffle_19 1 1 77 78 0=2 1=0 +Split splitncnn_6 1 3 78 79 80 81 +ConvolutionDepthWise convdw_278 1 1 81 82 0=64 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=576 7=64 +Convolution conv_49 1 1 82 83 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +Convolution conv_50 1 1 80 84 0=36 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_170 1 1 84 85 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_279 1 1 85 86 0=36 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=324 7=36 +Split splitncnn_7 1 2 86 87 88 +Pooling gap_8 1 1 88 89 0=1 4=1 +Convolution convrelu_4 1 1 89 90 0=9 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=324 9=1 +Convolution conv_52 1 1 90 91 0=36 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=324 +HardSigmoid hsigmoid_144 1 1 91 92 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_4 2 1 87 92 93 0=2 +Convolution conv_53 1 1 93 94 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2592 +HardSwish hswish_171 1 1 94 95 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_169 1 1 83 96 0=1.666667e-01 1=5.000000e-01 +Concat cat_4 2 1 96 95 97 0=0 +ConvolutionDepthWise convdw_280 1 1 97 98 0=144 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1296 7=144 +HardSwish hswish_172 1 1 98 99 0=1.666667e-01 1=5.000000e-01 +Convolution conv_54 1 1 99 100 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +HardSwish hswish_173 1 1 100 101 0=1.666667e-01 1=5.000000e-01 +Slice split_2 1 2 101 102 103 -23300=2,72,72 1=0 +Convolution conv_55 1 1 103 104 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_174 1 1 104 105 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_281 1 1 105 106 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_8 1 2 106 107 108 +Pooling gap_9 1 1 108 109 0=1 4=1 +Convolution convrelu_5 1 1 109 110 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_57 1 1 110 111 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_145 1 1 111 112 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_5 2 1 107 112 113 0=2 +Convolution conv_58 1 1 113 114 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_175 1 1 114 115 0=1.666667e-01 1=5.000000e-01 +Concat cat_5 2 1 102 115 116 0=0 +ShuffleChannel channelshuffle_20 1 1 116 117 0=2 1=0 +Slice split_3 1 2 117 118 119 -23300=2,72,72 1=0 +Convolution conv_59 1 1 119 120 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_176 1 1 120 121 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_282 1 1 121 122 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_9 1 2 122 123 124 +Pooling gap_10 1 1 124 125 0=1 4=1 +Convolution convrelu_6 1 1 125 126 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_61 1 1 126 127 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_146 1 1 127 128 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_6 2 1 123 128 129 0=2 +Convolution conv_62 1 1 129 130 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_177 1 1 130 131 0=1.666667e-01 1=5.000000e-01 +Concat cat_6 2 1 118 131 132 0=0 +ShuffleChannel channelshuffle_21 1 1 132 133 0=2 1=0 +Slice split_4 1 2 133 134 135 -23300=2,72,72 1=0 +Convolution conv_63 1 1 135 136 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_178 1 1 136 137 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_283 1 1 137 138 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_10 1 2 138 139 140 +Pooling gap_11 1 1 140 141 0=1 4=1 +Convolution convrelu_7 1 1 141 142 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_65 1 1 142 143 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_147 1 1 143 144 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_7 2 1 139 144 145 0=2 +Convolution conv_66 1 1 145 146 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_179 1 1 146 147 0=1.666667e-01 1=5.000000e-01 +Concat cat_7 2 1 134 147 148 0=0 +ShuffleChannel channelshuffle_22 1 1 148 149 0=2 1=0 +Slice split_5 1 2 149 150 151 -23300=2,72,72 1=0 +Convolution conv_67 1 1 151 152 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_180 1 1 152 153 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_284 1 1 153 154 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_11 1 2 154 155 156 +Pooling gap_12 1 1 156 157 0=1 4=1 +Convolution convrelu_8 1 1 157 158 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_69 1 1 158 159 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_148 1 1 159 160 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_8 2 1 155 160 161 0=2 +Convolution conv_70 1 1 161 162 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_181 1 1 162 163 0=1.666667e-01 1=5.000000e-01 +Concat cat_8 2 1 150 163 164 0=0 +ShuffleChannel channelshuffle_23 1 1 164 165 0=2 1=0 +Slice split_6 1 2 165 166 167 -23300=2,72,72 1=0 +Convolution conv_71 1 1 167 168 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_182 1 1 168 169 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_285 1 1 169 170 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_12 1 2 170 171 172 +Pooling gap_13 1 1 172 173 0=1 4=1 +Convolution convrelu_9 1 1 173 174 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_73 1 1 174 175 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_149 1 1 175 176 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_9 2 1 171 176 177 0=2 +Convolution conv_74 1 1 177 178 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_183 1 1 178 179 0=1.666667e-01 1=5.000000e-01 +Concat cat_9 2 1 166 179 180 0=0 +ShuffleChannel channelshuffle_24 1 1 180 181 0=2 1=0 +Slice split_7 1 2 181 182 183 -23300=2,72,72 1=0 +Convolution conv_75 1 1 183 184 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_184 1 1 184 185 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_286 1 1 185 186 0=72 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=648 7=72 +Split splitncnn_13 1 2 186 187 188 +Pooling gap_14 1 1 188 189 0=1 4=1 +Convolution convrelu_10 1 1 189 190 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_77 1 1 190 191 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_150 1 1 191 192 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_10 2 1 187 192 193 0=2 +Convolution conv_78 1 1 193 194 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSwish hswish_185 1 1 194 195 0=1.666667e-01 1=5.000000e-01 +Concat cat_10 2 1 182 195 196 0=0 +ShuffleChannel channelshuffle_25 1 1 196 197 0=2 1=0 +Split splitncnn_14 1 3 197 198 199 200 +ConvolutionDepthWise convdw_287 1 1 200 201 0=144 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=1296 7=144 +Convolution conv_79 1 1 201 202 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +Convolution conv_80 1 1 199 203 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=10368 +HardSwish hswish_187 1 1 203 204 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_288 1 1 204 205 0=72 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 7=72 +Split splitncnn_15 1 2 205 206 207 +Pooling gap_15 1 1 207 208 0=1 4=1 +Convolution convrelu_11 1 1 208 209 0=18 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 9=1 +Convolution conv_82 1 1 209 210 0=72 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1296 +HardSigmoid hsigmoid_151 1 1 210 211 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_11 2 1 206 211 212 0=2 +Convolution conv_83 1 1 212 213 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=10368 +HardSwish hswish_188 1 1 213 214 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_186 1 1 202 215 0=1.666667e-01 1=5.000000e-01 +Concat cat_11 2 1 215 214 216 0=0 +ConvolutionDepthWise convdw_289 1 1 216 217 0=288 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=2592 7=288 +HardSwish hswish_189 1 1 217 218 0=1.666667e-01 1=5.000000e-01 +Convolution conv_84 1 1 218 219 0=288 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=82944 +HardSwish hswish_190 1 1 219 220 0=1.666667e-01 1=5.000000e-01 +Slice split_8 1 2 220 221 222 -23300=2,144,144 1=0 +Convolution conv_85 1 1 222 223 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +HardSwish hswish_191 1 1 223 224 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_290 1 1 224 225 0=144 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1296 7=144 +Split splitncnn_16 1 2 225 226 227 +Pooling gap_16 1 1 227 228 0=1 4=1 +Convolution convrelu_12 1 1 228 229 0=36 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 9=1 +Convolution conv_87 1 1 229 230 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSigmoid hsigmoid_152 1 1 230 231 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_12 2 1 226 231 232 0=2 +Convolution conv_88 1 1 232 233 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +HardSwish hswish_192 1 1 233 234 0=1.666667e-01 1=5.000000e-01 +Concat cat_12 2 1 221 234 235 0=0 +ShuffleChannel channelshuffle_26 1 1 235 236 0=2 1=0 +Slice split_9 1 2 236 237 238 -23300=2,144,144 1=0 +Convolution conv_89 1 1 238 239 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +HardSwish hswish_193 1 1 239 240 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_291 1 1 240 241 0=144 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1296 7=144 +Split splitncnn_17 1 2 241 242 243 +Pooling gap_17 1 1 243 244 0=1 4=1 +Convolution convrelu_13 1 1 244 245 0=36 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 9=1 +Convolution conv_91 1 1 245 246 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=5184 +HardSigmoid hsigmoid_153 1 1 246 247 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_13 2 1 242 247 248 0=2 +Convolution conv_92 1 1 248 249 0=144 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=20736 +HardSwish hswish_194 1 1 249 250 0=1.666667e-01 1=5.000000e-01 +Concat cat_13 2 1 237 250 251 0=0 +ShuffleChannel channelshuffle_27 1 1 251 252 0=2 1=0 +Convolution conv_93 1 1 252 253 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=27648 +Convolution conv_94 1 1 198 254 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=13824 +Convolution conv_95 1 1 79 255 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=6144 +HardSwish hswish_195 1 1 253 256 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_18 1 3 256 257 258 259 +HardSwish hswish_196 1 1 254 260 0=1.666667e-01 1=5.000000e-01 +Interp upsample_268 1 1 258 261 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_14 2 1 261 260 262 0=0 +Split splitncnn_19 1 2 262 263 264 +Convolution conv_96 1 1 264 265 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_198 1 1 265 266 0=1.666667e-01 1=5.000000e-01 +Convolution conv_97 1 1 266 267 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_199 1 1 267 268 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_292 1 1 268 269 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_200 1 1 269 270 0=1.666667e-01 1=5.000000e-01 +Convolution conv_98 1 1 270 271 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_99 1 1 263 272 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_202 1 1 272 273 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_201 1 1 271 274 0=1.666667e-01 1=5.000000e-01 +Concat cat_15 2 1 274 273 275 0=0 +Convolution conv_100 1 1 275 276 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_203 1 1 276 277 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_20 1 2 277 278 279 +HardSwish hswish_197 1 1 255 280 0=1.666667e-01 1=5.000000e-01 +Interp upsample_269 1 1 279 281 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_16 2 1 281 280 282 0=0 +Split splitncnn_21 1 2 282 283 284 +Convolution conv_101 1 1 284 285 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_204 1 1 285 286 0=1.666667e-01 1=5.000000e-01 +Convolution conv_102 1 1 286 287 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_205 1 1 287 288 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_293 1 1 288 289 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_206 1 1 289 290 0=1.666667e-01 1=5.000000e-01 +Convolution conv_103 1 1 290 291 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_104 1 1 283 292 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_208 1 1 292 293 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_207 1 1 291 294 0=1.666667e-01 1=5.000000e-01 +Concat cat_17 2 1 294 293 295 0=0 +Convolution conv_105 1 1 295 296 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_209 1 1 296 297 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_22 1 2 297 298 299 +ConvolutionDepthWise convdw_294 1 1 299 300 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_210 1 1 300 301 0=1.666667e-01 1=5.000000e-01 +Convolution conv_106 1 1 301 302 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_211 1 1 302 303 0=1.666667e-01 1=5.000000e-01 +Concat cat_18 2 1 303 278 304 0=0 +Split splitncnn_23 1 2 304 305 306 +Convolution conv_107 1 1 306 307 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_212 1 1 307 308 0=1.666667e-01 1=5.000000e-01 +Convolution conv_108 1 1 308 309 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_213 1 1 309 310 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_295 1 1 310 311 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_214 1 1 311 312 0=1.666667e-01 1=5.000000e-01 +Convolution conv_109 1 1 312 313 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_110 1 1 305 314 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_216 1 1 314 315 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_215 1 1 313 316 0=1.666667e-01 1=5.000000e-01 +Concat cat_19 2 1 316 315 317 0=0 +Convolution conv_111 1 1 317 318 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_217 1 1 318 319 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_24 1 2 319 320 321 +ConvolutionDepthWise convdw_296 1 1 321 322 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_218 1 1 322 323 0=1.666667e-01 1=5.000000e-01 +Convolution conv_112 1 1 323 324 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_219 1 1 324 325 0=1.666667e-01 1=5.000000e-01 +Concat cat_20 2 1 325 257 326 0=0 +Split splitncnn_25 1 2 326 327 328 +Convolution conv_113 1 1 328 329 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_220 1 1 329 330 0=1.666667e-01 1=5.000000e-01 +Convolution conv_114 1 1 330 331 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_221 1 1 331 332 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_297 1 1 332 333 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_222 1 1 333 334 0=1.666667e-01 1=5.000000e-01 +Convolution conv_115 1 1 334 335 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_116 1 1 327 336 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_224 1 1 336 337 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_223 1 1 335 338 0=1.666667e-01 1=5.000000e-01 +Concat cat_21 2 1 338 337 339 0=0 +Convolution conv_117 1 1 339 340 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_298 1 1 259 341 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_226 1 1 341 342 0=1.666667e-01 1=5.000000e-01 +Convolution conv_118 1 1 342 343 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_225 1 1 340 344 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_26 1 2 344 345 346 +ConvolutionDepthWise convdw_299 1 1 346 347 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_228 1 1 347 348 0=1.666667e-01 1=5.000000e-01 +Convolution conv_119 1 1 348 349 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_229 1 1 349 350 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_227 1 1 343 351 0=1.666667e-01 1=5.000000e-01 +BinaryOp add_14 2 1 351 350 352 0=0 +ConvolutionDepthWise convdw_300 1 1 298 353 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_230 1 1 353 354 0=1.666667e-01 1=5.000000e-01 +Convolution conv_120 1 1 354 355 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_231 1 1 355 356 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_27 1 2 356 357 358 +ConvolutionDepthWise convdw_301 1 1 358 359 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_232 1 1 359 360 0=1.666667e-01 1=5.000000e-01 +Convolution conv_121 1 1 360 361 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_302 1 1 357 362 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_234 1 1 362 363 0=1.666667e-01 1=5.000000e-01 +Convolution conv_123 1 1 363 364 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_303 1 1 320 365 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_236 1 1 365 366 0=1.666667e-01 1=5.000000e-01 +Convolution conv_125 1 1 366 367 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_237 1 1 367 368 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_28 1 2 368 369 370 +ConvolutionDepthWise convdw_304 1 1 370 371 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_238 1 1 371 372 0=1.666667e-01 1=5.000000e-01 +Convolution conv_126 1 1 372 373 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_305 1 1 369 374 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_240 1 1 374 375 0=1.666667e-01 1=5.000000e-01 +Convolution conv_128 1 1 375 376 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_306 1 1 345 377 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_242 1 1 377 378 0=1.666667e-01 1=5.000000e-01 +Convolution conv_130 1 1 378 379 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_243 1 1 379 380 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_29 1 2 380 381 382 +ConvolutionDepthWise convdw_307 1 1 382 383 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_244 1 1 383 384 0=1.666667e-01 1=5.000000e-01 +Convolution conv_131 1 1 384 385 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_308 1 1 381 386 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_246 1 1 386 387 0=1.666667e-01 1=5.000000e-01 +Convolution conv_133 1 1 387 388 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_309 1 1 352 389 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_248 1 1 389 390 0=1.666667e-01 1=5.000000e-01 +Convolution conv_135 1 1 390 391 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_249 1 1 391 392 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_30 1 2 392 393 394 +ConvolutionDepthWise convdw_310 1 1 394 395 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_250 1 1 395 396 0=1.666667e-01 1=5.000000e-01 +Convolution conv_136 1 1 396 397 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_311 1 1 393 398 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_252 1 1 398 399 0=1.666667e-01 1=5.000000e-01 +Convolution conv_138 1 1 399 400 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_251 1 1 397 401 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_253 1 1 400 402 0=1.666667e-01 1=5.000000e-01 +Convolution conv_139 1 1 402 403 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_14 1 1 401 404 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_22 2 1 404 403 out3 0=0 +HardSwish hswish_245 1 1 385 406 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_247 1 1 388 407 0=1.666667e-01 1=5.000000e-01 +Convolution conv_134 1 1 407 408 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_15 1 1 406 409 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_23 2 1 409 408 out2 0=0 +HardSwish hswish_239 1 1 373 411 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_241 1 1 376 412 0=1.666667e-01 1=5.000000e-01 +Convolution conv_129 1 1 412 413 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_16 1 1 411 414 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_24 2 1 414 413 out1 0=0 +HardSwish hswish_233 1 1 361 416 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_235 1 1 364 417 0=1.666667e-01 1=5.000000e-01 +Convolution conv_124 1 1 417 418 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_17 1 1 416 419 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_25 2 1 419 418 out0 0=0 diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.bin b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.bin new file mode 100644 index 0000000000..9f781b4368 Binary files /dev/null and b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.bin differ diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.param b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.param new file mode 100644 index 0000000000..85f93735e9 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/assets/yolov6-lite-s.param @@ -0,0 +1,379 @@ +7767517 +377 421 +Input in0 0 1 in0 +Convolution conv_28 1 1 in0 1 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=648 +HardSwish hswish_154 1 1 1 2 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_0 1 2 2 3 4 +ConvolutionDepthWise convdw_270 1 1 4 5 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Convolution conv_29 1 1 5 6 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution conv_30 1 1 3 7 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=192 +HardSwish hswish_156 1 1 7 8 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_271 1 1 8 9 0=8 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=72 7=8 +Split splitncnn_1 1 2 9 10 11 +Pooling gap_4 1 1 11 12 0=1 4=1 +Convolution convrelu_0 1 1 12 13 0=2 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=16 9=1 +Convolution conv_32 1 1 13 14 0=8 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=16 +HardSigmoid hsigmoid_140 1 1 14 15 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_0 2 1 10 15 16 0=2 +Convolution conv_33 1 1 16 17 0=16 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=128 +HardSwish hswish_157 1 1 17 18 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_155 1 1 6 19 0=1.666667e-01 1=5.000000e-01 +Concat cat_0 2 1 19 18 20 0=0 +ConvolutionDepthWise convdw_272 1 1 20 21 0=32 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=288 7=32 +HardSwish hswish_158 1 1 21 22 0=1.666667e-01 1=5.000000e-01 +Convolution conv_34 1 1 22 23 0=32 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1024 +HardSwish hswish_159 1 1 23 24 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_2 1 2 24 25 26 +ConvolutionDepthWise convdw_273 1 1 26 27 0=32 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=288 7=32 +Convolution conv_35 1 1 27 28 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=768 +Convolution conv_36 1 1 25 29 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +HardSwish hswish_161 1 1 29 30 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_274 1 1 30 31 0=12 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=108 7=12 +Split splitncnn_3 1 2 31 32 33 +Pooling gap_5 1 1 33 34 0=1 4=1 +Convolution convrelu_1 1 1 34 35 0=3 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 9=1 +Convolution conv_38 1 1 35 36 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=36 +HardSigmoid hsigmoid_141 1 1 36 37 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_1 2 1 32 37 38 0=2 +Convolution conv_39 1 1 38 39 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=288 +HardSwish hswish_162 1 1 39 40 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_160 1 1 28 41 0=1.666667e-01 1=5.000000e-01 +Concat cat_1 2 1 41 40 42 0=0 +ConvolutionDepthWise convdw_275 1 1 42 43 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +HardSwish hswish_163 1 1 43 44 0=1.666667e-01 1=5.000000e-01 +Convolution conv_40 1 1 44 45 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_164 1 1 45 46 0=1.666667e-01 1=5.000000e-01 +Slice split_0 1 2 46 47 48 -23300=2,24,24 1=0 +Convolution conv_41 1 1 48 49 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSwish hswish_165 1 1 49 50 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_276 1 1 50 51 0=24 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=216 7=24 +Split splitncnn_4 1 2 51 52 53 +Pooling gap_6 1 1 53 54 0=1 4=1 +Convolution convrelu_2 1 1 54 55 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_43 1 1 55 56 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_142 1 1 56 57 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_2 2 1 52 57 58 0=2 +Convolution conv_44 1 1 58 59 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSwish hswish_166 1 1 59 60 0=1.666667e-01 1=5.000000e-01 +Concat cat_2 2 1 47 60 61 0=0 +ShuffleChannel channelshuffle_18 1 1 61 62 0=2 1=0 +Slice split_1 1 2 62 63 64 -23300=2,24,24 1=0 +Convolution conv_45 1 1 64 65 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSwish hswish_167 1 1 65 66 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_277 1 1 66 67 0=24 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=216 7=24 +Split splitncnn_5 1 2 67 68 69 +Pooling gap_7 1 1 69 70 0=1 4=1 +Convolution convrelu_3 1 1 70 71 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_47 1 1 71 72 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_143 1 1 72 73 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_3 2 1 68 73 74 0=2 +Convolution conv_48 1 1 74 75 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSwish hswish_168 1 1 75 76 0=1.666667e-01 1=5.000000e-01 +Concat cat_3 2 1 63 76 77 0=0 +ShuffleChannel channelshuffle_19 1 1 77 78 0=2 1=0 +Split splitncnn_6 1 3 78 79 80 81 +ConvolutionDepthWise convdw_278 1 1 81 82 0=48 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=432 7=48 +Convolution conv_49 1 1 82 83 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_50 1 1 80 84 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_170 1 1 84 85 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_279 1 1 85 86 0=24 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=216 7=24 +Split splitncnn_7 1 2 86 87 88 +Pooling gap_8 1 1 88 89 0=1 4=1 +Convolution convrelu_4 1 1 89 90 0=6 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 9=1 +Convolution conv_52 1 1 90 91 0=24 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=144 +HardSigmoid hsigmoid_144 1 1 91 92 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_4 2 1 87 92 93 0=2 +Convolution conv_53 1 1 93 94 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1152 +HardSwish hswish_171 1 1 94 95 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_169 1 1 83 96 0=1.666667e-01 1=5.000000e-01 +Concat cat_4 2 1 96 95 97 0=0 +ConvolutionDepthWise convdw_280 1 1 97 98 0=96 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=864 7=96 +HardSwish hswish_172 1 1 98 99 0=1.666667e-01 1=5.000000e-01 +Convolution conv_54 1 1 99 100 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_173 1 1 100 101 0=1.666667e-01 1=5.000000e-01 +Slice split_2 1 2 101 102 103 -23300=2,48,48 1=0 +Convolution conv_55 1 1 103 104 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_174 1 1 104 105 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_281 1 1 105 106 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_8 1 2 106 107 108 +Pooling gap_9 1 1 108 109 0=1 4=1 +Convolution convrelu_5 1 1 109 110 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_57 1 1 110 111 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_145 1 1 111 112 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_5 2 1 107 112 113 0=2 +Convolution conv_58 1 1 113 114 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_175 1 1 114 115 0=1.666667e-01 1=5.000000e-01 +Concat cat_5 2 1 102 115 116 0=0 +ShuffleChannel channelshuffle_20 1 1 116 117 0=2 1=0 +Slice split_3 1 2 117 118 119 -23300=2,48,48 1=0 +Convolution conv_59 1 1 119 120 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_176 1 1 120 121 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_282 1 1 121 122 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_9 1 2 122 123 124 +Pooling gap_10 1 1 124 125 0=1 4=1 +Convolution convrelu_6 1 1 125 126 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_61 1 1 126 127 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_146 1 1 127 128 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_6 2 1 123 128 129 0=2 +Convolution conv_62 1 1 129 130 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_177 1 1 130 131 0=1.666667e-01 1=5.000000e-01 +Concat cat_6 2 1 118 131 132 0=0 +ShuffleChannel channelshuffle_21 1 1 132 133 0=2 1=0 +Slice split_4 1 2 133 134 135 -23300=2,48,48 1=0 +Convolution conv_63 1 1 135 136 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_178 1 1 136 137 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_283 1 1 137 138 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_10 1 2 138 139 140 +Pooling gap_11 1 1 140 141 0=1 4=1 +Convolution convrelu_7 1 1 141 142 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_65 1 1 142 143 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_147 1 1 143 144 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_7 2 1 139 144 145 0=2 +Convolution conv_66 1 1 145 146 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_179 1 1 146 147 0=1.666667e-01 1=5.000000e-01 +Concat cat_7 2 1 134 147 148 0=0 +ShuffleChannel channelshuffle_22 1 1 148 149 0=2 1=0 +Slice split_5 1 2 149 150 151 -23300=2,48,48 1=0 +Convolution conv_67 1 1 151 152 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_180 1 1 152 153 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_284 1 1 153 154 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_11 1 2 154 155 156 +Pooling gap_12 1 1 156 157 0=1 4=1 +Convolution convrelu_8 1 1 157 158 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_69 1 1 158 159 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_148 1 1 159 160 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_8 2 1 155 160 161 0=2 +Convolution conv_70 1 1 161 162 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_181 1 1 162 163 0=1.666667e-01 1=5.000000e-01 +Concat cat_8 2 1 150 163 164 0=0 +ShuffleChannel channelshuffle_23 1 1 164 165 0=2 1=0 +Slice split_6 1 2 165 166 167 -23300=2,48,48 1=0 +Convolution conv_71 1 1 167 168 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_182 1 1 168 169 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_285 1 1 169 170 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_12 1 2 170 171 172 +Pooling gap_13 1 1 172 173 0=1 4=1 +Convolution convrelu_9 1 1 173 174 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_73 1 1 174 175 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_149 1 1 175 176 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_9 2 1 171 176 177 0=2 +Convolution conv_74 1 1 177 178 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_183 1 1 178 179 0=1.666667e-01 1=5.000000e-01 +Concat cat_9 2 1 166 179 180 0=0 +ShuffleChannel channelshuffle_24 1 1 180 181 0=2 1=0 +Slice split_7 1 2 181 182 183 -23300=2,48,48 1=0 +Convolution conv_75 1 1 183 184 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_184 1 1 184 185 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_286 1 1 185 186 0=48 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=432 7=48 +Split splitncnn_13 1 2 186 187 188 +Pooling gap_14 1 1 188 189 0=1 4=1 +Convolution convrelu_10 1 1 189 190 0=12 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 9=1 +Convolution conv_77 1 1 190 191 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=576 +HardSigmoid hsigmoid_150 1 1 191 192 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_10 2 1 187 192 193 0=2 +Convolution conv_78 1 1 193 194 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_185 1 1 194 195 0=1.666667e-01 1=5.000000e-01 +Concat cat_10 2 1 182 195 196 0=0 +ShuffleChannel channelshuffle_25 1 1 196 197 0=2 1=0 +Split splitncnn_14 1 3 197 198 199 200 +ConvolutionDepthWise convdw_287 1 1 200 201 0=96 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=864 7=96 +Convolution conv_79 1 1 201 202 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=8448 +Convolution conv_80 1 1 199 203 0=44 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4224 +HardSwish hswish_187 1 1 203 204 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_288 1 1 204 205 0=44 1=3 11=3 12=1 13=2 14=1 2=1 3=2 4=1 5=1 6=396 7=44 +Split splitncnn_15 1 2 205 206 207 +Pooling gap_15 1 1 207 208 0=1 4=1 +Convolution convrelu_11 1 1 208 209 0=11 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=484 9=1 +Convolution conv_82 1 1 209 210 0=44 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=484 +HardSigmoid hsigmoid_151 1 1 210 211 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_11 2 1 206 211 212 0=2 +Convolution conv_83 1 1 212 213 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=3872 +HardSwish hswish_188 1 1 213 214 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_186 1 1 202 215 0=1.666667e-01 1=5.000000e-01 +Concat cat_11 2 1 215 214 216 0=0 +ConvolutionDepthWise convdw_289 1 1 216 217 0=176 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=1584 7=176 +HardSwish hswish_189 1 1 217 218 0=1.666667e-01 1=5.000000e-01 +Convolution conv_84 1 1 218 219 0=176 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=30976 +HardSwish hswish_190 1 1 219 220 0=1.666667e-01 1=5.000000e-01 +Slice split_8 1 2 220 221 222 -23300=2,88,88 1=0 +Convolution conv_85 1 1 222 223 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7744 +HardSwish hswish_191 1 1 223 224 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_290 1 1 224 225 0=88 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=792 7=88 +Split splitncnn_16 1 2 225 226 227 +Pooling gap_16 1 1 227 228 0=1 4=1 +Convolution convrelu_12 1 1 228 229 0=22 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1936 9=1 +Convolution conv_87 1 1 229 230 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1936 +HardSigmoid hsigmoid_152 1 1 230 231 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_12 2 1 226 231 232 0=2 +Convolution conv_88 1 1 232 233 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7744 +HardSwish hswish_192 1 1 233 234 0=1.666667e-01 1=5.000000e-01 +Concat cat_12 2 1 221 234 235 0=0 +ShuffleChannel channelshuffle_26 1 1 235 236 0=2 1=0 +Slice split_9 1 2 236 237 238 -23300=2,88,88 1=0 +Convolution conv_89 1 1 238 239 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7744 +HardSwish hswish_193 1 1 239 240 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_291 1 1 240 241 0=88 1=3 11=3 12=1 13=1 14=1 2=1 3=1 4=1 5=1 6=792 7=88 +Split splitncnn_17 1 2 241 242 243 +Pooling gap_17 1 1 243 244 0=1 4=1 +Convolution convrelu_13 1 1 244 245 0=22 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1936 9=1 +Convolution conv_91 1 1 245 246 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=1936 +HardSigmoid hsigmoid_153 1 1 246 247 0=1.666667e-01 1=5.000000e-01 +BinaryOp mul_13 2 1 242 247 248 0=2 +Convolution conv_92 1 1 248 249 0=88 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7744 +HardSwish hswish_194 1 1 249 250 0=1.666667e-01 1=5.000000e-01 +Concat cat_13 2 1 237 250 251 0=0 +ShuffleChannel channelshuffle_27 1 1 251 252 0=2 1=0 +Convolution conv_93 1 1 252 253 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=16896 +Convolution conv_94 1 1 198 254 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +Convolution conv_95 1 1 79 255 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=4608 +HardSwish hswish_195 1 1 253 256 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_18 1 3 256 257 258 259 +HardSwish hswish_196 1 1 254 260 0=1.666667e-01 1=5.000000e-01 +Interp upsample_268 1 1 258 261 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_14 2 1 261 260 262 0=0 +Split splitncnn_19 1 2 262 263 264 +Convolution conv_96 1 1 264 265 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_198 1 1 265 266 0=1.666667e-01 1=5.000000e-01 +Convolution conv_97 1 1 266 267 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_199 1 1 267 268 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_292 1 1 268 269 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_200 1 1 269 270 0=1.666667e-01 1=5.000000e-01 +Convolution conv_98 1 1 270 271 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_99 1 1 263 272 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_202 1 1 272 273 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_201 1 1 271 274 0=1.666667e-01 1=5.000000e-01 +Concat cat_15 2 1 274 273 275 0=0 +Convolution conv_100 1 1 275 276 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_203 1 1 276 277 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_20 1 2 277 278 279 +HardSwish hswish_197 1 1 255 280 0=1.666667e-01 1=5.000000e-01 +Interp upsample_269 1 1 279 281 0=1 1=2.000000e+00 2=2.000000e+00 6=0 +Concat cat_16 2 1 281 280 282 0=0 +Split splitncnn_21 1 2 282 283 284 +Convolution conv_101 1 1 284 285 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_204 1 1 285 286 0=1.666667e-01 1=5.000000e-01 +Convolution conv_102 1 1 286 287 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_205 1 1 287 288 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_293 1 1 288 289 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_206 1 1 289 290 0=1.666667e-01 1=5.000000e-01 +Convolution conv_103 1 1 290 291 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_104 1 1 283 292 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_208 1 1 292 293 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_207 1 1 291 294 0=1.666667e-01 1=5.000000e-01 +Concat cat_17 2 1 294 293 295 0=0 +Convolution conv_105 1 1 295 296 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_209 1 1 296 297 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_22 1 2 297 298 299 +ConvolutionDepthWise convdw_294 1 1 299 300 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_210 1 1 300 301 0=1.666667e-01 1=5.000000e-01 +Convolution conv_106 1 1 301 302 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_211 1 1 302 303 0=1.666667e-01 1=5.000000e-01 +Concat cat_18 2 1 303 278 304 0=0 +Split splitncnn_23 1 2 304 305 306 +Convolution conv_107 1 1 306 307 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_212 1 1 307 308 0=1.666667e-01 1=5.000000e-01 +Convolution conv_108 1 1 308 309 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_213 1 1 309 310 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_295 1 1 310 311 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_214 1 1 311 312 0=1.666667e-01 1=5.000000e-01 +Convolution conv_109 1 1 312 313 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_110 1 1 305 314 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_216 1 1 314 315 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_215 1 1 313 316 0=1.666667e-01 1=5.000000e-01 +Concat cat_19 2 1 316 315 317 0=0 +Convolution conv_111 1 1 317 318 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_217 1 1 318 319 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_24 1 2 319 320 321 +ConvolutionDepthWise convdw_296 1 1 321 322 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_218 1 1 322 323 0=1.666667e-01 1=5.000000e-01 +Convolution conv_112 1 1 323 324 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_219 1 1 324 325 0=1.666667e-01 1=5.000000e-01 +Concat cat_20 2 1 325 257 326 0=0 +Split splitncnn_25 1 2 326 327 328 +Convolution conv_113 1 1 328 329 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_220 1 1 329 330 0=1.666667e-01 1=5.000000e-01 +Convolution conv_114 1 1 330 331 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +HardSwish hswish_221 1 1 331 332 0=1.666667e-01 1=5.000000e-01 +ConvolutionDepthWise convdw_297 1 1 332 333 0=48 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=1200 7=48 +HardSwish hswish_222 1 1 333 334 0=1.666667e-01 1=5.000000e-01 +Convolution conv_115 1 1 334 335 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=2304 +Convolution conv_116 1 1 327 336 0=48 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_224 1 1 336 337 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_223 1 1 335 338 0=1.666667e-01 1=5.000000e-01 +Concat cat_21 2 1 338 337 339 0=0 +Convolution conv_117 1 1 339 340 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_298 1 1 259 341 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_226 1 1 341 342 0=1.666667e-01 1=5.000000e-01 +Convolution conv_118 1 1 342 343 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_225 1 1 340 344 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_26 1 2 344 345 346 +ConvolutionDepthWise convdw_299 1 1 346 347 0=96 1=5 11=5 12=1 13=2 14=2 2=1 3=2 4=2 5=1 6=2400 7=96 +HardSwish hswish_228 1 1 347 348 0=1.666667e-01 1=5.000000e-01 +Convolution conv_119 1 1 348 349 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_229 1 1 349 350 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_227 1 1 343 351 0=1.666667e-01 1=5.000000e-01 +BinaryOp add_14 2 1 351 350 352 0=0 +ConvolutionDepthWise convdw_300 1 1 298 353 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_230 1 1 353 354 0=1.666667e-01 1=5.000000e-01 +Convolution conv_120 1 1 354 355 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_231 1 1 355 356 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_27 1 2 356 357 358 +ConvolutionDepthWise convdw_301 1 1 358 359 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_232 1 1 359 360 0=1.666667e-01 1=5.000000e-01 +Convolution conv_121 1 1 360 361 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_302 1 1 357 362 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_234 1 1 362 363 0=1.666667e-01 1=5.000000e-01 +Convolution conv_123 1 1 363 364 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_303 1 1 320 365 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_236 1 1 365 366 0=1.666667e-01 1=5.000000e-01 +Convolution conv_125 1 1 366 367 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_237 1 1 367 368 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_28 1 2 368 369 370 +ConvolutionDepthWise convdw_304 1 1 370 371 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_238 1 1 371 372 0=1.666667e-01 1=5.000000e-01 +Convolution conv_126 1 1 372 373 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_305 1 1 369 374 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_240 1 1 374 375 0=1.666667e-01 1=5.000000e-01 +Convolution conv_128 1 1 375 376 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_306 1 1 345 377 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_242 1 1 377 378 0=1.666667e-01 1=5.000000e-01 +Convolution conv_130 1 1 378 379 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_243 1 1 379 380 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_29 1 2 380 381 382 +ConvolutionDepthWise convdw_307 1 1 382 383 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_244 1 1 383 384 0=1.666667e-01 1=5.000000e-01 +Convolution conv_131 1 1 384 385 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_308 1 1 381 386 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_246 1 1 386 387 0=1.666667e-01 1=5.000000e-01 +Convolution conv_133 1 1 387 388 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_309 1 1 352 389 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_248 1 1 389 390 0=1.666667e-01 1=5.000000e-01 +Convolution conv_135 1 1 390 391 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_249 1 1 391 392 0=1.666667e-01 1=5.000000e-01 +Split splitncnn_30 1 2 392 393 394 +ConvolutionDepthWise convdw_310 1 1 394 395 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_250 1 1 395 396 0=1.666667e-01 1=5.000000e-01 +Convolution conv_136 1 1 396 397 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +ConvolutionDepthWise convdw_311 1 1 393 398 0=96 1=5 11=5 12=1 13=1 14=2 2=1 3=1 4=2 5=1 6=2400 7=96 +HardSwish hswish_252 1 1 398 399 0=1.666667e-01 1=5.000000e-01 +Convolution conv_138 1 1 399 400 0=96 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=9216 +HardSwish hswish_251 1 1 397 401 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_253 1 1 400 402 0=1.666667e-01 1=5.000000e-01 +Convolution conv_139 1 1 402 403 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_14 1 1 401 404 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_22 2 1 404 403 out3 0=0 +HardSwish hswish_245 1 1 385 406 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_247 1 1 388 407 0=1.666667e-01 1=5.000000e-01 +Convolution conv_134 1 1 407 408 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_15 1 1 406 409 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_23 2 1 409 408 out2 0=0 +HardSwish hswish_239 1 1 373 411 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_241 1 1 376 412 0=1.666667e-01 1=5.000000e-01 +Convolution conv_129 1 1 412 413 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_16 1 1 411 414 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_24 2 1 414 413 out1 0=0 +HardSwish hswish_233 1 1 361 416 0=1.666667e-01 1=5.000000e-01 +HardSwish hswish_235 1 1 364 417 0=1.666667e-01 1=5.000000e-01 +Convolution conv_124 1 1 417 418 0=4 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=384 +Convolution convsigmoid_17 1 1 416 419 0=80 1=1 11=1 12=1 13=1 14=0 2=1 3=1 4=0 5=1 6=7680 9=4 +Concat cat_25 2 1 419 418 out0 0=0 diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/MainActivity.java b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/MainActivity.java new file mode 100644 index 0000000000..5ccacc2934 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/MainActivity.java @@ -0,0 +1,162 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +package com.tencent.yolov6ncnn; + +import android.Manifest; +import android.app.Activity; +import android.content.pm.PackageManager; +import android.graphics.PixelFormat; +import android.os.Bundle; +import android.util.Log; +import android.view.Surface; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.view.WindowManager; +import android.widget.AdapterView; +import android.widget.Button; +import android.widget.Spinner; + +import android.support.v4.app.ActivityCompat; +import android.support.v4.content.ContextCompat; + +public class MainActivity extends Activity implements SurfaceHolder.Callback +{ + public static final int REQUEST_CAMERA = 100; + + private Yolov6Ncnn yolov6ncnn = new Yolov6Ncnn(); + private int facing = 0; + + private Spinner spinnerModel; + private Spinner spinnerCPUGPU; + private int current_model = 0; + private int current_cpugpu = 0; + + private SurfaceView cameraView; + + /** Called when the activity is first created. */ + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + setContentView(R.layout.main); + + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + + cameraView = (SurfaceView) findViewById(R.id.cameraview); + + cameraView.getHolder().setFormat(PixelFormat.RGBA_8888); + cameraView.getHolder().addCallback(this); + + Button buttonSwitchCamera = (Button) findViewById(R.id.buttonSwitchCamera); + buttonSwitchCamera.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View arg0) { + + int new_facing = 1 - facing; + + yolov6ncnn.closeCamera(); + + yolov6ncnn.openCamera(new_facing); + + facing = new_facing; + } + }); + + spinnerModel = (Spinner) findViewById(R.id.spinnerModel); + spinnerModel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView arg0, View arg1, int position, long id) + { + if (position != current_model) + { + current_model = position; + reload(); + } + } + + @Override + public void onNothingSelected(AdapterView arg0) + { + } + }); + + spinnerCPUGPU = (Spinner) findViewById(R.id.spinnerCPUGPU); + spinnerCPUGPU.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView arg0, View arg1, int position, long id) + { + if (position != current_cpugpu) + { + current_cpugpu = position; + reload(); + } + } + + @Override + public void onNothingSelected(AdapterView arg0) + { + } + }); + + reload(); + } + + private void reload() + { + boolean ret_init = yolov6ncnn.loadModel(getAssets(), current_model, current_cpugpu); + if (!ret_init) + { + Log.e("MainActivity", "yolov6ncnn loadModel failed"); + } + } + + @Override + public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) + { + yolov6ncnn.setOutputWindow(holder.getSurface()); + } + + @Override + public void surfaceCreated(SurfaceHolder holder) + { + } + + @Override + public void surfaceDestroyed(SurfaceHolder holder) + { + } + + @Override + public void onResume() + { + super.onResume(); + + if (ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED) + { + ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.CAMERA}, REQUEST_CAMERA); + } + + yolov6ncnn.openCamera(facing); + } + + @Override + public void onPause() + { + super.onPause(); + + yolov6ncnn.closeCamera(); + } +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/Yolov6Ncnn.java b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/Yolov6Ncnn.java new file mode 100644 index 0000000000..36038ef8a8 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/java/com/tencent/yolov6ncnn/Yolov6Ncnn.java @@ -0,0 +1,30 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +package com.tencent.yolov6ncnn; + +import android.content.res.AssetManager; +import android.view.Surface; + +public class Yolov6Ncnn +{ + public native boolean loadModel(AssetManager mgr, int modelid, int cpugpu); + public native boolean openCamera(int facing); + public native boolean closeCamera(); + public native boolean setOutputWindow(Surface surface); + + static { + System.loadLibrary("yolov6ncnn"); + } +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.cpp b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.cpp new file mode 100644 index 0000000000..b4776de638 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.cpp @@ -0,0 +1,771 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include "ndkcamera.h" + +#include + +#include + +#include + +#include "mat.h" + +static void onDisconnected(void* context, ACameraDevice* device) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onDisconnected %p", device); +} + +static void onError(void* context, ACameraDevice* device, int error) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onError %p %d", device, error); +} + +static void onImageAvailable(void* context, AImageReader* reader) +{ +// __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onImageAvailable %p", reader); + + AImage* image = 0; + media_status_t status = AImageReader_acquireLatestImage(reader, &image); + + if (status != AMEDIA_OK) + { + // error + return; + } + + int32_t format; + AImage_getFormat(image, &format); + + // assert format == AIMAGE_FORMAT_YUV_420_888 + + int32_t width = 0; + int32_t height = 0; + AImage_getWidth(image, &width); + AImage_getHeight(image, &height); + + int32_t y_pixelStride = 0; + int32_t u_pixelStride = 0; + int32_t v_pixelStride = 0; + AImage_getPlanePixelStride(image, 0, &y_pixelStride); + AImage_getPlanePixelStride(image, 1, &u_pixelStride); + AImage_getPlanePixelStride(image, 2, &v_pixelStride); + + int32_t y_rowStride = 0; + int32_t u_rowStride = 0; + int32_t v_rowStride = 0; + AImage_getPlaneRowStride(image, 0, &y_rowStride); + AImage_getPlaneRowStride(image, 1, &u_rowStride); + AImage_getPlaneRowStride(image, 2, &v_rowStride); + + uint8_t* y_data = 0; + uint8_t* u_data = 0; + uint8_t* v_data = 0; + int y_len = 0; + int u_len = 0; + int v_len = 0; + AImage_getPlaneData(image, 0, &y_data, &y_len); + AImage_getPlaneData(image, 1, &u_data, &u_len); + AImage_getPlaneData(image, 2, &v_data, &v_len); + + if (u_data == v_data + 1 && v_data == y_data + width * height && y_pixelStride == 1 && u_pixelStride == 2 && v_pixelStride == 2 && y_rowStride == width && u_rowStride == width && v_rowStride == width) + { + // already nv21 :) + ((NdkCamera*)context)->on_image((unsigned char*)y_data, (int)width, (int)height); + } + else + { + // construct nv21 + unsigned char* nv21 = new unsigned char[width * height + width * height / 2]; + { + // Y + unsigned char* yptr = nv21; + for (int y=0; yon_image((unsigned char*)nv21, (int)width, (int)height); + + delete[] nv21; + } + + AImage_delete(image); +} + +static void onSessionActive(void* context, ACameraCaptureSession *session) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onSessionActive %p", session); +} + +static void onSessionReady(void* context, ACameraCaptureSession *session) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onSessionReady %p", session); +} + +static void onSessionClosed(void* context, ACameraCaptureSession *session) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onSessionClosed %p", session); +} + +void onCaptureFailed(void* context, ACameraCaptureSession* session, ACaptureRequest* request, ACameraCaptureFailure* failure) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onCaptureFailed %p %p %p", session, request, failure); +} + +void onCaptureSequenceCompleted(void* context, ACameraCaptureSession* session, int sequenceId, int64_t frameNumber) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onCaptureSequenceCompleted %p %d %ld", session, sequenceId, frameNumber); +} + +void onCaptureSequenceAborted(void* context, ACameraCaptureSession* session, int sequenceId) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onCaptureSequenceAborted %p %d", session, sequenceId); +} + +void onCaptureCompleted(void* context, ACameraCaptureSession* session, ACaptureRequest* request, const ACameraMetadata* result) +{ +// __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "onCaptureCompleted %p %p %p", session, request, result); +} + +NdkCamera::NdkCamera() +{ + camera_facing = 0; + camera_orientation = 0; + + camera_manager = 0; + camera_device = 0; + image_reader = 0; + image_reader_surface = 0; + image_reader_target = 0; + capture_request = 0; + capture_session_output_container = 0; + capture_session_output = 0; + capture_session = 0; + + + // setup imagereader and its surface + { + AImageReader_new(640, 480, AIMAGE_FORMAT_YUV_420_888, /*maxImages*/2, &image_reader); + + AImageReader_ImageListener listener; + listener.context = this; + listener.onImageAvailable = onImageAvailable; + + AImageReader_setImageListener(image_reader, &listener); + + AImageReader_getWindow(image_reader, &image_reader_surface); + + ANativeWindow_acquire(image_reader_surface); + } +} + +NdkCamera::~NdkCamera() +{ + close(); + + if (image_reader) + { + AImageReader_delete(image_reader); + image_reader = 0; + } + + if (image_reader_surface) + { + ANativeWindow_release(image_reader_surface); + image_reader_surface = 0; + } +} + +int NdkCamera::open(int _camera_facing) +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "open"); + + camera_facing = _camera_facing; + + camera_manager = ACameraManager_create(); + + // find front camera + std::string camera_id; + { + ACameraIdList* camera_id_list = 0; + ACameraManager_getCameraIdList(camera_manager, &camera_id_list); + + for (int i = 0; i < camera_id_list->numCameras; ++i) + { + const char* id = camera_id_list->cameraIds[i]; + ACameraMetadata* camera_metadata = 0; + ACameraManager_getCameraCharacteristics(camera_manager, id, &camera_metadata); + + // query faceing + acamera_metadata_enum_android_lens_facing_t facing = ACAMERA_LENS_FACING_FRONT; + { + ACameraMetadata_const_entry e = { 0 }; + ACameraMetadata_getConstEntry(camera_metadata, ACAMERA_LENS_FACING, &e); + facing = (acamera_metadata_enum_android_lens_facing_t)e.data.u8[0]; + } + + if (camera_facing == 0 && facing != ACAMERA_LENS_FACING_FRONT) + { + ACameraMetadata_free(camera_metadata); + continue; + } + + if (camera_facing == 1 && facing != ACAMERA_LENS_FACING_BACK) + { + ACameraMetadata_free(camera_metadata); + continue; + } + + camera_id = id; + + // query orientation + int orientation = 0; + { + ACameraMetadata_const_entry e = { 0 }; + ACameraMetadata_getConstEntry(camera_metadata, ACAMERA_SENSOR_ORIENTATION, &e); + + orientation = (int)e.data.i32[0]; + } + + camera_orientation = orientation; + + ACameraMetadata_free(camera_metadata); + + break; + } + + ACameraManager_deleteCameraIdList(camera_id_list); + } + + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "open %s %d", camera_id.c_str(), camera_orientation); + + // open camera + { + ACameraDevice_StateCallbacks camera_device_state_callbacks; + camera_device_state_callbacks.context = this; + camera_device_state_callbacks.onDisconnected = onDisconnected; + camera_device_state_callbacks.onError = onError; + + ACameraManager_openCamera(camera_manager, camera_id.c_str(), &camera_device_state_callbacks, &camera_device); + } + + // capture request + { + ACameraDevice_createCaptureRequest(camera_device, TEMPLATE_PREVIEW, &capture_request); + + ACameraOutputTarget_create(image_reader_surface, &image_reader_target); + ACaptureRequest_addTarget(capture_request, image_reader_target); + } + + // capture session + { + ACameraCaptureSession_stateCallbacks camera_capture_session_state_callbacks; + camera_capture_session_state_callbacks.context = this; + camera_capture_session_state_callbacks.onActive = onSessionActive; + camera_capture_session_state_callbacks.onReady = onSessionReady; + camera_capture_session_state_callbacks.onClosed = onSessionClosed; + + ACaptureSessionOutputContainer_create(&capture_session_output_container); + + ACaptureSessionOutput_create(image_reader_surface, &capture_session_output); + + ACaptureSessionOutputContainer_add(capture_session_output_container, capture_session_output); + + ACameraDevice_createCaptureSession(camera_device, capture_session_output_container, &camera_capture_session_state_callbacks, &capture_session); + + ACameraCaptureSession_captureCallbacks camera_capture_session_capture_callbacks; + camera_capture_session_capture_callbacks.context = this; + camera_capture_session_capture_callbacks.onCaptureStarted = 0; + camera_capture_session_capture_callbacks.onCaptureProgressed = 0; + camera_capture_session_capture_callbacks.onCaptureCompleted = onCaptureCompleted; + camera_capture_session_capture_callbacks.onCaptureFailed = onCaptureFailed; + camera_capture_session_capture_callbacks.onCaptureSequenceCompleted = onCaptureSequenceCompleted; + camera_capture_session_capture_callbacks.onCaptureSequenceAborted = onCaptureSequenceAborted; + camera_capture_session_capture_callbacks.onCaptureBufferLost = 0; + + ACameraCaptureSession_setRepeatingRequest(capture_session, &camera_capture_session_capture_callbacks, 1, &capture_request, nullptr); + } + + return 0; +} + +void NdkCamera::close() +{ + __android_log_print(ANDROID_LOG_WARN, "NdkCamera", "close"); + + if (capture_session) + { + ACameraCaptureSession_stopRepeating(capture_session); + ACameraCaptureSession_close(capture_session); + capture_session = 0; + } + + if (camera_device) + { + ACameraDevice_close(camera_device); + camera_device = 0; + } + + if (capture_session_output_container) + { + ACaptureSessionOutputContainer_free(capture_session_output_container); + capture_session_output_container = 0; + } + + if (capture_session_output) + { + ACaptureSessionOutput_free(capture_session_output); + capture_session_output = 0; + } + + if (capture_request) + { + ACaptureRequest_free(capture_request); + capture_request = 0; + } + + if (image_reader_target) + { + ACameraOutputTarget_free(image_reader_target); + image_reader_target = 0; + } + + if (camera_manager) + { + ACameraManager_delete(camera_manager); + camera_manager = 0; + } +} + +void NdkCamera::on_image(const cv::Mat& rgb) const +{ +} + +void NdkCamera::on_image(const unsigned char* nv21, int nv21_width, int nv21_height) const +{ + // rotate nv21 + int w = 0; + int h = 0; + int rotate_type = 0; + { + if (camera_orientation == 0) + { + w = nv21_width; + h = nv21_height; + rotate_type = camera_facing == 0 ? 2 : 1; + } + if (camera_orientation == 90) + { + w = nv21_height; + h = nv21_width; + rotate_type = camera_facing == 0 ? 5 : 6; + } + if (camera_orientation == 180) + { + w = nv21_width; + h = nv21_height; + rotate_type = camera_facing == 0 ? 4 : 3; + } + if (camera_orientation == 270) + { + w = nv21_height; + h = nv21_width; + rotate_type = camera_facing == 0 ? 7 : 8; + } + } + + cv::Mat nv21_rotated(h + h / 2, w, CV_8UC1); + ncnn::kanna_rotate_yuv420sp(nv21, nv21_width, nv21_height, nv21_rotated.data, w, h, rotate_type); + + // nv21_rotated to rgb + cv::Mat rgb(h, w, CV_8UC3); + ncnn::yuv420sp2rgb(nv21_rotated.data, w, h, rgb.data); + + on_image(rgb); +} + +static const int NDKCAMERAWINDOW_ID = 233; + +NdkCameraWindow::NdkCameraWindow() : NdkCamera() +{ + sensor_manager = 0; + sensor_event_queue = 0; + accelerometer_sensor = 0; + win = 0; + + accelerometer_orientation = 0; + + // sensor + sensor_manager = ASensorManager_getInstance(); + + accelerometer_sensor = ASensorManager_getDefaultSensor(sensor_manager, ASENSOR_TYPE_ACCELEROMETER); +} + +NdkCameraWindow::~NdkCameraWindow() +{ + if (accelerometer_sensor) + { + ASensorEventQueue_disableSensor(sensor_event_queue, accelerometer_sensor); + accelerometer_sensor = 0; + } + + if (sensor_event_queue) + { + ASensorManager_destroyEventQueue(sensor_manager, sensor_event_queue); + sensor_event_queue = 0; + } + + if (win) + { + ANativeWindow_release(win); + } +} + +void NdkCameraWindow::set_window(ANativeWindow* _win) +{ + if (win) + { + ANativeWindow_release(win); + } + + win = _win; + ANativeWindow_acquire(win); +} + +void NdkCameraWindow::on_image_render(cv::Mat& rgb) const +{ +} + +void NdkCameraWindow::on_image(const unsigned char* nv21, int nv21_width, int nv21_height) const +{ + // resolve orientation from camera_orientation and accelerometer_sensor + { + if (!sensor_event_queue) + { + sensor_event_queue = ASensorManager_createEventQueue(sensor_manager, ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS), NDKCAMERAWINDOW_ID, 0, 0); + + ASensorEventQueue_enableSensor(sensor_event_queue, accelerometer_sensor); + } + + int id = ALooper_pollAll(0, 0, 0, 0); + if (id == NDKCAMERAWINDOW_ID) + { + ASensorEvent e[8]; + ssize_t num_event = 0; + while (ASensorEventQueue_hasEvents(sensor_event_queue) == 1) + { + num_event = ASensorEventQueue_getEvents(sensor_event_queue, e, 8); + if (num_event < 0) + break; + } + + if (num_event > 0) + { + float acceleration_x = e[num_event - 1].acceleration.x; + float acceleration_y = e[num_event - 1].acceleration.y; + float acceleration_z = e[num_event - 1].acceleration.z; +// __android_log_print(ANDROID_LOG_WARN, "NdkCameraWindow", "x = %f, y = %f, z = %f", x, y, z); + + if (acceleration_y > 7) + { + accelerometer_orientation = 0; + } + if (acceleration_x < -7) + { + accelerometer_orientation = 90; + } + if (acceleration_y < -7) + { + accelerometer_orientation = 180; + } + if (acceleration_x > 7) + { + accelerometer_orientation = 270; + } + } + } + } + + // roi crop and rotate nv21 + int nv21_roi_x = 0; + int nv21_roi_y = 0; + int nv21_roi_w = 0; + int nv21_roi_h = 0; + int roi_x = 0; + int roi_y = 0; + int roi_w = 0; + int roi_h = 0; + int rotate_type = 0; + int render_w = 0; + int render_h = 0; + int render_rotate_type = 0; + { + int win_w = ANativeWindow_getWidth(win); + int win_h = ANativeWindow_getHeight(win); + + if (accelerometer_orientation == 90 || accelerometer_orientation == 270) + { + std::swap(win_w, win_h); + } + + const int final_orientation = (camera_orientation + accelerometer_orientation) % 360; + + if (final_orientation == 0 || final_orientation == 180) + { + if (win_w * nv21_height > win_h * nv21_width) + { + roi_w = nv21_width; + roi_h = (nv21_width * win_h / win_w) / 2 * 2; + roi_x = 0; + roi_y = ((nv21_height - roi_h) / 2) / 2 * 2; + } + else + { + roi_h = nv21_height; + roi_w = (nv21_height * win_w / win_h) / 2 * 2; + roi_x = ((nv21_width - roi_w) / 2) / 2 * 2; + roi_y = 0; + } + + nv21_roi_x = roi_x; + nv21_roi_y = roi_y; + nv21_roi_w = roi_w; + nv21_roi_h = roi_h; + } + if (final_orientation == 90 || final_orientation == 270) + { + if (win_w * nv21_width > win_h * nv21_height) + { + roi_w = nv21_height; + roi_h = (nv21_height * win_h / win_w) / 2 * 2; + roi_x = 0; + roi_y = ((nv21_width - roi_h) / 2) / 2 * 2; + } + else + { + roi_h = nv21_width; + roi_w = (nv21_width * win_w / win_h) / 2 * 2; + roi_x = ((nv21_height - roi_w) / 2) / 2 * 2; + roi_y = 0; + } + + nv21_roi_x = roi_y; + nv21_roi_y = roi_x; + nv21_roi_w = roi_h; + nv21_roi_h = roi_w; + } + + if (camera_facing == 0) + { + if (camera_orientation == 0 && accelerometer_orientation == 0) + { + rotate_type = 2; + } + if (camera_orientation == 0 && accelerometer_orientation == 90) + { + rotate_type = 7; + } + if (camera_orientation == 0 && accelerometer_orientation == 180) + { + rotate_type = 4; + } + if (camera_orientation == 0 && accelerometer_orientation == 270) + { + rotate_type = 5; + } + if (camera_orientation == 90 && accelerometer_orientation == 0) + { + rotate_type = 5; + } + if (camera_orientation == 90 && accelerometer_orientation == 90) + { + rotate_type = 2; + } + if (camera_orientation == 90 && accelerometer_orientation == 180) + { + rotate_type = 7; + } + if (camera_orientation == 90 && accelerometer_orientation == 270) + { + rotate_type = 4; + } + if (camera_orientation == 180 && accelerometer_orientation == 0) + { + rotate_type = 4; + } + if (camera_orientation == 180 && accelerometer_orientation == 90) + { + rotate_type = 5; + } + if (camera_orientation == 180 && accelerometer_orientation == 180) + { + rotate_type = 2; + } + if (camera_orientation == 180 && accelerometer_orientation == 270) + { + rotate_type = 7; + } + if (camera_orientation == 270 && accelerometer_orientation == 0) + { + rotate_type = 7; + } + if (camera_orientation == 270 && accelerometer_orientation == 90) + { + rotate_type = 4; + } + if (camera_orientation == 270 && accelerometer_orientation == 180) + { + rotate_type = 5; + } + if (camera_orientation == 270 && accelerometer_orientation == 270) + { + rotate_type = 2; + } + } + else + { + if (final_orientation == 0) + { + rotate_type = 1; + } + if (final_orientation == 90) + { + rotate_type = 6; + } + if (final_orientation == 180) + { + rotate_type = 3; + } + if (final_orientation == 270) + { + rotate_type = 8; + } + } + + if (accelerometer_orientation == 0) + { + render_w = roi_w; + render_h = roi_h; + render_rotate_type = 1; + } + if (accelerometer_orientation == 90) + { + render_w = roi_h; + render_h = roi_w; + render_rotate_type = 8; + } + if (accelerometer_orientation == 180) + { + render_w = roi_w; + render_h = roi_h; + render_rotate_type = 3; + } + if (accelerometer_orientation == 270) + { + render_w = roi_h; + render_h = roi_w; + render_rotate_type = 6; + } + } + + // crop and rotate nv21 + cv::Mat nv21_croprotated(roi_h + roi_h / 2, roi_w, CV_8UC1); + { + const unsigned char* srcY = nv21 + nv21_roi_y * nv21_width + nv21_roi_x; + unsigned char* dstY = nv21_croprotated.data; + ncnn::kanna_rotate_c1(srcY, nv21_roi_w, nv21_roi_h, nv21_width, dstY, roi_w, roi_h, roi_w, rotate_type); + + const unsigned char* srcUV = nv21 + nv21_width * nv21_height + nv21_roi_y * nv21_width / 2 + nv21_roi_x; + unsigned char* dstUV = nv21_croprotated.data + roi_w * roi_h; + ncnn::kanna_rotate_c2(srcUV, nv21_roi_w / 2, nv21_roi_h / 2, nv21_width, dstUV, roi_w / 2, roi_h / 2, roi_w, rotate_type); + } + + // nv21_croprotated to rgb + cv::Mat rgb(roi_h, roi_w, CV_8UC3); + ncnn::yuv420sp2rgb(nv21_croprotated.data, roi_w, roi_h, rgb.data); + + on_image_render(rgb); + + // rotate to native window orientation + cv::Mat rgb_render(render_h, render_w, CV_8UC3); + ncnn::kanna_rotate_c3(rgb.data, roi_w, roi_h, rgb_render.data, render_w, render_h, render_rotate_type); + + ANativeWindow_setBuffersGeometry(win, render_w, render_h, AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM); + + ANativeWindow_Buffer buf; + ANativeWindow_lock(win, &buf, NULL); + + // scale to target size + if (buf.format == AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM || buf.format == AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM) + { + for (int y = 0; y < render_h; y++) + { + const unsigned char* ptr = rgb_render.ptr(y); + unsigned char* outptr = (unsigned char*)buf.bits + buf.stride * 4 * y; + + int x = 0; +#if __ARM_NEON + for (; x + 7 < render_w; x += 8) + { + uint8x8x3_t _rgb = vld3_u8(ptr); + uint8x8x4_t _rgba; + _rgba.val[0] = _rgb.val[0]; + _rgba.val[1] = _rgb.val[1]; + _rgba.val[2] = _rgb.val[2]; + _rgba.val[3] = vdup_n_u8(255); + vst4_u8(outptr, _rgba); + + ptr += 24; + outptr += 32; + } +#endif // __ARM_NEON + for (; x < render_w; x++) + { + outptr[0] = ptr[0]; + outptr[1] = ptr[1]; + outptr[2] = ptr[2]; + outptr[3] = 255; + + ptr += 3; + outptr += 4; + } + } + } + + ANativeWindow_unlockAndPost(win); +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.h b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.h new file mode 100644 index 0000000000..ddd30eb8f3 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/ndkcamera.h @@ -0,0 +1,80 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef NDKCAMERA_H +#define NDKCAMERA_H + +#include +#include +#include +#include +#include +#include +#include + +#include + +class NdkCamera +{ +public: + NdkCamera(); + virtual ~NdkCamera(); + + // facing 0=front 1=back + int open(int camera_facing = 0); + void close(); + + virtual void on_image(const cv::Mat& rgb) const; + + virtual void on_image(const unsigned char* nv21, int nv21_width, int nv21_height) const; + +public: + int camera_facing; + int camera_orientation; + +private: + ACameraManager* camera_manager; + ACameraDevice* camera_device; + AImageReader* image_reader; + ANativeWindow* image_reader_surface; + ACameraOutputTarget* image_reader_target; + ACaptureRequest* capture_request; + ACaptureSessionOutputContainer* capture_session_output_container; + ACaptureSessionOutput* capture_session_output; + ACameraCaptureSession* capture_session; +}; + +class NdkCameraWindow : public NdkCamera +{ +public: + NdkCameraWindow(); + virtual ~NdkCameraWindow(); + + void set_window(ANativeWindow* win); + + virtual void on_image_render(cv::Mat& rgb) const; + + virtual void on_image(const unsigned char* nv21, int nv21_width, int nv21_height) const; + +public: + mutable int accelerometer_orientation; + +private: + ASensorManager* sensor_manager; + mutable ASensorEventQueue* sensor_event_queue; + const ASensor* accelerometer_sensor; + ANativeWindow* win; +}; + +#endif // NDKCAMERA_H diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.cpp b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.cpp new file mode 100644 index 0000000000..ce01888c91 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.cpp @@ -0,0 +1,416 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include "yolo.h" + +#include +#include + +#include "cpu.h" + +static float fast_exp(float x) +{ + union { + uint32_t i; + float f; + } v{}; + v.i = (1 << 23) * (1.4426950409 * x + 126.93490512f); + return v.f; +} + +static float sigmoid(float x) +{ + return 1.0f / (1.0f + fast_exp(-x)); +} +static float intersection_area(const Object& a, const Object& b) +{ + cv::Rect_ inter = a.rect & b.rect; + return inter.area(); +} + +static void qsort_descent_inplace(std::vector& faceobjects, int left, int right) +{ + int i = left; + int j = right; + float p = faceobjects[(left + right) / 2].prob; + + while (i <= j) + { + while (faceobjects[i].prob > p) + i++; + + while (faceobjects[j].prob < p) + j--; + + if (i <= j) + { + // swap + std::swap(faceobjects[i], faceobjects[j]); + + i++; + j--; + } + } + + // #pragma omp parallel sections + { + // #pragma omp section + { + if (left < j) qsort_descent_inplace(faceobjects, left, j); + } + // #pragma omp section + { + if (i < right) qsort_descent_inplace(faceobjects, i, right); + } + } +} + +static void qsort_descent_inplace(std::vector& faceobjects) +{ + if (faceobjects.empty()) + return; + + qsort_descent_inplace(faceobjects, 0, faceobjects.size() - 1); +} + +static void nms_sorted_bboxes(const std::vector& faceobjects, std::vector& picked, float nms_threshold) +{ + picked.clear(); + + const int n = faceobjects.size(); + + std::vector areas(n); + for (int i = 0; i < n; i++) + { + areas[i] = faceobjects[i].rect.width * faceobjects[i].rect.height; + } + + for (int i = 0; i < n; i++) + { + const Object& a = faceobjects[i]; + + int keep = 1; + for (int j = 0; j < (int)picked.size(); j++) + { + const Object& b = faceobjects[picked[j]]; + + // intersection over union + float inter_area = intersection_area(a, b); + float union_area = areas[i] + areas[picked[j]] - inter_area; + // float IoU = inter_area / union_area + if (inter_area / union_area > nms_threshold) + keep = 0; + } + + if (keep) + picked.push_back(i); + } +} + +static void generate_proposals(int stride, const ncnn::Mat& pred, float prob_threshold, std::vector& objects) +{ + const int num_c = pred.c; + const int num_grid_y = pred.h; + const int num_grid_x = pred.w; + const int num_classes = num_c - 4; + + for (int i = 0; i < num_grid_y; i++) { + for (int j = 0; j < num_grid_x; j++) { + const float *ptr = (float *) pred.data; + int class_index = 0; + float class_score = -1.f; + for (int c = 0; c < num_classes; c++) { + float score = ptr[c * num_grid_y * num_grid_x + i * num_grid_x + j]; + if (score > class_score) { + class_index = c; + class_score = score; + } + } + if (class_score >= prob_threshold && class_score < 1.f) { + float x0 = ptr[num_classes * num_grid_y * num_grid_x + i * num_grid_x + j]; + float y0 = ptr[(num_classes + 1) * num_grid_y * num_grid_x + i * num_grid_x + j]; + float x1 = ptr[(num_classes + 2) * num_grid_y * num_grid_x + i * num_grid_x + j]; + float y1 = ptr[(num_classes + 3) * num_grid_y * num_grid_x + i * num_grid_x + j]; + + x0 = (j + 0.5f - x0) * stride; + y0 = (i + 0.5f - y0) * stride; + x1 = (j + 0.5f + x1) * stride; + y1 = (i + 0.5f + y1) * stride; + + Object obj; + obj.rect.x = x0; + obj.rect.y = y0; + obj.rect.width = x1 - x0; + obj.rect.height = y1 - y0; + obj.label = class_index; + obj.prob = class_score; + + objects.push_back(obj); + + } + } + } +} + +Yolo::Yolo() +{ + blob_pool_allocator.set_size_compare_ratio(0.f); + workspace_pool_allocator.set_size_compare_ratio(0.f); +} + + +int Yolo::load(AAssetManager* mgr, const char* modeltype, const int *target_size, const float* _mean_vals, const float* _norm_vals, bool use_gpu) +{ + yolo.clear(); + blob_pool_allocator.clear(); + workspace_pool_allocator.clear(); + + ncnn::set_cpu_powersave(2); + ncnn::set_omp_num_threads(ncnn::get_big_cpu_count()); + + yolo.opt = ncnn::Option(); + +#if NCNN_VULKAN + yolo.opt.use_vulkan_compute = use_gpu; +#endif + + yolo.opt.num_threads = ncnn::get_big_cpu_count(); + yolo.opt.blob_allocator = &blob_pool_allocator; + yolo.opt.workspace_allocator = &workspace_pool_allocator; + + char parampath[256]; + char modelpath[256]; + sprintf(parampath, "yolov6-%s.param", modeltype); + sprintf(modelpath, "yolov6-%s.bin", modeltype); + + yolo.load_param(mgr, parampath); + yolo.load_model(mgr, modelpath); + + net_h = target_size[0]; + net_w = target_size[1]; + mean_vals[0] = _mean_vals[0]; + mean_vals[1] = _mean_vals[1]; + mean_vals[2] = _mean_vals[2]; + norm_vals[0] = _norm_vals[0]; + norm_vals[1] = _norm_vals[1]; + norm_vals[2] = _norm_vals[2]; + + return 0; +} + +int Yolo::detect(const cv::Mat& rgb, std::vector& objects, float prob_threshold, float nms_threshold) +{ + int width = rgb.cols; + int height = rgb.rows; + + // pad to multiple of 64 + int w = width; + int h = height; + float scale = 1.f; + if (w > h) + { + scale = net_w / (float)w; + w = net_w; + h = h * scale; + } + else + { + scale = net_h / (float)h; + h = net_h; + w = w * scale; + } + + ncnn::Mat in = ncnn::Mat::from_pixels_resize(rgb.data, ncnn::Mat::PIXEL_RGB2BGR, width, height, w, h); + + // pad to net_h net_w rectangle + int wpad = (w + 63) / 64 * 64 - w; + int hpad = (h + 63) / 64 * 64 - h; + ncnn::Mat in_pad; + ncnn::copy_make_border(in, in_pad, hpad / 2, hpad - hpad / 2, wpad / 2, wpad - wpad / 2, ncnn::BORDER_CONSTANT, 114.f); + + in_pad.substract_mean_normalize(mean_vals, norm_vals); + + ncnn::Extractor ex = yolo.create_extractor(); + + ex.input("in0", in_pad); + + std::vector proposals; + + // stride 8 + { + ncnn::Mat out; + ex.extract("out0", out); + + std::vector objects8; + generate_proposals(8, out, prob_threshold, objects8); + + proposals.insert(proposals.end(), objects8.begin(), objects8.end()); + } + + // stride 16 + { + ncnn::Mat out; + ex.extract("out1", out); + + std::vector objects16; + generate_proposals(16, out, prob_threshold, objects16); + + proposals.insert(proposals.end(), objects16.begin(), objects16.end()); + } + + // stride 32 + { + ncnn::Mat out; + ex.extract("out2", out); + + std::vector objects32; + generate_proposals(32, out, prob_threshold, objects32); + + proposals.insert(proposals.end(), objects32.begin(), objects32.end()); + } + + // stride 64 + { + ncnn::Mat out; + ex.extract("out3", out); + + std::vector objects64; + generate_proposals(64, out, prob_threshold, objects64); + + proposals.insert(proposals.end(), objects64.begin(), objects64.end()); + } + + // sort all proposals by score from highest to lowest + qsort_descent_inplace(proposals); + + // apply nms with nms_threshold + std::vector picked; + nms_sorted_bboxes(proposals, picked, nms_threshold); + + int count = picked.size(); + +// objects.resize(count); + for (int i = 0; i < count; i++) + { + Object obj = proposals[picked[i]]; + + // adjust offset to original unpadded + float x0 = (obj.rect.x - (wpad / 2)) / scale; + float y0 = (obj.rect.y - (hpad / 2)) / scale; + float x1 = (obj.rect.x + obj.rect.width - (wpad / 2)) / scale; + float y1 = (obj.rect.y + obj.rect.height - (hpad / 2)) / scale; + + // clip + x0 = std::floor(std::max(std::min(x0, (float)(width - 1)), 1.f)); + y0 = std::floor(std::max(std::min(y0, (float)(height - 1)), 1.f)); + x1 = std::ceil(std::max(std::min(x1, (float)(width - 1)), 1.f)); + y1 = std::ceil(std::max(std::min(y1, (float)(height - 1)), 1.f)); + + + obj.rect.x = x0; + obj.rect.y = y0; + obj.rect.width = x1 - x0; + obj.rect.height = y1 - y0; + if (obj.rect.width > 10.f && obj.rect.height > 10.f) { + objects.push_back(obj); + } + } + + // sort objects by area + struct + { + bool operator()(const Object& a, const Object& b) const + { + return a.rect.area() > b.rect.area(); + } + } objects_area_greater; + std::sort(objects.begin(), objects.end(), objects_area_greater); + + return 0; +} + +int Yolo::draw(cv::Mat& rgb, const std::vector& objects) +{ + static const char* class_names[] = { + "person", "bicycle", "car", "motorcycle", "airplane", "bus", "train", "truck", "boat", "traffic light", + "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse", "sheep", "cow", + "elephant", "bear", "zebra", "giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", + "skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove", "skateboard", "surfboard", + "tennis racket", "bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl", "banana", "apple", + "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "couch", + "potted plant", "bed", "dining table", "toilet", "tv", "laptop", "mouse", "remote", "keyboard", "cell phone", + "microwave", "oven", "toaster", "sink", "refrigerator", "book", "clock", "vase", "scissors", "teddy bear", + "hair drier", "toothbrush" + }; + + static const unsigned char colors[19][3] = { + { 54, 67, 244}, + { 99, 30, 233}, + {176, 39, 156}, + {183, 58, 103}, + {181, 81, 63}, + {243, 150, 33}, + {244, 169, 3}, + {212, 188, 0}, + {136, 150, 0}, + { 80, 175, 76}, + { 74, 195, 139}, + { 57, 220, 205}, + { 59, 235, 255}, + { 7, 193, 255}, + { 0, 152, 255}, + { 34, 87, 255}, + { 72, 85, 121}, + {158, 158, 158}, + {139, 125, 96} + }; + + int color_index = 0; + + for (int i = 0; i < objects.size(); i++) + { + const Object& obj = objects[i]; + +// fprintf(stderr, "%d = %.5f at %.2f %.2f %.2f x %.2f\n", obj.label, obj.prob, +// obj.rect.x, obj.rect.y, obj.rect.width, obj.rect.height); + + const unsigned char* color = colors[color_index % 19]; + color_index++; + + cv::Scalar cc(color[0], color[1], color[2]); + + cv::rectangle(rgb, obj.rect, cc, 2); + + char text[256]; + sprintf(text, "%s %.1f%%", class_names[obj.label], obj.prob * 100); + + int baseLine = 0; + cv::Size label_size = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, 0.5, 1, &baseLine); + + int x = obj.rect.x; + int y = obj.rect.y - label_size.height - baseLine; + if (y < 0) + y = 0; + if (x + label_size.width > rgb.cols) + x = rgb.cols - label_size.width; + + cv::rectangle(rgb, cv::Rect(cv::Point(x, y), cv::Size(label_size.width, label_size.height + baseLine)), cc, -1); + + cv::Scalar textcc = (color[0] + color[1] + color[2] >= 381) ? cv::Scalar(0, 0, 0) : cv::Scalar(255, 255, 255); + + cv::putText(rgb, text, cv::Point(x, y + label_size.height), cv::FONT_HERSHEY_SIMPLEX, 0.5, textcc, 1); + } + + return 0; +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.h b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.h new file mode 100644 index 0000000000..d00977b271 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolo.h @@ -0,0 +1,52 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#ifndef YOLO_H +#define YOLO_H + +#include + +#include + +struct Object +{ + cv::Rect_ rect; + int label; + float prob; +}; + +class Yolo +{ +public: + Yolo(); + + int load(const char* modeltype, const int *target_size, const float* mean_vals, const float* norm_vals, bool use_gpu = false); + + int load(AAssetManager* mgr, const char* modeltype, const int *target_size, const float* mean_vals, const float* norm_vals, bool use_gpu = false); + + int detect(const cv::Mat& rgb, std::vector& objects, float prob_threshold = 0.25f, float nms_threshold = 0.45f); + + int draw(cv::Mat& rgb, const std::vector& objects); + +private: + ncnn::Net yolo; + int net_h; + int net_w; + float mean_vals[3]; + float norm_vals[3]; + ncnn::UnlockedPoolAllocator blob_pool_allocator; + ncnn::PoolAllocator workspace_pool_allocator; +}; + +#endif // NANODET_H diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolov6ncnn.cpp b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolov6ncnn.cpp new file mode 100644 index 0000000000..88510783ea --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/jni/yolov6ncnn.cpp @@ -0,0 +1,281 @@ +// Tencent is pleased to support the open source community by making ncnn available. +// +// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. +// +// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at +// +// https://opensource.org/licenses/BSD-3-Clause +// +// Unless required by applicable law or agreed to in writing, software distributed +// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +// CONDITIONS OF ANY KIND, either express or implied. See the License for the +// specific language governing permissions and limitations under the License. + +#include +#include +#include + +#include + +#include + +#include +#include + +#include +#include + +#include "yolo.h" + +#include "ndkcamera.h" + +#include +#include + +#if __ARM_NEON +#include +#endif // __ARM_NEON + +static int draw_unsupported(cv::Mat& rgb) +{ + const char text[] = "unsupported"; + + int baseLine = 0; + cv::Size label_size = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, 1.0, 1, &baseLine); + + int y = (rgb.rows - label_size.height) / 2; + int x = (rgb.cols - label_size.width) / 2; + + cv::rectangle(rgb, cv::Rect(cv::Point(x, y), cv::Size(label_size.width, label_size.height + baseLine)), + cv::Scalar(255, 255, 255), -1); + + cv::putText(rgb, text, cv::Point(x, y + label_size.height), + cv::FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar(0, 0, 0)); + + return 0; +} + +static int draw_fps(cv::Mat& rgb) +{ + // resolve moving average + float avg_fps = 0.f; + { + static double t0 = 0.f; + static float fps_history[10] = {0.f}; + + double t1 = ncnn::get_current_time(); + if (t0 == 0.f) + { + t0 = t1; + return 0; + } + + float fps = 1000.f / (t1 - t0); + t0 = t1; + + for (int i = 9; i >= 1; i--) + { + fps_history[i] = fps_history[i - 1]; + } + fps_history[0] = fps; + + if (fps_history[9] == 0.f) + { + return 0; + } + + for (int i = 0; i < 10; i++) + { + avg_fps += fps_history[i]; + } + avg_fps /= 10.f; + } + + char text[32]; + sprintf(text, "FPS=%.2f", avg_fps); + + int baseLine = 0; + cv::Size label_size = cv::getTextSize(text, cv::FONT_HERSHEY_SIMPLEX, 0.5, 1, &baseLine); + + int y = 0; + int x = rgb.cols - label_size.width; + + cv::rectangle(rgb, cv::Rect(cv::Point(x, y), cv::Size(label_size.width, label_size.height + baseLine)), + cv::Scalar(255, 255, 255), -1); + + cv::putText(rgb, text, cv::Point(x, y + label_size.height), + cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(0, 0, 0)); + + return 0; +} + +static Yolo* g_yolo = 0; +static ncnn::Mutex lock; + +class MyNdkCamera : public NdkCameraWindow +{ +public: + virtual void on_image_render(cv::Mat& rgb) const; +}; + +void MyNdkCamera::on_image_render(cv::Mat& rgb) const +{ + // nanodet + { + ncnn::MutexLockGuard g(lock); + + if (g_yolo) + { + std::vector objects; + + g_yolo->detect(rgb, objects); + + g_yolo->draw(rgb, objects); + } + else + { + draw_unsupported(rgb); + } + } + + draw_fps(rgb); +} + +static MyNdkCamera* g_camera = 0; + +extern "C" { + +JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) +{ + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "JNI_OnLoad"); + + g_camera = new MyNdkCamera; + + return JNI_VERSION_1_4; +} + +JNIEXPORT void JNI_OnUnload(JavaVM* vm, void* reserved) +{ + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "JNI_OnUnload"); + + { + ncnn::MutexLockGuard g(lock); + + delete g_yolo; + g_yolo = 0; + } + + delete g_camera; + g_camera = 0; +} + +// public native boolean loadModel(AssetManager mgr, int modelid, int cpugpu); +JNIEXPORT jboolean JNICALL Java_com_tencent_yolov6ncnn_Yolov6Ncnn_loadModel(JNIEnv* env, jobject thiz, jobject assetManager, jint modelid, jint cpugpu) +{ + if (modelid < 0 || modelid > 4 || cpugpu < 0 || cpugpu > 1) + { + return JNI_FALSE; + } + + AAssetManager* mgr = AAssetManager_fromJava(env, assetManager); + + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "loadModel %p", mgr); + + const char* modeltypes[] = + { + "lite-s", + "lite-m", + "lite-l0", + "lite-l1", + "lite-l2", + }; + + const int target_sizes[][2] = + { + {320, 320}, + {320, 320}, + {320, 320}, + {320, 192}, + {224, 128} + }; + + const float mean_vals[][3] = + { + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f}, + {0.f, 0.f, 0.f} + }; + + const float norm_vals[][3] = + { + { 1 / 255.f, 1 / 255.f, 1 / 255.f }, + { 1 / 255.f, 1 / 255.f, 1 / 255.f }, + { 1 / 255.f, 1 / 255.f, 1 / 255.f }, + { 1 / 255.f, 1 / 255.f, 1 / 255.f }, + { 1 / 255.f, 1 / 255.f, 1 / 255.f } + }; + + const char* modeltype = modeltypes[(int)modelid]; + const int *target_size = target_sizes[(int)modelid]; + bool use_gpu = (int)cpugpu == 1; + + // reload + { + ncnn::MutexLockGuard g(lock); + + if (use_gpu && ncnn::get_gpu_count() == 0) + { + // no gpu + delete g_yolo; + g_yolo = 0; + } + else + { + if (!g_yolo) + g_yolo = new Yolo; + g_yolo->load(mgr, modeltype, target_size, mean_vals[(int)modelid], norm_vals[(int)modelid], use_gpu); + } + } + + return JNI_TRUE; +} + +// public native boolean openCamera(int facing); +JNIEXPORT jboolean JNICALL Java_com_tencent_yolov6ncnn_Yolov6Ncnn_openCamera(JNIEnv* env, jobject thiz, jint facing) +{ + if (facing < 0 || facing > 1) + return JNI_FALSE; + + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "openCamera %d", facing); + + g_camera->open((int)facing); + + return JNI_TRUE; +} + +// public native boolean closeCamera(); +JNIEXPORT jboolean JNICALL Java_com_tencent_yolov6ncnn_Yolov6Ncnn_closeCamera(JNIEnv* env, jobject thiz) +{ + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "closeCamera"); + + g_camera->close(); + + return JNI_TRUE; +} + +// public native boolean setOutputWindow(Surface surface); +JNIEXPORT jboolean JNICALL Java_com_tencent_yolov6ncnn_Yolov6Ncnn_setOutputWindow(JNIEnv* env, jobject thiz, jobject surface) +{ + ANativeWindow* win = ANativeWindow_fromSurface(env, surface); + + __android_log_print(ANDROID_LOG_DEBUG, "ncnn", "setOutputWindow %p", win); + + g_camera->set_window(win); + + return JNI_TRUE; +} + +} diff --git a/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/res/layout/main.xml b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/res/layout/main.xml new file mode 100644 index 0000000000..e8a4512529 --- /dev/null +++ b/python/app/fedcv/YOLOv6/deploy/NCNN/Android/app/src/main/res/layout/main.xml @@ -0,0 +1,60 @@ + + + + + +