From 1cded8c053f9f1bb202881b95d714faaa68b6399 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20B=C3=A9dard-Couture?= <remi.bc@outlook.com>
Date: Mon, 8 Apr 2024 21:21:08 -0400
Subject: [PATCH] Fix openvino model generation in Frigate install script
 (#2762)

* get pip from APT

* Add openvino model conversion to make it readily available
---
 install/frigate-install.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/install/frigate-install.sh b/install/frigate-install.sh
index 84b5dcc08..638309104 100644
--- a/install/frigate-install.sh
+++ b/install/frigate-install.sh
@@ -18,9 +18,7 @@ $STD apt-get install -y {curl,sudo,mc,git,gpg,automake,build-essential,xz-utils,
 msg_ok "Installed Dependencies"
 
 msg_info "Installing Python3 Dependencies"
-$STD apt-get install -y {python3,python3-dev,python3-setuptools,python3-distutils}
-wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py
-$STD python3 get-pip.py --quiet "pip"
+$STD apt-get install -y {python3,python3-dev,python3-setuptools,python3-distutils,python3-pip}
 msg_ok "Installed Python3 Dependencies"
 
 msg_info "Installing Node.js"
@@ -104,7 +102,8 @@ msg_info "Installing Object Detection Models (Resilience)"
 $STD pip install -r /opt/frigate/docker/main/requirements-ov.txt
 cd /opt/frigate/models
 export ENABLE_ANALYTICS=NO
-$STD /usr/local/bin/omz_downloader --name ssdlite_mobilenet_v2
+$STD /usr/local/bin/omz_downloader --name ssdlite_mobilenet_v2 --num_attempts 2
+$STD /usr/local/bin/omz_converter --name ssdlite_mobilenet_v2 --precision FP16 --mo /usr/local/bin/mo
 cd ..
 export CCACHE_DIR=/root/.ccache
 export CCACHE_MAXSIZE=2G