This project implements rail-track detection using fast semantic segmentation for high-resolution images from bisenetv2 algorithm.
The author of bisenetv2 has not made the official implementation public so the implementation in this project might yeild different performance with the network introduced in the original paper.
This project trains bisenetv2 on a modified version of RailSem19 dataset with only three labels ("rail-raised", "rail-track", "background"). Please follow here if you want to download the original dataset.
- Implement bisenetv2 and train on modified railsem19 dataset
- Refine the semantic mask using connected components algorithm
- Cluster the mask to obtain seperate railtrack
- create rail_marking conda environment
conda env create --file environment.yml
- activate conda environment
conda activate rail_marking
Download trained weights from HERE.
- Test single image
python ./scripts/segmentation/test_one_image.py -snapshot [path/to/trained/weight] -image_path [path/to/image/path]
Sample segmentation result:
- Test video
Download sample video from HERE.
The video was originally downloaded from this youtube channel.
python ./scripts/segmentation/test_video.py -snapshot [path/to/trained/weight] -video_path [path/to/video/path]
The test result can be seen as the gif image above. The frame rate could reach 40fps, faster than needed for an autonomous system.