Setting up the test data environment for IMAGENET on Colab


I need to use a small subset of IMAGENET test data to conduct some experiments (usual classification task) for my project. I will be using Google COLAB environment.

I am struggling to setup the test data environment.

I wonder if anyone can help me to find scripts which I can run on a google colab notebook to download the IMAGENET test images, arrange all folder structure in an appropriate manner and use torchvision.datasets.ImageNet class with proper data loader functionality. Actually around 5-10K of test image is enough for my experiment.

I need to handle the data loading issue just like below. And I think, I need to download the test images and construct the necessary folder structure so that Pytorch torchvision.datasets.ImageNet class can work properly.

test_data = datasets.CIFAR10(root='/CIFARDATA', train=False, download=True, transform=transform)
test_loader = DataLoader(test_data, batch_size=batch_size, shuffle=True)

I would appreciate if you can help me with the scripts/steps necessary for this.

Best Regards…