예제 #1
0
    def __init__(self,
                 figsize=(15, 15),
                 bbox_score_threshold=0.01,
                 sampler_num_samples=8,
                 draw_3d_boxes=True):
        """Initialize CameraVisualization.

    Args:
      figsize: (w, h) float tuple. This is the size of the rendered figure in
        inches. A dpi=100 is used in plot.Image; note that the axes and title
        will take up space in the final rendering. If None, this will default to
        (image_width / 100 * 1.5, image_height / 100 * 1.5).
      bbox_score_threshold: The threshold over which bboxes will be drawn on the
        image.
      sampler_num_samples: Number of batches to keep for visualizing.
      draw_3d_boxes: Whether to draw 2d or 3d bounding boxes.  3d bounding
        boxes depict the 8 corners of the bounding box, whereas the 2d
        bounding boxes depict the extrema x and y dimensions of the boxes
        on the image plane.
    """
        self._figsize = figsize
        self._bbox_score_threshold = bbox_score_threshold,
        self._sampler = py_utils.UniformSampler(
            num_samples=sampler_num_samples)
        self._draw_3d_boxes = draw_3d_boxes
        self._summary = None
예제 #2
0
    def __init__(self,
                 top_down_transform,
                 class_id_to_name=None,
                 image_height=1536,
                 image_width=1024,
                 figsize=None,
                 ground_removal_threshold=-1.35,
                 sampler_num_samples=8):
        """Initialize TopDownVisualizationMetric.

    Args:
      top_down_transform: transform_util.Transform object that specifies
        how to transform a coordinate in the world coordinate to the top
        down projection.  See documentation for
        transform_util.MakeCarToImageTransform for more details on
        configuration.
      class_id_to_name: Dictionary mapping from class id to name.
      image_height: int image height.
      image_width: int image width.
      figsize: (w, h) float tuple. This is the size of the rendered figure in
        inches. A dpi=100 is used in plot.Image; note that the axes and title
        will take up space in the final rendering. If None, this will default to
        (image_width / 100 * 1.5, image_height / 100 * 1.5).
      ground_removal_threshold: Floating point value used to color ground points
        differently.  Defaults to -1.35 which happens to work well for KITTI.
      sampler_num_samples: Number of batches to keep for visualizing.
    """
        self._class_id_to_name = class_id_to_name or {}
        self._image_width = image_width
        self._image_height = image_height

        figsize = figsize or (image_width / 100. * 1.5,
                              image_height / 100. * 1.5)
        self._figsize = figsize

        self._ground_removal_threshold = ground_removal_threshold
        self._sampler = py_utils.UniformSampler(
            num_samples=sampler_num_samples)
        self._top_down_transform = top_down_transform
        self._summary = None
예제 #3
0
파일: metrics.py 프로젝트: vcj-huy/lingvo
 def Summary(self, name):
     if self._summary is None:
         self._summary = self._CreateSummary(name)
         self._sampler = py_utils.UniformSampler(
             num_samples=self.params.num_samples)
     return self._summary
예제 #4
0
파일: metrics.py 프로젝트: vcj-huy/lingvo
 def __init__(self, params):
     super().__init__(params)
     p = self.params
     self._sampler = py_utils.UniformSampler(num_samples=p.num_samples)
     self._summary = None
예제 #5
0
 def __init__(self, sampler_num_samples=8):
     """Init."""
     self._sampler = py_utils.UniformSampler(
         num_samples=sampler_num_samples)
     self._summary = None