检测与数据集导出
运行时原生输出:Box3D JSON
运行时 3D 检测的输出固定为 Box3D JSON({camera}/labels/frame_*.json)。每个对象导出世界系位姿:world_position(cm)与 world_rotation(四元数)。
- 仅对标记了
IA.SDG.Detect的 Actor 生成检测;类别来自IA.Type.{type}标签(或由scene_manager.auto_detect_tags自动附加)。 - 3D 检测适用于针孔相机(
pinhole)。
离线转换:KITTI / COCO / BOP
统一使用 spec 驱动的 dataset_converter:
python -m dataset_converter.convert <capture_dir> --format coco
python -m dataset_converter.convert <capture_dir> --format bop
python -m dataset_converter.convert <capture_dir> --format kitti
KITTI
每帧每相机一个 .txt,每行 15 个空格分隔字段:
type truncated occluded alpha x1 y1 x2 y2 h w l x y z ry
| 字段 | 含义 | 坐标系 |
|---|---|---|
type | 类别(来自 IA.Type.{type}) | — |
x1 y1 x2 y2 | 2D BBox 像素坐标 | 图像空间 |
h w l | 3D 尺寸(高/宽/长,米) | KITTI camera |
x y z | 3D 中心(米) | KITTI camera(X 右、Y 下、Z 前) |
ry | 绕 KITTI Y 轴旋转(弧度) | KITTI camera |
坐标系转换:UE(X 前、Y 右、Z 上,cm,左手)→ KITTI(X 右、Y 下、Z 前,m,右手)。KITTI 位姿由 Box3D 的世界 R/t 直接派生,真实可用。
COCO
采集结束写单文件 annotations.json(标准 COCO detection 格式):
{
"images": [{"id": 1, "file_name": "sensor_L/RGB/RGB_000000.jpg", "width": 1920, "height": 1080}],
"annotations": [{"id": 1, "image_id": 1, "category_id": 1, "bbox": [12, 34, 56, 78], "area": 4368, "iscrowd": 0}],
"categories": [{"id": 1, "name": "Car", "supercategory": ""}]
}
COCO 仅含 2D BBox(不含 3D 尺寸/位置/旋转);3D 信息请用 KITTI 或 Box3D。
BOP(6D 位姿)
BOP 通过实例分割 ID 与 Box3D instance_ids 的真实闭合来导出 6D 位姿:对每个与某条检测的 instance_ids 完全相等的 InstanceSegmentation 原始 ID,输出一个对象,使用该检测真实的 R_m2c / t_m2c;无闭合则不输出该对象(不产生占位掩码或单位位姿)。
:::warning BOP 6D 依赖实例分割
BOP 的 instance_ids 与掩码对应关系,仅当采集了 InstanceSegmentation 时才成立。因此用于 BOP / 带实例对应的检测时,被标记物体必须满足 Nanite 硬门禁(关闭 Nanite),详见故障排查。仅几何 Box3D(不含实例对应)不受此限。
:::
校验
Scripts/validate_detection.py 对 Box3D JSON 做重投影 IoU + 有限性几何校验(格式有效 ≠ 几何正确)。