Skip to content

Commit

Permalink
added script to extract imagenet locally from tar files
Browse files Browse the repository at this point in the history
  • Loading branch information
brodyh committed Oct 8, 2014
1 parent 12ccfcc commit 1eb5b5a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions data/ilsvrc12/extract_locally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -x

if [ $(df -h /scr/ | tail -n1 | py -x 'x.split()[3][:-1]') -le 200 ]; then
echo "You need to free up some space first"
exit
fi

tar_dir=/scail/group/deeplearning/sail-deep-gpu/brodyh/data/ILSVRC_2012
extract_dir=/scr/brodyh/ilsvrc12

# extract training images
mkdir -p $extract_dir/train
tar -C $extract_dir/train/ -xvf $tar_dir/ILSVRC2012_img_train.tar

for tar_file in $(ls $extract_dir/train/*tar); do
tar_dir=${tar_file%.*}
mkdir -p $tar_dir
tar -C $tar_dir/ -xf $tar_file
rm $tar_file
done

# extract validation images
mkdir -p $extract_dir/val
tar -C $extract_dir/val/ -xvf $tar_dir/ILSVRC2012_img_val.tar

0 comments on commit 1eb5b5a

Please sign in to comment.