Currently you are just returning the length of the path, not the number of images.
image_paths should be a list of all paths to your images.
You can get all image paths using the file extension and a wildcard:
folder_data = glob.glob("D:\\Neda\\Pytorch\\U-net\\BMMCdata\\data\\*.jpg")
folder_mask = glob.glob("D:\\Neda\\Pytorch\\U-net\\BMMCdata\\masks\\*.jpg")

Change the extension to the right one for your files, e.g. .png, .tiff etc.
You could split these paths using a certain percentage:
len_data = len(folder_data)
train_size = 0.6
train_image_paths = folder_data[:int(len_data*train_size)]
test_image_paths = folder_data[int(len_data*train_size):]
train_mask_paths = folder_mask[:int(len_data*train_size)]
test_mask_paths = folder_mask[int(len_data*train_size):]

train_dataset = CustomDataset(train_image_paths, train_mask_paths)
test_dataset = CustomDataset(test_image_paths, test_mask_paths)

The mean and std values are usually calculated from all training images.
Also you should pass them as normalized values, since transforms.ToTensor() will normalize your data so that the values are in the range [0, 1].
A division of the mean and std by 255. should be sufficient.
In my example I’ve created a class function, which makes sure to apply the same random transformations on the data and target (e.g. RandomCrop). Since you are currently not using any random transformations, you could call your transformation on data and mask separately.
However, since you are dealing with a segmentation task, I doubt it’ll be a good idea to normalize your masks, since they should most likely contain the class indices.
def __getitem__(self, index):
    image = Image.open(self.image_paths[index])
    mask = Image.open(self.target_paths[index])
    x = self.transform(image)
    y = torch.from_numpy(np.array(mask)).long()
    return x, y

Let me know, if this would work for you!