semantic-segmentation/datasets_pro_code/remove_tif.py
2025-05-26 09:33:01 +08:00

6 lines
348 B
Python

input_path = r"E:\datasets\WLKdata_1111\WLK_voc\ImageSets\Segmentation\val.txt"
output_path = r"E:\datasets\WLKdata_1111\WLK_voc\ImageSets\Segmentation\val_no.txt"
with open(input_path, "r", encoding="utf-8") as fin, open(output_path, "w", encoding="utf-8") as fout:
for line in fin:
fout.write(line.strip().replace(".tif", "") + "\n")