Skip to content

ITSC'24: SynTraC: A Synthetic Dataset for Traffic Signal Control from Traffic Monitoring Cameras

Notifications You must be signed in to change notification settings

DaRL-LibSignal/SynTraC

Repository files navigation

SynTraC: A Synthetic Dataset for Traffic Signal Control from Traffic Monitoring Cameras

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.

Dataset on Hugging Face

The SynTraC dataset is now available on Hugging Face. You can download it using the following link:

SynTraC Dataset on Hugging Face

Docker Support

Command to Pull the Image:

docker pull prithvi180900/my_carla_app

Run the Docker Image

sudo docker run --privileged --gpus all --net=host prithvi180900/my_carla_app

Installation

Installation resources

We would like to work in the docker environment which is smoothy to configure environment and reproduce problems The whole process is here

Following this project

There some changes and bugs occurred while following the instruction.

  1. This is a useful reference to work with GUI
  2. Enable nvida tool-kit
  3. If this happened error: XDG_RUNTIME_DIR not set in the environment., look at this reference
xhost +  #disable access control

could directly solve it.

To run

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 

To config

docker exec -it -u root <container name> bash

Setup and Evaluation Instructions

Setup

Follow these steps to clone the repository and set up your environment.

Clone the repository

git clone https://github.com/prithvi1809/Syntrac.git
cd Syntrac

Install the dependencies

pip install -r requirements.txt

Run the Evaluation Script

To evaluate the reinforcement learning model, run the evaluate_rl_model.py script. You need to specify the policy path as an argument.

Example Command:

python evaluate_rl_model.py --policy_path cnt_dqn.pt

Arguments:

  • --policy_path: The name of the policy file located in the policy_candidates directory (e.g., cnt_cql.pt).

Dataset Creation Script

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.

Example Command:

python dataset_creation.py --total_vehicles 100 --spawn_interval 5 --store_interval 1

Arguments:

  • --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)

Training a Reinforcement Learning Model on a Dataset

  1. Navigate to the Train_RL_Model folder.
  2. Open the offline_rl.ipynb notebook.
  3. Set the path to your dataset in the notebook.

Fine-Tuning the object detection model

To download fine-tuned object detection model - download here

For fine tuning the pretrained object detection model on your own dataset

  1. Go to the Fine_Tuning_detection_Model directory.
  2. Update the paths and other parameters in config.py according to your datasets and requirements.
  3. Run the following command in your terminal:
    python train.py

For more detailed guidance, refer to this link: Training PyTorch RetinaNet on Custom Dataset



Citation

@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}
}

About

ITSC'24: SynTraC: A Synthetic Dataset for Traffic Signal Control from Traffic Monitoring Cameras

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages