Skip to content

Commit

Permalink
update script to get pre-trained models
Browse files Browse the repository at this point in the history
  • Loading branch information
sthanhng committed Jan 11, 2019
1 parent cfa3d9a commit 33db47b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
5 changes: 0 additions & 5 deletions model-weights/get_YOLO_Face_h5.sh

This file was deleted.

32 changes: 24 additions & 8 deletions model-weights/get_models.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
#!/usr/bin/env bash

wget https://pjreddie.com/media/files/yolov3.weights
wget https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg?raw=true -O ./yolov3.cfg
wget https://github.com/pjreddie/darknet/blob/master/data/coco.names?raw=true -O ./coco.names

# for face detection using the YOLOv3 algorithm, you navigate to the below link:
# https://drive.google.com/file/d/1xYasjU52whXMLT5MtF7RCPQkV66993oR/view?usp=sharing
# to download the weights of the trained model
# put then it into the model-weights/ folder
W_FILENAME=yolov3-wider_16000.weights.zip
H5_FILENAME=YOLO_Face.h5.zip

if [ ! -d "./model-weights" ]; then
mkdir -p ./model-weights;
fi

cd model-weights

# Download yoloface models
echo "*** Downloading the trained models..."

wget --load-cookies /tmp/cookies.txt -r "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=13gFDLFhhBqwMw6gf8jVUvNDH2UrgCCrX' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=13gFDLFhhBqwMw6gf8jVUvNDH2UrgCCrX" -O $W_FILENAME && rm -rf /tmp/cookies.txt

wget --load-cookies /tmp/cookies.txt -r "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1a_pbXPYNj7_Gi6OxUqNo_T23Dt_9CzOV' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1a_pbXPYNj7_Gi6OxUqNo_T23Dt_9CzOV" -O $H5_FILENAME && rm -rf /tmp/cookies.txt

# Unzip
unzip -q $W_FILENAME
unzip -q $H5_FILENAME

# Delete .zip files
rm -rf $W_FILENAME $H5_FILENAME

echo "*** All done!!!"

0 comments on commit 33db47b

Please sign in to comment.