Skip to content

Commit

Permalink
refine docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mxh1999 committed Apr 22, 2024
1 parent 46a587e commit a97a5ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions embodiedscan/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,17 @@ def nms_filter(pred_results, iou_thr=0.15, score_thr=0.075, topk_per_class=10):
Args:
pred_results (:obj:`InstanceData`):
Results predicted by the model
Results predicted by the model.
iou_thr (float): IoU thresholds for NMS. Defaults to 0.15.
score_thr (float): Score thresholds.
Instances with scores below thresholds will not be kept.
Defaults to 0.075.
topk_per_class (int): Number of instances kept per category.
Defaults to 10.
Returns:
boxes (numpy.ndarray[float]): filtered instances, shape (N,9)
labels (numpy.ndarray[int]): filtered labels, shape (N,)
numpy.ndarray[float], np.ndarray[int]:
Filtered boxes with shape (N, 9) and labels with shape (N,).
"""
boxes = pred_results.bboxes_3d
boxes_tensor = boxes.tensor.cpu().numpy()
Expand Down
15 changes: 9 additions & 6 deletions embodiedscan/visualizer/base_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EmbodiedScanBaseVisualizer(Visualizer):
boxes.
Args:
name (str): Name of the visualizer. Default to 'visualizer'.
name (str): Name of the visualizer. Defaults to 'visualizer'.
save_dir (str, optional): Directory to save visualizations.
Defaults to None.
vis_backends (list[ConfigType], optional):
Expand Down Expand Up @@ -72,17 +72,20 @@ def get_ply(root_dir, scene_name):
def visualize_scene(self,
data_samples,
class_filter=None,
nms_args=dict()):
nms_args=dict(iou_thr=0.15,
score_thr=0.075,
topk_per_class=10)):
"""Visualize the 3D scene with 3D boxes.
Args:
data_samples (list[Det3DDataSample]): The output of the model.
data_samples (list[:obj:`Det3DDataSample`]):
The output of the model.
class_filter (int, optional): Class filter for visualization.
Default to None to show all classes.
nms_args (dict): NMS arguments for filtering boxes.
Default to dict(iou_thr = 0.15,
score_thr = 0.075,
topk_per_class = 10)
Defaults to dict(iou_thr = 0.15,
score_thr = 0.075,
topk_per_class = 10)
"""
assert len(data_samples) == 1
data_sample = data_samples[0]
Expand Down

0 comments on commit a97a5ef

Please sign in to comment.