Imported from https://github.com/kaichoulyc/course_segmentation