alan-turing-institute / affinity-vae

Self-supervised method for disentanglement, clustering and classification of objects in multidimensional image data
BSD 3-Clause "New" or "Revised" License
13 stars 7 forks source link

strip spaces from the name of classes in affinity.csv or classes.csv #156

Open marjanfamili opened 1 year ago

marjanfamili commented 1 year ago

I created a new dataset and started getting a lot of errors, number of data being zero, etc. Turns out I formed the classes.csv and affinity.csv as follows:

classes.csv item1, item2

affinity.csv item1, item2 1, -1 -1,1

because both have a space behind item2 it doesn't through the error but it also doesn't recognise the name in the list of data

jolaem commented 1 year ago

Related to #63

marjanfamili commented 1 year ago

with open(self.filename, 'r') as f: reader = csv.reader(f, delimiter=',', quoting=csv.QUOTE_NONE) return [[x.strip() for x in row] for row in reader]

marjanfamili commented 1 year ago

Save colours in a df for each class and call from data frame