AI.deploy.box
A toolbox for deep learning model deployment using C++ YoloX | YoloV7 | YoloV8 | Gan | OCR | MobileVit | Scrfd | MobileSAM | StableDiffusion
Install / Use
/learn @TalkUHulk/AI.deploy.boxREADME
English | <a href="README_cn.md">简体中文</a>
<p align="center"> <img src="./doc/logo.gif" align="middle" width="320px"/> <p align="center"> <div align='center'> <img src="https://img.shields.io/badge/MacOS-%E2%9C%93-green"> <img src="https://img.shields.io/badge/Linux-%E2%9C%93-green"> <img src="https://img.shields.io/badge/Win64-x-red"> <img src="https://img.shields.io/badge/Android-%E2%9C%93-green"> <img src="https://img.shields.io/badge/RasperryPi-%E2%9C%93-green"> <img src="https://img.shields.io/badge/Webassembly-%E2%9C%93-green"> </div> <div align='center'> <img src="https://img.shields.io/badge/Onnx-%E2%9C%93-blue"> <img src="https://img.shields.io/badge/MNN-%E2%9C%93-blue"> <img src="https://img.shields.io/badge/NCNN-%E2%9C%93-blue"> <img src="https://img.shields.io/badge/TNN-%E2%9C%93-blue"> <img src="https://img.shields.io/badge/PaddleLite-%E2%9C%93-blue"> <img src="https://img.shields.io/badge/OpenVINO-%E2%9C%93-blue"> </div> <div align='center'> <img src="https://img.shields.io/badge/C-%E2%9C%93-orange"> <img src="https://img.shields.io/badge/C++-%E2%9C%93-orange"> <img src="https://img.shields.io/badge/Python-%E2%9C%93-orange"> <img src="https://img.shields.io/badge/Lua-%E2%9C%93-orange"> <img src="https://img.shields.io/badge/Go-%E2%9C%93-orange"> </div>📌AiDB : A toolbox for deep learning model deployment using C++. Abstract mainstream deep learning inference frameworks into unified interfaces, including ONNXRUNTIME, MNN, NCNN, TNN, PaddleLite, and OpenVINO. Provide deployment demo for multiple scenarios and languages. This project is not only used to record learning, but also a summary of my work over the past few years. If this project inspires you or helps you, welcome ⭐Star⭐ to support me, which is the driving force for me to keep updating! 🍔
📌Article
AiDB:一个集合了6大推理框架的AI工具箱 | 加速你的模型部署
如何使用“LoRa”的方式加载ONNX模型:StableDiffusion相关模型 的C++推理
<p align="center"> <img src="./doc/entry/android_front_base.gif" width="128px"/> <img src="./doc/entry/android_front_dense.gif" width="128px"/> <img src="./doc/entry/android_ocr.gif" width="128px"/> <img src="./doc/entry/android_yolox.gif" height="228px"/> <img src="./doc/entry/android_tpsmm.gif" height="228px"/> <br> <img src="./doc/entry/wasm_pc.gif" height="185" width="256px"/> <img src="./doc/entry/rasperry_yolox.gif" height="185" width="256px"/> <br> <img src="./doc/entry/Qt_face.gif" height="185" width="256px"/> <img src="./doc/entry/Qt_ocr.gif" height="185" width="256px"/> <img src="./doc/entry/qt_mobilesam.gif" height="185" width="256px"/> <p align="center">https://github.com/TalkUHulk/ai.deploy.box/assets/18474163/f9a03178-8d50-4627-9c61-21e99734a37a
https://github.com/TalkUHulk/ai.deploy.box/assets/18474163/6f8136b7-07fa-4d39-97ef-797d6f6c37de
Features 🍉🍉
- rich backend: integrating mainstream AI inference frameworks, including OnnxRuntime, MNN, NCNN, TNN, PaddleLite, and OpenVINO;
- user friendly: abstracting all inference frameworks into a unified interface and selecting them through configuration files for ease of use;
- multiple scenarios: support Linux、MacOS、Android(Win64 coming soon、IOS--poverty has limited my work),provide PC Demo(Qt) 、 Android Demo(Kotlin) 、 Lua Demo and minimal server deployment demo( Go Zeros and Python FastAPI )
- multiple languages: provide calling instances for Python, Lua, and Go;
Demo 🍓🍓
Demo Repo 🍇🍇
Contents 📖💡
- Features
- Demo
- Demo Repo
- FrameWork
- Quick Start
- Sample Usage
- Pitfalls
- Maintainers
- Contributing
- LICENSE
FrameWork 📝 📝
<p align="center"> <img src="./doc/arch.png" align="middle"/> <p align="center">There are two modes available, S mode(C api) and H mode(C++ api)
<div align='center'> <img src="./doc/S-mode.gif" height="185" /> <img src="./doc/H-mode.gif" height="185" /> </div>Quick Start ⚡⚡
environment
<details> <summary>Recommend using Docker</summary>docker pull mister5ive/ai.deploy.box
</details>
Build
Docker(recommend)
git lfs clone https://github.com/TalkUHulk/ai.deploy.box.git
cd ai.deploy.box.git
docker build -t aidb-dev .
docker run -it --name aidb-test aidb-dev
Build from source code
git lfs clone https://github.com/TalkUHulk/ai.deploy.box.git
cd ai.deploy.box.git
mkdir build && cd build
cmake .. -DC_API={ON/OFF} -DBUILD_SAMPLE={ON/OFF} -DBUILD_PYTHON={ON/OFF} -DBUILD_LUA={ON/OFF} -DENGINE_NCNN_WASM={ON/OFF} -DOPENCV_HAS_FREETYPE={ON/OFF} -DENGINE_MNN={ON/OFF} -DENGINE_ORT={ON/OFF} -DENGINE_NCNN={ON/OFF} -DENGINE_TNN={ON/OFF} -DENGINE_OPV={ON/OFF} -DENGINE_PPLite={ON/OFF}
make -j8
- C_API: compile C library;
- BUILD_PYTHON: compile Python api;
- BUILD_LUA: compile Lua api;
- OPENCV_HAS_FREETYPE: opencv-contrib complied with freetype or not. cv::putText can put chinese;
- BUILD_SAMPLE: compile sample;
- ENGINE_NCNN_WASM: compile sample;
- ENGINE_MNN: enable mnn;
- ENGINE_ORT: enable onnxruntim;
- ENGINE_NCNN: enable ncnn;
- ENGINE_TNN: enable tnn;
- ENGINE_OPV: enable openvino;
- ENGINE_PPLite: enable paddle-lite;
- ENABLE_SD: enable stable diffusion;
Models
Model Lite: MEGA | Baidu: 92e8
[News!!!] All models convert to 🤗.
<details> <summary>Model List</summary>| Demo | Model name | Model Type | Pretrained From | ONNX | MNN
