This repository contains the code developed as visiting project at the Intelligent Vehicles Group of TU Delft.
- keras (backend tensorflow)
- nuscenes-devkit
- pillow
- pyquaternion
- matplotlib
- opencv
- h5py
Tested with Python 3.6.5, on MacOS 10.14.3 and Ubuntu 18.04.4 LTS.
Download the nuScenes dataset (v1.0) and place it in dataset/nuScenes/orig. Then, execute the script src/extract_nu.py to:
- extract and process the relevant ground truth data, which is placed in
dataset/nuScenes/data - generate the file
dataset/nuScenes/black_list.npyindicating the nuScenes scenes where: there are no visible vehicles, the ego-vehicle is stationary, the environment conditions are bad (night/rain).
The architecture of the model and the training parameters are passed to the program through a configuration file located in src/cnfg. The configuration is a python file containing a dict of the parameters.
The complete list of parameters accepted by the program is commented in src/load_cnfg.py, which is the script reading the configuration files.
Run the program by executing the main script src/exec_main.py . The script supports the following command line arguments:
main_exec.py [-h] -c <file> -g <num> [-f <frac>] [-l <model>] [-Ttrs]
-c <file>,--config <file>pass the configuration file (without path nor extension).-f <frac>,--fgpu <frac>set the fraction of GPU memory to allocate [default: 0.90].-g <num>,--gpu <num>set the number of GPUs to use (0 if CPU) or list of GPU indices.-h,--helpshow the help message with description of the arguments.-l <model>,--load <model>pass a HDF5 file to load as weights of the model.-r,--redirredirect stdout and stderr to log files.-s,--savearchive the used python scripts and configuration file.-t,--testtest the model.-T,--traintrain the model.
As example, the following command creates a new model using the parameters defined in the configuration file src/cnfg/net1.py. It trains the model using the first two GPUs on the machine, then it tests the results, saves all the files required to reproduce the experiment, and redirects all console messages to log files:
python src/main_exec.py -c net1 -g 0,1 -Ttssr
Another example, this command loads an already trained model and executes all the test routines on CPU:
python src/main_exec.py -l log/nicemodel.h5 -c nicemodel -g 0 -t