WeijingShi / Point-GNN

Point-GNN: Graph Neural Network for 3D Object Detection in a Point Cloud, CVPR 2020.
MIT License
523 stars 114 forks source link

Regarding Custom Dataset #85

Closed pytholic closed 2 years ago

pytholic commented 2 years ago

Hi. I have been doing research regarding point cloud object detection. However, all the architectures currently support only benchmark datasets and there is no proper guidance on how to prepare our own datasets. For example, I have some point clouds of patients and I want to detect some regions for medical purposes. However, I cannot find any guidance here or in other models as well to work with custom datasets. Will appreciate any guidance on this. Thanks!

WeijingShi commented 2 years ago

Hi @rajahaseeb147,

For any dataset, we need to two basic APIs: read_points(sample_id) and read_boxes(sample_id). read_points() should return points and their attributes such as reflections. read_boxes() should return the object class and its bounding boxes.

The points and the bounding box should be in the same coordinate frame. Otherwise, we need the calibration information to make them so.

In this Point-GNN version, we read point cloud data here: https://github.com/WeijingShi/Point-GNN/blob/48f3d79d5b101d3a4b8439ba74c92fcad4f7cab0/train.py#L79 Besides some coordinate transformations, get_cam_points_in_image_with_rgb simply returns [N, 3] point coordinates and [N, 4] point attributes (intensity, r, g, b).

We read boxes here: https://github.com/WeijingShi/Point-GNN/blob/48f3d79d5b101d3a4b8439ba74c92fcad4f7cab0/train.py#L81 It returns the object class and KITTI object boxes. Note, many autonomous driving datasets and detection frameworks use a 7-DoF box format (center_x, center_y, center_z, length, width, height, heading) assuming we only care about the vehicle's yaw angle. In your medical dataset, this type of box or any box, in general, may not be a good representation. Maybe segmentation is more suitable.

You can implement your own read_points(simple_id) and read_boxes(simple_id) and replace ours in the code. Or just make your dataset in KITTI's format. I think most of the frameworks support the KITTI format.

Hope it helps. Weijing

pytholic commented 2 years ago

@WeijingShi Thank you for such detailed reply. I opted for segmentation for the same reason that you mentioned. Thanks again!