#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Copyright (C) Intel Corporation # # Download face detection and re-identification models from Open Model Zoo # for the facial-recognition use case. # Usage: ./export_and_quantize.sh set -euo pipefail # Official Open Model Zoo public model storage (versioned, immutable). OMZ_BASE="https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1" echo "--- Installing dependencies ---" pip install -qU openvino # Download both the IR topology (.xml) and weights (.bin) for an OMZ model # from the official storage into intel///. download_omz_model() { local model="$1" local precision="$2" local dest="intel/${model}/${precision}" mkdir -p "${dest}" local ext for ext in xml bin; do if [[ ! -f "${dest}/${model}.${ext}" ]]; then wget -q -O "${dest}/${model}.${ext}" \ "${OMZ_BASE}/${model}/${precision}/${model}.${ext}" fi done } # Ask for approval before downloading models and sample files echo "" echo "This script will download:" echo " - Model weights and/or sample files" echo "" read -p "Continue with downloads? (yes/no): " APPROVAL if [[ "${APPROVAL}" != "yes" ]]; then echo "Download cancelled by user." exit 0 fi echo "" echo "--- Downloading face-detection-adas-0001 (FP16) ---" download_omz_model face-detection-adas-0001 FP16 echo "Ready: face-detection-adas-0001" echo "--- Downloading face-reidentification-retail-0095 (FP16) ---" download_omz_model face-reidentification-retail-0095 FP16 echo "Ready: face-reidentification-retail-0095" echo "--- Downloading sample test video ---" if [[ ! -f test_video.mp4 ]]; then wget -q -O test_video.mp4 \ "https://github.com/intel-iot-devkit/sample-videos/raw/master/face-demographics-walking-and-pause.mp4" echo "Downloaded: test_video.mp4" else echo "Already present: test_video.mp4" fi echo "--- Done ---" echo "Detector : intel/face-detection-adas-0001/FP16/face-detection-adas-0001.xml" echo "ReID : intel/face-reidentification-retail-0095/FP16/face-reidentification-retail-0095.xml" echo "Video : test_video.mp4"