An easy solution would be to just copy one folder into the root directory, but that would probably include some data moving, which you might want to avoid.
I would suggest to pass the image paths of the single class you want and to just sample from them:
def __init__(...):
    self.image_paths = image_paths  # Should contain a list of image paths of your desired class: e.g. ['./data/class0/img0.png', './data/class0/img1.png', ...]
    ...

def __getitem__(self, index):
    img = cv2.imread(self.image_paths[index])
    ...
    return img_as_tensor, torch.tensor([0])