Downloads · 30 days
79
16% of all-time downloads
happyme531/Florence-2-base-ft-ONNX-RKNN2
Florence-2-base-ft-ONNX-RKNN2 is a machine learning model from happyme531. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as agpl-3.0.
Downloads · 30 days
79
16% of all-time downloads
All-time downloads
505
Public
Repo size
2.5 GB
Likes
10
Public
Click a slice to open those files.
.onnx1.1 GB · 66%
From the Hugging Face model README
ONNX/RKNN2部署Florence-2视觉多模态大模型!
<MORE_DETAILED_CAPTION>指令, 总时间需要~4秒克隆项目到本地(开发板上)
安装依赖
pip install transformers onnxruntime pillow numpy<2 rknn-toolkit-lite2
cd onnx
python ./run.py ./test.jpg "<MORE_DETAILED_CAPTION>"
你可以修改run.py最上方的import来切换使用ONNX或RKNN推理。
你需要提前安装rknn-toolkit2 v2.3.2或更高版本.
cd onnx
python convert.py all
注意: RKNN模型不支持运行时任意长度的输入, 所以需要提前确定好输入的shape. 之后可以修改convert.py中的vision_size, vision_tokens, prompt_tokens来修改输入的shape.
Buffer overflow!然后转换失败, 所以目前是使用512x512的输入, 推理质量会下降Deploy Florence-2 vision multi-modal large model with ONNX/RKNN2!
<MORE_DETAILED_CAPTION> instruction takes ~4 seconds in total.Clone the project locally (on your development board).
Install dependencies:
pip install transformers onnxruntime pillow numpy<2 rknn-toolkit-lite2
cd onnx
python ./run.py ./test.jpg "<MORE_DETAILED_CAPTION>"
You can modify the import at the top of run.py to switch between ONNX and RKNN inference.
You need to install rknn-toolkit2 v2.3.2 or a higher version beforehand.
cd onnx
python convert.py all
Note: RKNN models do not support dynamic input shapes at runtime, so you need to define the input shape in advance. You can modify vision_size, vision_tokens, and prompt_tokens in convert.py to change the input shape.
Buffer overflow! error and fail the conversion. Therefore, a 512x512 input was used, which degraded inference quality.