API Reference
polyline
- accvlab.lane_helpers.polyline.interpolate(points, distances, *, relative=False)[source]
Interpolate batched polylines at requested distances.
- Parameters:
points (
Tensor) – CPU or CUDA tensor with shape(batch, num_points, num_dims).distances (
Tensor) – Tensor with shape(batch, num_distances)on the same device aspoints. Distances below zero are clamped to the first point of the polyline. Distances beyond the total polyline length are clamped to the last point. Whenrelative=True, this corresponds to clamping values below0and above1.relative (
bool, default:False) – IfTrue, interpretdistancesas fractions of each polyline’s total length. IfFalse, interpret them as absolute distances from the start of each polyline.
- Returns:
Tensor– Tensor with shape(batch, num_distances, num_dims)on the same device aspoints.
- accvlab.lane_helpers.polyline.interpolate_var_size_batch(points, distances, *, relative=False)[source]
Interpolate variable-length batched polylines at requested distances.
- Parameters:
points (
RaggedBatch) – RaggedBatch-like object with tensor data on CPU or CUDA and shape(batch, max_num_points, num_dims).distances (
RaggedBatch) – RaggedBatch-like object with shape(batch, max_num_distances)and tensor data on the same device aspoints. Distances below zero are clamped to the first point of the polyline. Distances beyond the total polyline length are clamped to the last point. Whenrelative=True, this corresponds to clamping values below0and above1.relative (
bool, default:False) – IfTrue, interpretdistancesas fractions of each polyline’s total length. IfFalse, interpret them as absolute distances from the start of each polyline.
- Returns:
RaggedBatch– RaggedBatch-like object with shape(batch, max_num_distances, num_dims)and tensor data on the same device aspoints.
- accvlab.lane_helpers.polyline.lengths(points)[source]
Compute the total length of each polyline in a fixed-size batch.
- accvlab.lane_helpers.polyline.lengths_var_size_batch(points)[source]
Compute the total length of each polyline in a variable-size batch.
- Parameters:
points (
RaggedBatch) – RaggedBatch-like object with tensor data on CPU or CUDA and shape(batch, max_num_points, num_dims).- Returns:
Tensor– Tensor with shape(batch,)on the same device aspoints.