This repository provides a simple baseline Semantic Segmentation demo used in the UniPR ADAS course. It demonstrates how to train and test semantic segmentation models using the CityScapes dataset.
- Clone the repository into your projects directory:
git clone https://github.com/MarcelloCeresini/DemoSemanticSegmentationADAS.git
cd DemoSemanticSegmentationADAS- Create a
datadirectory inside the project folder:
mkdir data- Set up a Python virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtIf you want GPU acceleration, install PyTorch with CUDA support following the instructions here.
This project uses the CityScapes dataset.
-
Create an account with your university email.
-
Download the following splits:
gtFine_trainvaltestleftImg8bit_trainvaltest
After downloading and extracting the dataset, organize your files as follows:
DemoSemanticSegmentationADAS/
├── main.py
├── requirements.txt
└── data/
├── gtFine_trainvaltest/
│ └── gtFine/
│ ├── train/
│ ├── val/
│ └── test/
└── leftImg8bit_trainvaltest/
└── leftImg8bit/
├── train/
├── val/
└── test/
Launch the demo using:
python main.pyYou can modify parameters directly in main.py to experiment with different settings:
- Batch size
- Model architecture
- Number of epochs
- Learning rate
This allows you to observe how changes affect training and evaluation results.
Remember: Always activate the virtual environment before running the demo to ensure correct dependencies are used.