WD ConvNext Tagger v3 RKNN2
(English README see below)
在RK3588上运行WaifuDiffusion图像标签模型!
推理速度(RK3588):
- 单NPU核: 320ms
内存占用(RK3588):
- 0.45GB
使用方法
克隆或者下载此仓库到本地
安装依赖
pip install numpy<2 pandas opencv-python rknn-toolkit-lite2
- 运行
python run_rknn.py input.jpg
输出结果示例:
tag_id name probs
0 9999999 general 0.521484
5 212816 solo 0.929199
12 15080 short_hair 0.520508
25 540830 1boy 0.947754
40 16613 jewelry 0.577148
72 1300281 male_focus 0.907227
130 10926 pants 0.803223
346 1094664 colored_skin 0.570312
373 4009 turtleneck 0.552246
1532 1314823 black_sweater 0.514160
模型转换
- 安装依赖
pip install numpy<2 onnxruntime rknn-toolkit2
下载原始onnx模型
转换onnx模型到rknn模型:
python convert_rknn.py
已知问题
- int8量化后精度损失极大, 基本不可用. 不建议使用量化推理.
参考
English README
Run WaifuDiffusion image tagging model on RK3588!
Inference Speed (RK3588):
- Single NPU Core: 320ms
Memory Usage (RK3588):
- 0.45GB
Usage
Clone or download this repository
Install dependencies
pip install numpy<2 pandas opencv-python rknn-toolkit-lite2
- Run
python run_rknn.py input.jpg
Output example:
tag_id name probs
0 9999999 general 0.521484
5 212816 solo 0.929199
12 15080 short_hair 0.520508
25 540830 1boy 0.947754
40 16613 jewelry 0.577148
72 1300281 male_focus 0.907227
130 10926 pants 0.803223
346 1094664 colored_skin 0.570312
373 4009 turtleneck 0.552246
1532 1314823 black_sweater 0.514160
Model Conversion
- Install dependencies
pip install numpy<2 onnxruntime rknn-toolkit2
Download original onnx model
Convert onnx model to rknn model:
python convert_rknn.py
Known Issues
- Huge precision loss after int8 quantization, not recommended to use quantized inference.
References
Model tree for happyme531/wd-convnext-tagger-v3-RKNN2
Base model
SmilingWolf/wd-convnext-tagger-v3