Objectron开发者指南:如何扩展数据集支持新的物体类别
Objectron开发者指南:如何扩展数据集支持新的物体类别
【免费下载链接】ObjectronObjectron is a dataset of short, object-centric video clips. In addition, the videos also contain AR session metadata including camera poses, sparse point-clouds and planes. In each video, the camera moves around and above the object and captures it from different views. Each object is annotated with a 3D bounding box. The 3D bounding box describes the object’s position, orientation, and dimensions. The dataset contains about 15K annotated video clips and 4M annotated images in the following categories: bikes, books, bottles, cameras, cereal boxes, chairs, cups, laptops, and shoes项目地址: https://gitcode.com/gh_mirrors/ob/Objectron
Objectron是一个以物体为中心的短视频片段数据集,包含约15K个带注释的视频剪辑和4M张带注释的图像,目前支持自行车、书籍、瓶子等9个物体类别。本指南将详细介绍如何为Objectron数据集添加新的物体类别,帮助开发者轻松扩展数据集功能。
1. 准备新类别数据采集
扩展Objectron数据集的第一步是为新物体类别准备高质量的视频数据。数据采集需遵循以下规范:
- 视频要求:每个视频片段应包含物体从不同角度的视图,建议时长5-10秒,帧率30fps
- 环境要求:选择光照充足、背景简单的场景,确保物体清晰可见
- 相机移动:围绕物体进行多角度拍摄,包括俯视、侧视等视角
- AR元数据:必须包含相机姿态、稀疏点云和平面信息(可使用ARCore或ARKit采集)
2. 标注新物体3D边界框
新类别数据需要标注3D边界框,描述物体的位置、方向和尺寸。
图:Objectron数据集中不同物体的3D边界框标注示例,展示了自行车、书籍、瓶子等物体的3D空间定位
标注过程中需要定义:
- 物体中心点在世界坐标系中的位置
- 3x3旋转矩阵描述物体方向
- 3D尺度向量表示物体长、宽、高(单位:米)
- 8个顶点的3D坐标(遵循object.proto定义的格式)
3. 修改数据模式定义
要支持新类别,需要更新协议缓冲区定义文件:
更新物体类别枚举
编辑object.proto文件,在Object消息的category字段中添加新类别名称:message Object { // ...现有字段... string category = 2; // 添加新类别名称,如"backpack" // ...其他字段... }定义新类别关键点
为新物体定义3D关键点模板,包括中心点和边界框顶点:message Skeleton { string category = 2; // 新类别名称 repeated KeyPoint keypoints = 3; // 定义关键点坐标 // ...其他字段... }重新生成Python代码
使用protoc编译更新后的proto文件:protoc --python_out=. objectron/schema/object.proto protoc --python_out=. objectron/schema/annotation_data.proto
4. 创建新类别索引文件
在index目录下为新类别创建三个索引文件:
[new_category]_annotations- 完整标注数据[new_category]_annotations_train- 训练集划分[new_category]_annotations_test- 测试集划分
索引文件格式应与现有类别保持一致,每行包含视频片段的元数据和标注文件路径。可参考现有索引文件如index/bike_annotations的格式。
5. 更新数据集解析代码
修改数据集解析模块以支持新类别:
更新类别列表
在objectron/dataset/parser.py中添加新类别到类别列表:SUPPORTED_CATEGORIES = ['bike', 'book', 'bottle', ..., 'new_category']调整3D边界框处理
确保iou.py中的3D交并比计算支持新类别的边界框形状:def compute_3d_iou(box1, box2): """计算两个3D边界框的交并比""" # 确保支持新类别的边界框尺寸计算
6. 验证新类别集成
添加新类别后,使用提供的notebooks验证集成是否成功:
运行数据加载测试
使用notebooks/Parse Annotations.ipynb加载新类别的标注数据,检查是否能正确解析3D边界框可视化验证
使用notebooks/objectron-geometry-tutorial.ipynb可视化新类别物体的3D边界框,确认标注正确性评估指标检查
运行notebooks/3D_IOU.ipynb验证新类别3D边界框的交并比计算是否正常
7. 提交贡献指南
完成新类别的添加后,可按照以下步骤贡献到Objectron项目:
- 确保所有代码遵循项目编码规范
- 提供新类别数据集的样本和说明文档
- 创建Pull Request,描述新类别添加的详细信息
- 参与代码审查并根据反馈进行修改
通过以上步骤,你可以成功为Objectron数据集添加新的物体类别,扩展其在3D物体检测和姿态估计任务中的应用范围。如有疑问,可参考项目中的CONTRIBUTING.md获取更多帮助。
【免费下载链接】ObjectronObjectron is a dataset of short, object-centric video clips. In addition, the videos also contain AR session metadata including camera poses, sparse point-clouds and planes. In each video, the camera moves around and above the object and captures it from different views. Each object is annotated with a 3D bounding box. The 3D bounding box describes the object’s position, orientation, and dimensions. The dataset contains about 15K annotated video clips and 4M annotated images in the following categories: bikes, books, bottles, cameras, cereal boxes, chairs, cups, laptops, and shoes项目地址: https://gitcode.com/gh_mirrors/ob/Objectron
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
