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

36 lines
1.6 KiB
Markdown
Raw Permalink 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.

# 文本图片特征检索算法部署流程:
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 S100ros2 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
RDK X5ros2 launch clip_manage hobot_clip_manage.launch.py clip_mode:=0 clip_db_file:=clip.db clip_storage_folder:=/root/config
6. 重开一个终端配置tros.b环境
source /opt/tros/humble/setup.bash
7. 启动检索launch文件
RDK S100ros2 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"
RDK X5launch 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"
8. 检索结果可视化
打开另一个终端
cp -r /opt/tros/${TROS_DISTRO}/lib/clip_manage/config/index.html .
python -m http.server 8080
9. 查看检索结果
在PC端的浏览器输入http://IP:8080 即可查看图像检索结果IP为设备IP地址