https://www.cnblogs.com/kongzhagen/p/6295925.html import os name = [] with open('/media/hdc/xing/DeepLabV2/dataset/cityspace/gtFine/gtFine_color.txt') as file: for line in file: name_dir = line.strip().split('./')[1].split('/')[0] if name_dir in name…