mlmed/torchxrayvision

Test csv on CheX_Dataset

matteoguarrera opened this issue · 2 comments

patientid = self.csv.Path.str.split("train/", expand=True)[1]

It seems that CheX_Dataset was designed only for loading the train.csv
I've tried to use it also with valid.csv but I got an error, since it split the path using the constant string "train/".

The following lines should fix the problem!

    # patientid
    if 'train' in csvpath:
        patientid = self.csv.Path.str.split("train/", expand=True)[1]

    elif 'valid' in csvpath:
        patientid = self.csv.Path.str.split("valid/", expand=True)[1]
    else:
        raise NotImplemented

Thank you so much!

Thanks! Do you want to submit a full request so you show up on the repo history? Otherwise I can make the edit. Let me know!

I have submitted the request! I'm glad to help in this project