akshayg08's picture
Upload folder using huggingface_hub
c332c1e verified
raw
history blame
385 Bytes
with open("./Kather_test.csv") as f:
data = f.readlines()
labels = []
full = []
img_base = "/Users/akshay/Downloads/CRC-VAL-HE-7K"
for line in data[1:]:
_, fn, lb, cp = line.strip().split(",")
labels.append(lb)
full.append((cp, " ".join(cp.split()[5:])[:-1]))
print(f"{img_base}/{lb}/{fn}/", lb)
labels = set(labels)
full = set(full)
print(labels)
print(full)