From 2d3ccd38209f62308623926009eb15a219b2b3d3 Mon Sep 17 00:00:00 2001 From: Joseph Paul Cohen Date: Sun, 1 Oct 2023 00:03:51 -0700 Subject: [PATCH] path chexpert path error --- torchxrayvision/datasets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchxrayvision/datasets.py b/torchxrayvision/datasets.py index 7340c02..31b3863 100644 --- a/torchxrayvision/datasets.py +++ b/torchxrayvision/datasets.py @@ -1094,7 +1094,8 @@ def __getitem__(self, idx): sample["lab"] = self.labels[idx] imgid = self.csv['Path'].iloc[idx] - imgid = imgid.replace("CheXpert-v1.0-small/", "") + #clean up path in csv so the user can specify the path + imgid = imgid.replace("CheXpert-v1.0-small/", "").replace("CheXpert-v1.0/", "") img_path = os.path.join(self.imgpath, imgid) img = imread(img_path)