This might help:
If you have images with label 0 and label 1 you can put them in folders like /train/0 and /train/1 for your trainsplit and /test/0 /test/1 for your testsplit.
Then you can define a dataloader like so:
import torchvision.transforms as transforms
import torchvision.datasets as dset

train_root = '/train'
train_set = dset.ImageFolder(root=train_root,
                                   transform=transforms.Compose([
                                       transforms.Resize(image_size),
                                       transforms.CenterCrop(image_size),
                                       transforms.ToTensor(),
                                       transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
                                       ]))
train_loader = torch.utils.data.DataLoader(train_set, batch_size=batch_size,
                                               shuffle=True, num_workers=workers)

Do the same for testset.
Since you have a binary classification you can use torch.nn.Sigmoid() together with torch.nn.BCELoss() or just torch.nn.BCEWithLogitsLoss() as loss function.
torch.nn.CrossEntropyLoss() should also work tho.