From 947c8dfa5dd64bd04f64c8129b38ed7b4e90fc70 Mon Sep 17 00:00:00 2001 From: xxxsen Date: Thu, 4 Jul 2024 21:47:37 +0800 Subject: [PATCH] chore: provide shell to download models --- .gitignore | 3 ++- download_models.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 download_models.sh diff --git a/.gitignore b/.gitignore index 9692a81..f96ec8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ test_data* __debug_bin* -.vscode \ No newline at end of file +.vscode +models/ \ No newline at end of file diff --git a/download_models.sh b/download_models.sh new file mode 100755 index 0000000..09bd83f --- /dev/null +++ b/download_models.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +SAVEDIR="./models" + +if [ "$#" != "0" ]; then + SAVEDIR="$1" +fi + +echo "downloading model files to dir:$SAVEDIR..." + +if [ -d "$SAVEDIR" ]; then + echo "DIR: $SAVEDIR exist, remove it first!" + exit 0 +fi + +mkdir "$SAVEDIR" -p +curl https://github.com/Kagami/go-face-testdata/raw/master/models/shape_predictor_5_face_landmarks.dat -L -o "$SAVEDIR/shape_predictor_5_face_landmarks.dat" +curl https://github.com/Kagami/go-face-testdata/raw/master/models/dlib_face_recognition_resnet_model_v1.dat -L -o "$SAVEDIR/dlib_face_recognition_resnet_model_v1.dat" +curl https://github.com/Kagami/go-face-testdata/raw/master/models/mmod_human_face_detector.dat -L -o "$SAVEDIR/mmod_human_face_detector.dat" + +echo "model file download succ"