OpenPCDet icon indicating copy to clipboard operation
OpenPCDet copied to clipboard

How to see both the prediction boxes and GT boxes in demo.py?

Open HuangZhe885 opened this issue 3 years ago • 3 comments

I noticed the def draw_scenes() in visualize_utils.py ,but how could I write in demo.py ? I really don`t know how to insert, Could anybody have the complete code ? thank you soooooo much , orz!

HuangZhe885 avatar Jul 22 '22 08:07 HuangZhe885

In Demo.py here input the pred_dict (format: [[x, y, x, l, w, h, score],...]) to the draw function to visualize the predict results: https://github.com/open-mmlab/OpenPCDet/blob/c233477a4a4bf2861a978794d6b9c047f64641f7/tools/demo.py#L98-L103 And you could write another function here to read gt boxes from label files (in the same form of pred_dict) and input to the draw function. It is not difficult.

OrangeSodahub avatar Jul 22 '22 13:07 OrangeSodahub

In Demo.py here input the pred_dict (format: [[x, y, x, l, w, h, score],...]) to the draw function to visualize the predict results:

https://github.com/open-mmlab/OpenPCDet/blob/c233477a4a4bf2861a978794d6b9c047f64641f7/tools/demo.py#L98-L103

And you could write another function here to read gt boxes from label files (in the same form of pred_dict) and input to the draw function. It is not difficult.

data_dict in demo.py does not have the key of "gt_boxes". Below is the code I have added

print(data_dict['gt_boxes'].shape) V.draw_scenes( points=data_dict['points'][:, 1:], ref_boxes=data_dict['gt_boxes'][0], ref_scores=None, ref_labels=None )

HuangZhe885 avatar Jul 23 '22 05:07 HuangZhe885

@HuangZhe885 You should understand these code more. What I suggested before is not using gt_boxes directly from data_dict, data_dict of course doesn't contain gt_boxes, pred_dict neither. Notice that four parameters input to function V.draw_scene, what you should do is replacing pred_boxes with gt_boxes and gt_boxes need your manual import ! You can refer to similar codes: https://github.com/open-mmlab/OpenPCDet/blob/c233477a4a4bf2861a978794d6b9c047f64641f7/pcdet/datasets/kitti/kitti_dataset.py#L245 Relative codes showed the generation of gt_boxes. Lastly, make sure that your gt_boxes has the same format as the pred_dicts and input them into V.draw.

OrangeSodahub avatar Jul 23 '22 05:07 OrangeSodahub

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Aug 23 '22 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 07 '22 02:09 github-actions[bot]