cosense3d.agents.utils package

Submodules

cosense3d.agents.utils.deco module

cosense3d.agents.utils.deco.save_ckpt_on_error(func)[source]

cosense3d.agents.utils.transform module

class cosense3d.agents.utils.transform.DataOnlineProcessor[source]

Bases: object

static adaptive_free_space_augmentation(data: dict, min_h: float = -1.5, steps: int = 20, alpha: float = 0.05, res: float = 0.5, time_idx: int = None)[source]

Add free space points according to the distance of points to the origin.

lidar origin ->  *
              *  *
           *     * h
        *  ele   *
      ************
             d

Assume the \(\theta = \frac{\\pi}{2} - \text{ele}\) (elevation angle), \(\alpha\) = average angle between two lidar rings, \(d_k\) is the ground distance of the \(n_{th}\) lidar ring to lidar origin, \(k=1,...,n\), \(\delta_d\) is the distance between two neighboring lidar rings, then

\[\begin{split}d &= h \tan(\theta) \\ \delta_d &= d_n - d_{n-1} = d_n - h\tan(\arctan(\frac{h}{d_n}) - \alpha)\end{split}\]

we sample free space points in the ground distance of \(\delta_d\) relative to each ring with the given ‘step’ distance.

Parameters:
  • data – input data dict containing ‘points’.

  • min_h – minimum sample height relative to lidar origin. Default is -1.5.

  • steps – number of points to be sampled for each lidar ray. Default is 20.

  • alpha – average angle offset between two neighboring lidar casting rays. Default is 0.05.

  • res – resolution for down-sampling the free space points. Default is 0.5.

  • time_idx – if provided, time will be copied from the original points to free space points.

Returns:

updated data.

static apply_transform(data, transform, apply_to=['points'])[source]
static cav_aug_transform(data, transform, aug_params, apply_to=['points', 'imgs', 'annos_global'])[source]
static filter_range(data, lidar_range, apply_to: list)[source]
static free_space_augmentation(data, d: float = 10.0, h: float = -1.5, step: float = 1.5, res=0.25)[source]
static generate_sparse_target_bev_points(data: dict, transform=None, sam_res=0.4, map_res=0.2, range=50, max_num_pts=3000, discrete=False)[source]
static generate_sparse_target_roadline_points(data: dict, transform=None, map_res=0.2, range=50, kernel=3, max_num_pts=3000)[source]
static update_transform_with_aug(transform, aug_params)[source]
cosense3d.agents.utils.transform.add_flip(tf, flip_idx, flip_axis='xy')[source]
cosense3d.agents.utils.transform.add_rotate(tf, rot)[source]
cosense3d.agents.utils.transform.add_scale(tf, scale_ratio)[source]
cosense3d.agents.utils.transform.apply_transform(data, transform, key)[source]
cosense3d.agents.utils.transform.filter_range(data, lidar_range, key)[source]
cosense3d.agents.utils.transform.filter_range_mask(points, lidar_range, eps=0.0001)[source]
cosense3d.agents.utils.transform.generate_bev_tgt_pts(points, data, transform=None, sam_res=0.4, map_res=0.2, range=50, max_num_pts=5000, discrete=False)[source]

Module contents