SynTraC is the first public dataset designed for image-based traffic signal control. It bridges the gap between simulated environments and real-world traffic challenges by offering high-resolution images from the CARLA simulator, complete with annotations of traffic signal states and vehicle features.
The SynTraC dataset is now available on Hugging Face. You can download it using the following link:
Command to Pull the Image:
docker pull prithvi180900/my_carla_appRun the Docker Image
sudo docker run --privileged --gpus all --net=host prithvi180900/my_carla_appWe would like to work in the docker environment which is smoothy to configure environment and reproduce problems The whole process is here
There some changes and bugs occurred while following the instruction.
- This is a useful reference to work with GUI
- Enable nvida tool-kit
- If this happened error: XDG_RUNTIME_DIR not set in the environment., look at this reference
xhost + #disable access control
could directly solve it.
sudo docker run -p 2000-2002:2000-2002 --cpuset-cpus="0-5" --runtime=nvidia --gpus 'all,"capabilities=graphics,utility,display,video,compute"' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -it carlasim/carla ./CarlaUE4.sh -opengl $1
docker exec -it -u root <container name> bash
Follow these steps to clone the repository and set up your environment.
git clone https://github.com/prithvi1809/Syntrac.git
cd Syntracpip install -r requirements.txtTo evaluate the reinforcement learning model, run the evaluate_rl_model.py script. You need to specify the policy path as an argument.
python evaluate_rl_model.py --policy_path cnt_dqn.pt--policy_path: The name of the policy file located in thepolicy_candidatesdirectory (e.g.,cnt_cql.pt).
To create a dataset for traffic simulation, you can run the dataset_creation.py script. This script allows you to customize the simulation parameters such as the total number of vehicles, the interval at which vehicles are spawned, and the interval at which simulation data is stored.
python dataset_creation.py --total_vehicles 100 --spawn_interval 5 --store_interval 1--total_vehicles: The total number of vehicles to spawn in the simulation. (Default: 100)--spawn_interval: The interval (in seconds) at which a new vehicle is spawned in the simulation. (Default: 5 seconds)--store_interval: The interval (in seconds) at which simulation data is captured and stored. (Default: 1 second)
- Navigate to the
Train_RL_Modelfolder. - Open the
offline_rl.ipynbnotebook. - Set the path to your dataset in the notebook.
To download fine-tuned object detection model - download here
For fine tuning the pretrained object detection model on your own dataset
- Go to the
Fine_Tuning_detection_Modeldirectory. - Update the paths and other parameters in
config.pyaccording to your datasets and requirements. - Run the following command in your terminal:
python train.py
For more detailed guidance, refer to this link: Training PyTorch RetinaNet on Custom Dataset
@article{chen2024syntrac,
title={SynTraC: A Synthetic Dataset for Traffic Signal Control from Traffic Monitoring Cameras},
author={Chen, Tiejin and Shirke, Prithvi and Chakravarthi, Bharatesh and Vaghela, Arpitsinh and Da, Longchao and Lu, Duo and Yang, Yezhou and Wei, Hua},
booktitle={2024 IEEE 27th International Conference on Intelligent Transportation Systems (ITSC)},
year={2024},
organization={IEEE}
}