rdk_robot_dev_agent/knowledge_hub/文本图片特征检索算法部署流程.md

47 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 文本图片特征检索算法部署流程CLIP 入库
1. 依赖安装
pip3 install onnxruntime
pip3 install ftfy
pip3 install wcwidth
pip3 install regex
2. 从Web端下载运行示例需要的模型文件。
wget http://archive.d-robotics.cc/models/clip_encode_text/text_encoder.tar.gz
sudo tar -xf text_encoder.tar.gz -C config
3. 配置tros.b环境
source /opt/tros/humble/setup.bash
4. 从tros.b的安装路径中拷贝出运行示例需要的配置文件。
cp -r /opt/tros/${TROS_DISTRO}/lib/clip_encode_image/config/ .
5. 启动launch文件RDK S100为例RDK X5 为ros2 launch clip_manage hobot_clip_manage.launch.py clip_mode:=0 clip_db_file:=clip.db clip_storage_folder:=/root/config
ros2 launch clip_manage hobot_clip_manage.launch.py clip_mode:=0 clip_image_model_file_name:=config/full_model_11.hbm clip_db_file:=clip.db clip_storage_folder:=/root/config
# 文本图片特征检索算法部署流程:检索
1. 依赖安装
pip3 install onnxruntime
pip3 install ftfy
pip3 install wcwidth
pip3 install regex
2. 从Web端下载运行示例需要的模型文件。
wget http://archive.d-robotics.cc/models/clip_encode_text/text_encoder.tar.gz
sudo tar -xf text_encoder.tar.gz -C config
3. 配置tros.b环境
source /opt/tros/humble/setup.bash
4. 启动launch文件RDK S100为例RDK X5 为ros2 launch clip_manage hobot_clip_manage.launch.py clip_mode:=1 clip_image_model_file_name:=config/full_model_11.hbm clip_db_file:=clip.db clip_result_folder:=result clip_text:="a diagram"
ros2 launch clip_manage hobot_clip_manage.launch.py clip_mode:=1 clip_image_model_file_name:=config/full_model_11.hbm clip_db_file:=clip.db clip_result_folder:=result clip_text:="a diagram"
5. 检索结果可视化
打开另一个终端
cp -r /opt/tros/${TROS_DISTRO}/lib/clip_manage/config/index.html .
python -m http.server 8080
6. 查看检索结果
在PC端的浏览器输入http://IP:8080 即可查看图像检索结果IP为设备IP地址