inoryQwQ commited on
Commit
cdf29a6
·
verified ·
1 Parent(s): bce48ef

v2: Fix calibration, U16 quantization

Browse files
Files changed (1) hide show
  1. python/README.md +73 -0
python/README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VisDrone YOLO11s Python SDK
2
+
3
+ 基于 libdet.axera 的 VisDrone 航拍目标检测 Python SDK。
4
+
5
+ ## 目录结构
6
+ ```
7
+ python/
8
+ example.py # 推理示例入口
9
+ requirements.txt # Python 依赖
10
+ visdrone_yolo11s_sdk/ # SDK 包
11
+ __init__.py
12
+ inference.py # VisDroneYOLODetector 类
13
+ preprocess.py # 图像预处理
14
+ postprocess.py # 检测结果绘制
15
+ pydet/ # libdet.axera Python 绑定
16
+ ```
17
+
18
+ ## 环境要求
19
+ - Python >= 3.8
20
+ - libopencv-dev(系统级,用于 libdet.axera 编译)
21
+ - AX 板端或 AX650 主机环境
22
+
23
+ ## 安装步骤
24
+
25
+ ### 1. 安装 Python 依赖
26
+ ```bash
27
+ cd python
28
+ pip install -r requirements.txt
29
+ ```
30
+
31
+ ### 2. 安装 pyaxengine
32
+ ```bash
33
+ git clone https://github.com/AXERA-TECH/pyaxengine.git
34
+ pip install ./pyaxengine
35
+ ```
36
+
37
+ ### 3. 编译 libdet.axera(后处理库)
38
+ ```bash
39
+ git clone https://github.com/AXERA-TECH/libdet.axera.git
40
+ cd libdet.axera
41
+ sudo apt install libopencv-dev build-essential
42
+ ./build.sh
43
+ export LD_LIBRARY_PATH=$(pwd)/build/lib:${LD_LIBRARY_PATH}
44
+ cd ..
45
+ ```
46
+
47
+ ## 快速运行
48
+ ```bash
49
+ cd python
50
+ python example.py \
51
+ --model ../models/model.axmodel \
52
+ --image ../demo/demo_00.jpg
53
+ ```
54
+
55
+ ## API 说明
56
+
57
+ ### VisDroneYOLODetector
58
+ ```python
59
+ from visdrone_yolo11s_sdk import VisDroneYOLODetector
60
+
61
+ detector = VisDroneYOLODetector(
62
+ model_path="model.axmodel",
63
+ num_classes=10,
64
+ threshold=0.25,
65
+ )
66
+ objects = detector.detect(image_rgb_uint8)
67
+ # objects: list of Object(box=[x,y,w,h], score=float, label=int)
68
+ ```
69
+
70
+ ## 输入预处理
71
+ - resize 到 640x640
72
+ - BGR → RGB 转换
73
+ - 保持 uint8 格式(不做归一化)