Example overview示例总览
Complete Installation and check input formats in Data and examples. Example 01 introduces 2D detection and segmentation; 02 estimates a single object's pose from a supplied region; 03 uses published detection boxes.
先完成安装,并在数据与示例核对输入格式。示例 01 介绍 2D 检测与分割,02 使用给定区域估计单个物体的位姿,03 接入已公布的检测框。
The 17 public examples follow the documentation's progression: 01–08 cover detection, pose interfaces, custom data, BOP export and tracking; 09 adds TACO[5] multi-object tracking; 10 is the ROBI[7] experiment; 11–12 cover reconstruction and cross-scene pose; 13–17 cover robot simulation. Edit the visible recipe variables for your inputs. Supporting files stay in the folder bearing the entry script's name.
全部 17 个公共示例按文档的使用逻辑连续编号:01–08 为检测、位姿接口、自定义数据、BOP 导出与跟踪;09 为 TACO[5] 多物体跟踪;10 为 ROBI[7] 实验;11–12 为重建与跨场景位姿;13–17 为机器人仿真。通过脚本中的可见配置变量设置输入,辅助文件放在与入口同名的目录中。
| Script脚本 | Learning objective学习目标 | Page页面 |
|---|---|---|
| 2D detection and 6D pose interfaces2D 检测与 6D 位姿接口 | ||
examples/01_one_rgb_detect_segment.py |
One LM-O[4] RGB frame: build a CAD template bank, then return 2D boxes and masks. No pose step.一帧 LM-O[4] RGB:建立 CAD 模板库,返回 2D 框和 mask;此步不估计位姿。 | 2D detector call2D 检测调用 |
examples/02_one_category_one_instance.py |
Estimate the pose of one known object with estimate_one_category_one_instance; see the result on the pose page.用 estimate_one_category_one_instance 估计单个已知物体的位姿;结果图见位姿页。 |
One category, one instance单类别、单实例 |
examples/03_published_boxes_to_pose.py |
Read the published detection excerpt for image 307 and estimate all retained instances in one batch, with independent hypothesis groups.读取第 307 帧的已公布检测摘录,同帧保留实例批量估计,各实例的候选组独立评分。 | Published boxes已公布的检测框 |
examples/04_6d_localization.py |
6D localization. Many known categories, each with a fixed count. LM-O scene 2, image 307: eight categories, one each.6D 定位。多个已知类别,每个类别数量固定。LM-O 场景 2 第 307 帧:八个类别,每个 1 个。 | Localization定位 |
examples/05_bop_6d_detection.py |
BOP challenge, 6D detection. Many categories, many instances, count unknown: 2D, then estimate_frame_many_categories_many_instances.BOP 挑战,6D 检测。多类别、多实例,数量事先不知道:先 2D,再 estimate_frame_many_categories_many_instances。 |
Detection检测 |
examples/06_custom_scene.py |
Load a custom RGB-D folder and CAD meshes; the documentation demonstrates a real wedge capture.读取自定义 RGB-D 目录与 CAD 网格;文档展示三角块实拍案例。 | Custom data自定义数据 |
examples/07_write_bop_pose_csv.py |
Export a BOP pose CSV from live 2D detections or a supplied JSON. Both paths batch each frame's retained instances; the JSON path filters input masks across categories first.将现场 2D 检测或外部 JSON 候选导出为 BOP 位姿 CSV。两条路径均按帧批量估计;JSON 路径先对输入掩码做跨类别抑制。 | Result export结果导出 |
examples/08_ycbineoat_one_instance.py |
Initialize one YCBInEOAT[6] track from a predicted mask, then track its target mask and update its pose. Recovery compares tracked and re-estimated poses in a supported two-candidate group.从预测掩码初始化一条 YCBInEOAT[6] 轨迹,再跟踪目标掩码并更新位姿;恢复分支将跟踪与重估位姿组成受支持的两候选评分组。 | One instance tracking单实例跟踪 |
| Application cases应用案例 | ||
examples/09_taco_many_instances.py |
Predict SAM 2[2] masks from saved RGB clicks; share DINOv2[1] frame features, batch both tracks and recovery candidates, and preserve each track's reliable state.保存的 RGB 点击点预测 SAM 2[2] 掩码;共享 DINOv2[1] 帧特征,批量更新双物体及补救候选,各轨迹保留可靠状态。 | Multi-object tracking多物体跟踪 |
examples/10_robi_zigzag.py |
Detect and estimate multiple instances of one CAD in ROBI[7] Zigzag, scene 4, view 0. Pose inference is batched; the Zigzag viewer describes its candidate and iteration settings in the ROBI case.在 ROBI[7] Zigzag 场景 4 第 0 帧检测同一 CAD 的多个实例并批量估计位姿;Zigzag 查看器的候选与迭代设置见 ROBI 案例。 | ROBI |
examples/11_reconstruct_object.py |
One RGB-D and a point or sentence: reconstruct, size, select a pose, update shape with RoMa[3], and save a matched mesh/pose bundle.一张 RGB-D 与点或句子:重建、定标、选择位姿、RoMa[3] 更新形状,保存配套网格与位姿。 | 3D generation3D 生成 |
examples/12_cross_scene_pose.py |
Read the saved reconstruction, detect its top-scoring instance in another RGB-D image, then estimate its pose.读取保存的重建网格,在另一张 RGB-D 中选择最高分检测实例,再估计位姿。 | Cross-scene pose estimation跨场景位姿估计 |
examples/13_known_mesh_place.py |
Panda with table and wrist RGB-D: estimate the known bottle and box, grasp, measure the held-object offset, and compare planned and corrected placement.Panda 桌面与腕部 RGB-D:估计已知瓶子和盒子,抓取、测量夹持偏差,对照计划与修正放置。 | Robot机器人 |
examples/14_bridge_tasks.py |
WidowX uses the first-frame estimated pose to approach, close, lift, transfer, release and retreat in Bridge[8] tasks.WidowX 在 Bridge[8] 任务中根据首帧估计位姿接近、合爪、抬升、搬运、松爪与撤回。 | Robot机器人 |
examples/15_xarm_cube.py |
xArm6/Robotiq grasps a cube at its estimated world pose and releases it at the marker; each planned step records RGB-D.xArm6/Robotiq 按估计的世界位姿抓取方块,在标记处松爪;每个规划步记录 RGB-D。 | Robot机器人 |
examples/16_follow_saved.py |
Track saved robot RGB-D: initialize from verified estimates, share image features, batch all same-frame pose updates, and report errors afterward.跟踪保存的机器人 RGB-D:用已核验估计初始化、共享图像特征、批量更新同帧位姿,并事后报告误差。 | Robot机器人 |
examples/17_virtual_grasp.py |
Convert saved estimated poses to world coordinates, construct virtual gripper axes, and project the grasp into RGB. Physical control is shown in 13–15.将保存的估计位姿转到世界坐标,构造虚拟夹爪轴并投影到 RGB;实际控制流程见 13–15。 | Robot机器人 |
References and licenses参考文献与许可
- DINOv2 — Apache-2.0. Code and official DINOv2 weights; retain copyright and license.源码与官方 DINOv2 权重;保留版权和许可。 · GitHubGitHub · License/notice 1许可/声明 1
- SAM 2 — Apache-2.0; cctorch: BSD-3-Clause. Native source and official checkpoints; cctorch carries an additional BSD notice. Ultralytics-converted files require checking their distributor terms.原生源码与官方权重;cctorch 另附 BSD 声明。Ultralytics 转换文件还需核对分发方条款。 · GitHubGitHub · License/notice 1许可/声明 1 · License/notice 2许可/声明 2
- RoMa — MIT. Matching source; separately obtained checkpoints and dependencies retain upstream terms.匹配源码;另行获取的权重与依赖保留上游条款。 · GitHubGitHub · License/notice 1许可/声明 1
- LM-O data — CC-BY-SA-4.0. Data and model excerpt, not the loader code.数据与模型摘录,不是读取代码。 · Original source原始来源 · GitHub: BOP toolkitGitHub:BOP 工具集
- TACO data — Not separately verified / 未单独核实. Data terms have not been separately verified. The official repository is the original source; the referenced Hugging Face acquisition mirror has no explicit license field. Confirm the data owner's terms for redistribution or commercial use.数据条款尚未单独核实。官方仓库为原始出处;实际获取数据的 Hugging Face 镜像数据卡未声明明确许可字段。再分发或商业使用须核实数据权利方的条款。 · GitHubGitHub
- YCBInEOAT data — Not separately verified / 未单独核实. Tracking data permission must be checked at the original archive; the comparison code license does not establish the data license.跟踪数据许可须在原始归档核实;对照代码的许可不能作为数据许可。 · GitHubGitHub · GitHubGitHub
- ROBI data — Not separately verified / 未单独核实. The saved public poses and dataset are credited to ROBI; an independent grant to redistribute them has not been verified.保存的公开位姿和数据均注明 ROBI 来源;其再分发授权尚未独立核实。 · GitHubGitHub
- BridgeData V2 · Original source原始来源 · GitHubGitHub
Model weights and dataset/task assets may have separate terms. WAPR's source license does not replace them.模型权重、数据集与任务资源可能有独立条款;WAPR 源码许可不替代这些许可。