Thanks, the correct length is now being displayed. I am trying to understand that since the call to custom class as below has the hardcoded folder path and csv file of master dataset (both test and train).
DFU_Dataset = DFU_Dataset(root_dir = '/Users/sidraaleem/Documents/code/DFU/Labelled_test_images',                           csv = '/Users/sidraaleem/Documents/code/DFU/Labelled_data_ground_truth.csv',                           transform = transform                           )
Then how the below code is correctly taking the train and test samplers and returning their correct len. Since in the custom class the csv and folder path f master dataset is being passed.
train_loader = DataLoader(dataset=DFU_Dataset, shuffle=False, sampler=train_sampler)
test_loader = DataLoader(dataset=DFU_Dataset, shuffle=False,  sampler=test_sampler)

Also, how can I check the data being loaded in train_loader and test_loader?  The way we can see with custom loader by using the index of the image we want to see as DFU_Dataset[0].