feature_extractor package

Submodules

feature_extractor.CarLidarFeatureExtractor module

class feature_extractor.CarLidarFeatureExtractor.CarLidarFeatureExtractor(carlidar_nbeams: int = 20, extract_carlidar_rangerate: bool = True, carlidar_max_range: float = 50.0)[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, veh_idx: int, models: {}, pastframe: int = 0)[source]
class feature_extractor.CarLidarFeatureExtractor.LidarSensor(nbeams: int, max_range: float = 100.0, angle_offset: float = 0.0, angle_spread: float = 6.283185307179586)[source]

Bases: object

property nbeams
feature_extractor.CarLidarFeatureExtractor.observe(lidar: feature_extractor.CarLidarFeatureExtractor.LidarSensor, scene: src.Record.frame.Frame, roadway: src.Roadway.roadway.Roadway, vehicle_index: int)[source]

feature_extractor.CoreFeatureExtractor module

class feature_extractor.CoreFeatureExtractor.CoreFeatureExtractor[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, veh_idx: int, models: {}, pastframe: int = 0)[source]

feature_extractor.FeatureState module

class feature_extractor.FeatureState.FeatureValue(v: float, i: int = 0)[source]

Bases: object

feature_extractor.FeatureState.inverse_ttc_to_ttc(inv_ttc: feature_extractor.FeatureState.FeatureValue, censor_hi: float = 30.0)[source]

feature_extractor.ForeForeFeatureExtractor module

class feature_extractor.ForeForeFeatureExtractor.ForeForeFeatureExtractor(deltas_censor_hi: float = 100.0)[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, veh_idx: int, models: {}, pastframe: int = 0)[source]

feature_extractor.Get module

feature_extractor.Get.get_AngularRateF(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_AngularRateG(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_Inv_TTC(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0, neighborfore: feature_extractor.neighbor_feature.NeighborLongitudinalResult = None, censor_hi: float = 10.0)[source]
feature_extractor.Get.get_Is_Colliding(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0, mem: feature_extractor.collision_detection.CPAMemory = <feature_extractor.collision_detection.CPAMemory object>)[source]
feature_extractor.Get.get_LaneCurvature(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]

Lane Curvature extractor

feature_extractor.Get.get_PosFyaw(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_RoadEdgeDist_Left(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_RoadEdgeDist_Right(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_Speed(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]

get the speed

feature_extractor.Get.get_TimeGap(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0, neighborfore: feature_extractor.neighbor_feature.NeighborLongitudinalResult = None, censor_hi: float = 10.0)[source]
feature_extractor.Get.get_TurnRateF(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.Get.get_TurnRateG(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0, frames_back: int = 1)[source]
feature_extractor.Get.get_VelFs(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]

Velocity along the lane

feature_extractor.Get.get_VelFt(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]

Velocity perpendicular to the lane

feature_extractor.TemporalFeatureExtractor module

class feature_extractor.TemporalFeatureExtractor.TemporalFeatureExtractor[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, veh_idx: int, models: {}, pastframe: int = 0)[source]

feature_extractor.WellBehavedFeatureExtractor module

class feature_extractor.WellBehavedFeatureExtractor.WellBehavedFeatureExtractor[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, veh_idx: int, models: {}, pastframe: int = 0)[source]

feature_extractor.collision_detection module

class feature_extractor.collision_detection.CPAMemory(vehA: feature_extractor.collision_detection.ConvexPolygon = <feature_extractor.collision_detection.ConvexPolygon object>, vehB: feature_extractor.collision_detection.ConvexPolygon = <feature_extractor.collision_detection.ConvexPolygon object>, mink: feature_extractor.collision_detection.ConvexPolygon = <feature_extractor.collision_detection.ConvexPolygon object>)[source]

Bases: object

class feature_extractor.collision_detection.CollisionCheckResult(is_colliding: bool, A: int, B: int)[source]

Bases: object

class feature_extractor.collision_detection.ConvexPolygon(npts)[source]

Bases: object

set(poly)[source]
feature_extractor.collision_detection.cyclic_shift_left(arr: list, d: int, n: int)[source]
feature_extractor.collision_detection.empty(poly: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.ensure_pts_sorted_by_min_polar_angle(poly: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.get_collision_time(ray: src.Vec.VecSE2.VecSE2, poly: feature_extractor.collision_detection.ConvexPolygon, ray_speed: float)[source]
feature_extractor.collision_detection.get_edge(pts: list, i: int, npts: int)[source]
feature_extractor.collision_detection.get_first_collision(scene: src.Record.frame.Frame, target_index: int, mem: feature_extractor.collision_detection.CPAMemory = <feature_extractor.collision_detection.CPAMemory object>)[source]
feature_extractor.collision_detection.get_poly_edge(poly: feature_extractor.collision_detection.ConvexPolygon, i: int)[source]
feature_extractor.collision_detection.get_signed_area(pts: [])[source]
feature_extractor.collision_detection.in_poly(v: src.Vec.VecE2.VecE2, poly: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.is_colliding_1(mem: feature_extractor.collision_detection.CPAMemory)[source]
feature_extractor.collision_detection.is_colliding_2(P: feature_extractor.collision_detection.ConvexPolygon, Q: feature_extractor.collision_detection.ConvexPolygon, temp: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.is_potentially_colliding(A: src.Basic.Vehicle.Vehicle, B: src.Basic.Vehicle.Vehicle)[source]
feature_extractor.collision_detection.isempty(poly: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.minkowksi_sum(retval: feature_extractor.collision_detection.ConvexPolygon, P: feature_extractor.collision_detection.ConvexPolygon, Q: feature_extractor.collision_detection.ConvexPolygon)[source]

For two convex polygons P and Q in the plane with m and n vertices, their Minkowski sum is a convex polygon with at most m + n vertices and may be computed in time O (m + n) by a very simple procedure, which may be informally described as follows. Assume that the edges of a polygon are given and the direction, say, counterclockwise, along the polygon boundary. Then it is easily seen that these edges of the convex polygon are ordered by polar angle. Let us merge the ordered sequences of the directed edges from P and Q into a single ordered sequence S. Imagine that these edges are solid arrows which can be moved freely while keeping them parallel to their original direction. Assemble these arrows in the order of the sequence S by attaching the tail of the next arrow to the head of the previous arrow. It turns out that the resulting polygonal chain will in fact be a convex polygon which is the Minkowski sum of P and Q.

feature_extractor.collision_detection.minkowski_difference(retval: feature_extractor.collision_detection.ConvexPolygon, P: feature_extractor.collision_detection.ConvexPolygon, Q: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.mirror(poly: feature_extractor.collision_detection.ConvexPolygon)[source]
feature_extractor.collision_detection.push(poly: feature_extractor.collision_detection.ConvexPolygon, v: src.Vec.VecE2.VecE2)[source]
feature_extractor.collision_detection.to_oriented_bounding_box_1(retval: feature_extractor.collision_detection.ConvexPolygon, center: src.Vec.VecSE2.VecSE2, len: float, wid: float)[source]
feature_extractor.collision_detection.to_oriented_bounding_box_2(retval: feature_extractor.collision_detection.ConvexPolygon, veh: src.Basic.Vehicle.Vehicle)[source]

feature_extractor.feature_extractor module

class feature_extractor.feature_extractor.MultiFeatureExtractor(extractors: [])[source]

Bases: object

feature_info()[source]
feature_names()[source]
pull_features(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, models: {} = {}, pastframe: int = 0)[source]
feature_extractor.feature_extractor.set_dual_feature(features: list, i: int, f: feature_extractor.FeatureState.FeatureValue, censor: float = 0.0)[source]
feature_extractor.feature_extractor.set_feature(features: list, i: int, v: float)[source]
feature_extractor.feature_extractor.set_feature_missing(features: list, i: int, censor: float = 0.0)[source]

feature_extractor.interface module

feature_extractor.interface.convert_2_float(fv: feature_extractor.FeatureState.FeatureValue)[source]
feature_extractor.interface.get_Acc(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.interface.get_AccFs(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]
feature_extractor.interface.get_Jerk(rec: src.Record.record.SceneRecord, roadway: src.Roadway.roadway.Roadway, vehicle_index: int, pastframe: int = 0)[source]

feature_extractor.neighbor_feature module

class feature_extractor.neighbor_feature.NeighborLongitudinalResult(ind: int, delta_s: float)[source]

Bases: object

feature_extractor.neighbor_feature.get_neighbor_fore_along_lane_1(scene: src.Record.frame.Frame, roadway: src.Roadway.roadway.Roadway, tag_start: src.Roadway.roadway.LaneTag, s_base: float, targetpoint_primary: str, targetpoint_valid: str, max_distance_fore: float = 250.0, index_to_ignore: int = -1)[source]
feature_extractor.neighbor_feature.get_neighbor_fore_along_lane_2(scene: src.Record.frame.Frame, vehicle_index: int, roadway: src.Roadway.roadway.Roadway, targetpoint_ego: str, targetpoint_primary: str, targetpoint_valid: str, max_distance_fore: float = 250.0)[source]
feature_extractor.neighbor_feature.get_neighbor_fore_along_lane_3(scene: src.Record.frame.Frame, vehicle_index: int, roadway: src.Roadway.roadway.Roadway, max_distance_fore: float = 250.0)[source]

feature_extractor.utils module

feature_extractor.utils.build_feature_extractor(params={})[source]

Module contents