OpenPCDet
OpenPCDet copied to clipboard
How to see both the prediction boxes and GT boxes in demo.py?
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!
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.
In
Demo.pyhere input thepred_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.pydoes 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 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.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.