plemeri / InSPyReNet

Official PyTorch implementation of Revisiting Image Pyramid Structure for High Resolution Salient Object Detection (ACCV 2022)
MIT License
321 stars 61 forks source link

Dataloader add jpeg support? #50

Open crapthings opened 6 days ago

crapthings commented 6 days ago

i get this error assert len(self.images) == len(self.gts)

It seems that if the folder contains both .jpg and .jpeg file types, it can lead to errors.

https://github.com/plemeri/InSPyReNet/blob/786341020846a220fb9e3f6fcda810b58d52b50a/data/dataloader.py#L38

images = [os.path.join(image_root, f) for f in os.listdir(image_root) if f.lower().endswith(('.jpg', '.png'))]
            images = sort(images)

            gts = [os.path.join(gt_root, f) for f in os.listdir(gt_root) if f.lower().endswith(('.jpg', '.png'))]
            gts = sort(gts)

https://github.com/plemeri/InSPyReNet/blob/786341020846a220fb9e3f6fcda810b58d52b50a/data/dataloader.py#L80C13-L80C125

self.images = [os.path.join(root, f) for f in os.listdir(root) if f.lower().endswith(('.jpg', '.png', '.jpeg'))]