This repository contains my master thesis work at the Sofia University's Faculty for Mathematics and Informatics.
In this project I implemented a CNN with an architecture inspired by ERFNet.
To train the network you will need to download the TuSimple dataset found here.
Training is initiated by running the ./src/train.py
file with the following args:
python train.py \
--model erfnet \
--resume-training \
--epochs 100 \
--ckpt-dir ./checkpoints \
--ckpt-save-interval 5 \
--cuda \
--height 720 \
--dataset-root /data/TUSimple \
--pretrained-encoder ./encoder_weights.pth
- Description: Model architecture to use for training
- Type:
str
- Choices: encoder, encoder-low-dilation, erfnet, erfnet-low-dilation
- Default:
None
- Usage:
--model [encoder|encoder-low-dilation|erfnet|erfnet-low-dilation]
- Description: Flag indicating if the training should resume from a saved checkpoint.
- Default:
False
- Usage:
--resume-training
- Description: Epochs to train for.
- Type:
int
- Default:
150
- Usage:
--epochs 150
- Description: Directory where to save the checkpoints.
- Type:
str
- Default:
None
- Usage:
--ckpt-dir ./checkpoints
- Description: Name of the latest checkpoint (the model will resume training from here).
- Type:
str
- Default:
latest.pth.tar
- Usage:
--ckpt-latest-name latest.pth.tar
- Description: Name of the checkpoint that has achieved best results.
- Type:
str
- Default:
best.pth.tar
- Usage:
--ckpt-best-name best.pth.tar
- Description: Template for naming interval checkpoints during training. The placeholder {} will be replaced with the epoch number.
- Type:
str
- Default:
checkpoint-{:04}.pth.tar
- Usage:
--ckpt-interval-name checkpoint-{:04}.pth.tar
- Description: Interval (in epochs) at which to save intermediate checkpoints.
- Type:
int
- Default:
10
- Usage:
--ckpt-save-interval 10
- Description: Interval (in steps) at which to log the loss during training.
- Type:
int
- Default:
50
- Usage:
--loss-log-step-interval 50
- Description: Enables training on GPU (CUDA). This flag is used to toggle between GPU and CPU.
- Default:
True
- Usage:
--cuda
- Description: Specifies the input height for the model.
- Type:
int
- Default:
512
- Usage:
--height 512
- Description: Path to the root directory of the dataset.
- Type:
str
- Default:
../archive/TUSimple
- Usage:
--dataset-root ../archive/TUSimple
- Description: Path to the pretrained encoder weights.
- Type:
str
- Default:
None
- Usage:
--pretrained-encoder ../checkpoints/encoder/latest.pth.tar