Skip to content

Instantly share code, notes, and snippets.

@sharma0611
Last active February 3, 2022 11:32
Show Gist options
  • Save sharma0611/c81de40f1edf15c38c23ae4e327a9b05 to your computer and use it in GitHub Desktop.
Save sharma0611/c81de40f1edf15c38c23ae4e327a9b05 to your computer and use it in GitHub Desktop.
ImageNet Preparation
#!/bin/bash
mkdir train && mv ILSVRC2012_img_train.tar train/ && cd train
tar -xvf ILSVRC2012_img_train.tar && rm -f ILSVRC2012_img_train.tar
find . -name "*.tar" | while read NAME ; do mkdir -p "${NAME%.tar}"; tar -xvf "${NAME}" -C "${NAME%.tar}"; rm -f "${NAME}"; done
cd ..
# Extract the validation data and move images to subfolders:
mkdir val && mv ILSVRC2012_img_val.tar val/ && cd val && tar -xvf ILSVRC2012_img_val.tar
wget -qO- <https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh> | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment