Skip to content

Commit

Permalink
download sample set
Browse files Browse the repository at this point in the history
  • Loading branch information
akar43 committed Nov 2, 2017
1 parent d7e3651 commit 0b2e291
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo_dlsm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"source": [
"# Get sample data\n",
"!sh download_sample.sh\n",
"SAMPLE_DIR = 'shapenet_sample'"
"SAMPLE_DIR = os.path.join('data', 'shapenet_sample')"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion demo_vlsm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"source": [
"# Get sample data\n",
"!sh download_sample.sh\n",
"SAMPLE_DIR = 'shapenet_sample'"
"SAMPLE_DIR = os.path.join('data', 'shapenet_sample')"
]
},
{
Expand Down
27 changes: 27 additions & 0 deletions download_sample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
cd data
URL=http://people.eecs.berkeley.edu/~akar/lsm/shapenet_sample.tar.gz
CHECKSUM=696f75abebf387af55e8e06661162926
FILE=shapenet_sample.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

cd ..
echo "Done. Please run this command again to verify that checksum = $CHECKSUM."

0 comments on commit 0b2e291

Please sign in to comment.