Fix download-nasnet.sh script

This commit is contained in:
Michael Mayer 2019-05-04 01:17:39 +02:00
parent 3389b5115e
commit 471d77ee47

View File

@ -12,24 +12,26 @@ MODEL_BACKUP="assets/backups/nasnet-$TODAY"
echo "Installing $MODEL_NAME for TensorFlow..."
# Check for update
if [[ -f ${MODEL_ZIP} ]] && [[ `sha1sum ${MODEL_ZIP}` == ${MODEL_HASH} ]]; then
echo "Already up to date."
exit
fi
# Create directories
mkdir -p /tmp/photoprism
mkdir -p assets/tensorflow
mkdir -p assets/backups
# Download model
echo "Downloading latest model from $MODEL_URL..."
wget ${MODEL_URL} -O ${MODEL_ZIP}
# Check for update
if [[ -f ${MODEL_ZIP} ]] && [[ `sha1sum ${MODEL_ZIP}` == ${MODEL_HASH} ]]; then
if [[ -f ${MODEL_VERSION} ]]; then
echo "Already up to date."
exit
fi
else
# Download model
echo "Downloading latest model from $MODEL_URL..."
wget ${MODEL_URL} -O ${MODEL_ZIP}
TMP_HASH=`sha1sum ${MODEL_ZIP}`
TMP_HASH=`sha1sum ${MODEL_ZIP}`
echo ${TMP_HASH}
echo ${TMP_HASH}
fi
# Create backup
if [[ -e ${MODEL_PATH} ]]; then