Skip to content

TalkUHulk/aidb_python_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aidb-python-demo

AiDB binding to Python Demo :Open In Colab


AiDB deployed as the server by fastapi.

Tested Environment

  • Ubuntu 20.04.4 LTS / MacOS
  • Python 3.x

Usage

  • Prepare environment

install python3.x、cmake、gcc and so on. All backend libs can download from AiDB

  • Clone AiDB
git clone https://github.com/TalkUHulk/ai.deploy.box
  • Compile AiDB library(custom backend)
cd ai.deploy.box
mkdir build && cd build
cmake -DC_API=ON -DENGINE_ORT=ON -DENGINE_MNN=ON -DENGINE_NCNN=ON  -DENGINE_TNN=OFF -DENGINE_OPV=OFF -DENGINE_PPLite=OFF -DENGINE_NCNN_WASM=OFF -DBUILD_SAMPLE=OFF ../
make -j8

generate libAiDB_C.so in ai.deploy.box/build/source/ and put it in lib

  • prepare files demo need.

download models and unzip it in aidb_python_demo then rename models

copy config in aidb_python_demo.

copy extra in aidb_python_demo.

folder structure

aidb_python_demo/
├── main.py
├── api
    ├── __init__.py
    ├── aidb.py
    └── types.py  
├── config
    ├── mnn_config.yaml
    ├── ncnn_config.yaml
    .
    .
    .
    └── onnx_config.yaml
├── models
    ├── onnx
    ├── ncnn
    ├── mnn
    ├── tnn
    ├── paddle
    └── openvino   
.
.
.
└── extra
    ├── ppocr_keys_v1.txt
    .
    .
    └── imagenet-1k-id.txt
  • Run
uvicorn main:app --reload

  • Test

reference aidb_client.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages