Explorar el Código

Merge pull request #482 from cshallue/unzip

Use tar on OSX to unzip the MSCOCO data file.
Chris Shallue hace 9 años
padre
commit
3bdc3253d4
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  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}