pyCarDisplay package¶
Subpackages¶
Submodules¶
pyCarDisplay.car module¶
All of the Car operations are controlled from this file.
-
class
pyCarDisplay.car.Car(car_images_path: str, imu_sensor_path='', lidar_sensor_path='', object_detection_model_path='', depth_detection_model_path='', depth_detection_model_type='large', optimize=True, dpi=100, alpha=0.6, img_resize_size=(300, 300), pixel_sizes=[1242, 375], norm_mean=[0.485, 0.456, 0.406], norm_std=[0.229, 0.224, 0.225], R_covariance=0.1, add_noise=True, IMU_name=None, gui_speed=1, theme='DarkGrey1', image_extension='png', random_state=42, verbose=False, device='cpu', track_n_frames=10, plot_column='af')[source]¶ Bases:
objectInitilize the Car class.
- car_images_pathstr
Path to the Kitti dataset image frames.
- imu_sensor_pathstr, optional
Path to the Kitti dataset IMU sensor data. The default is "". If not provided, simulation will not work on the IMU data.
- lidar_sensor_pathstr, optional
Path to the Kitti dataset Lidar sensor data. The default is "". If not provided, simulation will not work on the Lidar data.
- object_detection_model_pathstr, optional
Path to the trained PyTorch object detection model. The default is "". If not provided, object detection is not performed.
- depth_detection_model_pathstr, optional
Path to the trained PyTorch depth detection model. The default is "".
- depth_detection_model_typestr, optional
If 'large', model uses a larger trained model but it will be slower. The default is "large".
- optimizebool, optional
If True, images are pre-processed for better depth detection. The default is True.
- dpiint, optional
Dots per inch. The default is 100.
- alphadouble, optional
The alpha variable. The default is 0.6.
- img_resize_sizetuple, optional
Size of the image when performing object detection. The default is (300, 300).
- pixel_sizeslist, optional
The sizes of the pixels. The default is [1242, 375].
- norm_meanlist, optional
Object detection hyper-parameter. The default is [0.485, 0.456, 0.406].
- norm_stdlist, optional
Object detection hyper-parameter. The default is [0.229, 0.224, 0.225].
- R_covariancefloat, optional
Error covariance for IMU data. The default is 0.1.
- add_noisebool, optional
If True, random uniform noise added to the IMU data. The default is True.
- gui_speedint, optional
Time between each frame in GUI. The default is 1.
- themestr, optional
GUI color theme. The default is "DarkGrey1".
- image_extensionstr, optional
Kitti dataset image extension. The default is "png". Used when reading the images from the path.
- random_stateint, optional
random seed. The default is 42.
- verbosebool, optional
Flag to print information. The default is False.
- devicestr, optional
If 'gpu' passed, ML modules will use the GPU. The default is "cpu". CUDA device must be available.
- track_n_framesint, optional
How many frames to track in the Kalman plot. The default is 10.
- plot_columnstr, optional
Which IMU column to plot in the Kalman plot. The default is "af".
None.
pyCarDisplay.pyCarDisplay module¶
pyCarDisplay is a autonomous vehicle simulator. It is designed to simulate driving car based on the datasets provided in Kitti (http://www.cvlibs.net/datasets/kitti/). pyCarDisplay can show the image frames in a Kitti dataset on a GUI, perform object detection given a trained model, perform depth detection given a trained model, simulate IMU sensor given IMU data, and use Kalman filter.
pyCarDisplay class is used as an API wrapper to the rest of the modules, i.e. the simulation is invoked from this file.
-
class
pyCarDisplay.pyCarDisplay.CarDisplay(**parameters)[source]¶ Bases:
objectThe main API class of the pyCarDisplay.
Initilize the CarDisplay class. This class passes the below parameters to the Car class.
The initlization also sets up the environment variables.
- car_images_pathstr
Path to the Kitti dataset image frames.
- imu_sensor_pathstr, optional
Path to the Kitti dataset IMU sensor data. The default is "". If not provided, simulation will not work on the IMU data.
- lidar_sensor_pathstr, optional
Path to the Kitti dataset Lidar sensor data. The default is "". If not provided, simulation will not work on the Lidar data.
- object_detection_model_pathstr, optional
Path to the trained PyTorch object detection model. The default is "". If not provided, object detection is not performed.
- depth_detection_model_pathstr, optional
Path to the trained PyTorch depth detection model. The default is "".
- depth_detection_model_typestr, optional
If 'large', model uses a larger trained model but it will be slower. The default is "large".
- optimizebool, optional
If True, images are pre-processed for better depth detection. The default is True.
- dpiint, optional
Dots per inch. The default is 100.
- alphadouble, optional
The alpha variable. The default is 0.6.
- img_resize_sizetuple, optional
Size of the image when performing object detection. The default is (300, 300).
- pixel_sizeslist, optional
The sizes of the pixels. The default is [1242, 375].
- norm_meanlist, optional
Object detection hyper-parameter. The default is [0.485, 0.456, 0.406].
- norm_stdlist, optional
Object detection hyper-parameter. The default is [0.229, 0.224, 0.225].
- R_covariancefloat, optional
Error covariance for IMU data. The default is 0.1.
- add_noisebool, optional
If True, random uniform noise added to the IMU data. The default is True.
- gui_speedint, optional
Time between each frame in GUI. The default is 1.
- themestr, optional
GUI color theme. The default is "DarkGrey1".
- image_extensionstr, optional
Kitti dataset image extension. The default is "png". Used when reading the images from the path.
- random_stateint, optional
random seed. The default is 42.
- verbosebool, optional
Flag to print information. The default is False.
- devicestr, optional
If 'gpu' passed, ML modules will use the GPU. The default is "cpu". CUDA device must be available.
- track_n_framesint, optional
How many frames to track in the Kalman plot. The default is 10.
- plot_columnstr, optional
Which IMU column to plot in the Kalman plot. The default is "af".
None.
-
get_params()[source]¶ Can be used to get the object variables.
- self
The object variables in dict format.
pyCarDisplay.version module¶
pyCarDisplay version.