瀏覽代碼

Merge pull request #482 from cshallue/unzip

Use tar on OSX to unzip the MSCOCO data file.
Chris Shallue 9 年之前
父節點
當前提交
3bdc3253d4
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      im2txt/im2txt/data/download_and_preprocess_mscoco.sh

+ 7 - 1
im2txt/im2txt/data/download_and_preprocess_mscoco.sh

@@ -29,6 +29,12 @@ if [ -z "$1" ]; then
   exit
 fi
 
+if [ "$(uname)" == "Darwin" ]; then
+  UNZIP="tar -xf"
+else
+  UNZIP="unzip -nq"
+fi
+
 # Create the output directories.
 OUTPUT_DIR="${1%/}"
 SCRATCH_DIR="${OUTPUT_DIR}/raw-data"
@@ -49,7 +55,7 @@ function download_and_unzip() {
     echo "Skipping download of ${FILENAME}"
   fi
   echo "Unzipping ${FILENAME}"
-  unzip -nq ${FILENAME}
+  ${UNZIP} ${FILENAME}
 }
 
 cd ${SCRATCH_DIR}