File size: 900 Bytes
844398f
 
db56db7
844398f
 
db56db7
844398f
 
 
 
db56db7
 
 
 
 
 
 
 
 
 
 
844398f
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os

label_path = "images"
label_files = set([os.path.splitext(file)[0] for file in os.listdir(label_path) if file.endswith(".png")])

data_path = "conditioning_images"
data_files = set([os.path.splitext(file)[0] for file in os.listdir(data_path) if file.endswith(".png")])
txt_files = set([os.path.splitext(file)[0] for file in os.listdir(data_path) if file.endswith(".txt")])


for x in label_files ^ data_files:
    if os.path.exists(f"conditioning_images/{x}.png"):
        os.remove(f"conditioning_images/{x}.png")
    if os.path.exists(f"conditioning_images/{x}.txt"):
        os.remove(f"conditioning_images/{x}.txt")
        
    if os.path.exists(f"images/{x}.png"):
        os.remove(f"images/{x}.png")
    if os.path.exists(f"images/{x}.txt"):
        os.remove(f"images/{x}.txt")

if label_files==data_files:
    print("data_files")
if label_files==txt_files:
    print("txt_files")