forked from akar43/lsm
-
Notifications
You must be signed in to change notification settings - Fork 10
/
prepare_data.sh
43 lines (38 loc) · 955 Bytes
/
prepare_data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
cd data
URL=http://people.eecs.berkeley.edu/~akar/lsm/shapenet_release.tar.gz
CHECKSUM=61feff8480368e00eb928d4b10a40a40
FILE=shapenet_release.tar.gz
if [ -f $FILE ]; then
echo "File already exists. Checking md5..."
os=`uname -s`
if [ "$os" = "Linux" ]; then
checksum=`md5sum $FILE | awk '{ print $1 }'`
elif [ "$os" = "Darwin" ]; then
checksum=`cat $FILE | md5`
fi
if [ "$checksum" = "$CHECKSUM" ]; then
echo "Checksum is correct. No need to download."
exit 0
else
echo "Checksum is incorrect. Need to download again."
fi
fi
wget $URL -O $FILE
tar xvzf $FILE
echo "Processing voxels"
cd voxels
for i in `ls *.tar.gz`
do
echo "Processing $i"
tar xvzf $i > /dev/null
done
echo "Processing renderings"
cd ../renders
for i in `ls *.tar.gz`
do
echo "Processing $i"
tar xvzf $i > /dev/null && rm $i
done
cd ../..
echo "Done. Please run this command again to verify that checksum = $CHECKSUM."