开放域实例
示例简介
开放域实例分割示例是一组位于 /app/pydev_demo/05_open_instance_seg_sample/ 中的 Python 接口 开发代码示例,用于演示如何使用 hbm_runtime 模块进行开放域目标检测任务。该示例使用 YOLO-World 模型,支持通过文本提示词(prompts)进行灵活的目标检测,无需预定义类别列表。
包含的模型示例:
root@ubuntu:/app/pydev_demo/05_open_instance_seg_sample$ tree -L 1
.
└── 01_yolo_world
效果展示
示例会检测图像中与文本提示词匹配的目标,并绘制检测框、类别名称和置信度。

硬件准备
硬件连接
该示例只需要 RDK 开发板本身,无需额外的外设连接。确保开发板正常供电并启动系统。

快速开始
代码以及板端位置
进入到 /app/pydev_demo/05_open_instance_seg_sample/ 位置,可以看到包含了开放域实例分割示例文件夹:
root@ubuntu:/app/pydev_demo/05_open_instance_seg_sample# tree
.
└── 01_yolo_world
├── dog.jpeg
├── offline_vocabulary_embeddings.json
├── result.jpg
├── yolo_world.bin
└── yoloworld.py
编译以及运行
Python 示例无需编译,直接运行即可。
cd /app/pydev_demo/05_open_instance_seg_sample/01_yolo_world
python yoloworld.py
执行效果
root@ubuntu:/app/pydev_demo/05_open_instance_seg_sample/01_yolo_world# python yoloworld.py
[BPU_PLAT]BPU Platform Version(1.3.6)!
[HBRT] set log level as 0. version = 3.15.55.0
[DNN] Runtime version = 1.24.5_(3.15.55 HBRT)
[A][DNN][packed_model.cpp:247][Model](2000-01-01,10:59:17.916.291) [HorizonRT] The model builder version = 1.23.6
[W][DNN]bpu_model_info.cpp:491][Version](2000-01-01,10:59:18.311.878) Model: yolo_world. Inconsistency between the hbrt library version 3.15.55.0 and the model build version 3.15.49.0 detected, in order to ensure correct model results, it is recommended to use compilation tools and the BPU SDK from the same OpenExplorer package.
...
[Saved] Result saved to: result.jpg