One simple idea would be to split the data beforehand and have train.csv and test.csv.
Then you can write:
train_dataset =  MothLandmarksDataset('train.csv', '.', transform=transform_train)
test_dataset =  MothLandmarksDataset('test.csv', '.', transform=transform_test)