From 4c23e93a95db0c6c6c5d4239070966e3bdc24fdc Mon Sep 17 00:00:00 2001 From: Gustavo Serra Scalet Date: Thu, 6 Aug 2015 14:20:55 -0300 Subject: Fix download model script to use zip archive Currently GitHub is not using tarballs as archive for downloading gists therefore the script was broken as actually a zip archive was being downloaded. --- scripts/download_model_from_gist.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/download_model_from_gist.sh b/scripts/download_model_from_gist.sh index a1dccf78..89527b75 100755 --- a/scripts/download_model_from_gist.sh +++ b/scripts/download_model_from_gist.sh @@ -18,7 +18,7 @@ fi echo "Downloading Caffe model info to $MODEL_DIR ..." mkdir -p $MODEL_DIR -wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.tar.gz -tar xzf $MODEL_DIR/gist.tar.gz --directory=$MODEL_DIR --strip-components=1 -rm $MODEL_DIR/gist.tar.gz +wget https://gist.github.com/$GIST/download -O $MODEL_DIR/gist.zip +unzip -j $MODEL_DIR/gist.zip -d $MODEL_DIR +rm $MODEL_DIR/gist.zip echo "Done" -- cgit v1.2.3 From fda9229a426d9c0e4496c700099a7126da72ba64 Mon Sep 17 00:00:00 2001 From: Gustavo Serra Scalet Date: Thu, 6 Aug 2015 14:37:20 -0300 Subject: Fix download model binary script to get correct lines on parsing table The base reference of "bottom" variable was relative to the "top+1" and not to the whole readlines output. It ended up without all the lines. That could work for some gists however for the model I was looking for (see below) the sha1 key was not being parsed, as it was missing the last line. tested with the following gist: longjon/1bf3aa1e0b8e788d7e1d --- scripts/download_model_binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download_model_binary.py b/scripts/download_model_binary.py index 48e9015f..03a50f67 100755 --- a/scripts/download_model_binary.py +++ b/scripts/download_model_binary.py @@ -32,7 +32,7 @@ def parse_readme_frontmatter(dirname): with open(readme_filename) as f: lines = [line.strip() for line in f.readlines()] top = lines.index('---') - bottom = lines[top + 1:].index('---') + bottom = lines.index('---', top + 1) frontmatter = yaml.load('\n'.join(lines[top + 1:bottom])) assert all(key in frontmatter for key in required_keys) return dirname, frontmatter -- cgit v1.2.3