Pedestrian Trajectory Generation and Visualization
This project trains a UNet1D model on the pedestrian dataset to generate new samples of pedestrian trajectories. The generated samples are saved to a CSV file, and the trajectories of the pedestrians from the generated dataset are visualized using Matplotlib.
- Python
- PyTorch
- Matplotlib
- Numpy
- Pandas
train.py: Contains the script for training the model on the pedestrian dataset.sampling.py: Contains the function to generate new samples using the trained model.utils.py: Contains utility functions for visualizing and saving the generated samples.models/unet.py: Contains the UNet1D model used for generating the samples.dataset/plot_dataset.py: Contains the script for plotting the trajectories of the pedestrians from the generated dataset.
- Train the model and save the weights to a
.pthfile, which is saved in theCheckpointsdirectory, and will be used for generating new samples. - Run
sampling.pyto generate new samples using the trained model. The generated samples are saved to a CSV file in the 'Generated_Positions_Data' directory. The generated samples are saved in the format 'generated_pedestrians_epoch_{}.csv', where {} is the epoch number. - Run
dataset/plot_dataset.pyto visualize the generated samples in the CSV file. The script will plot the trajectories of the pedestrians from the generated dataset, and save the plots to the 'Images' directory.
- The following images show the nomalized trajectories of the pedestrians from the generated dataset at different epochs.










