Check CPU AVX instruction support before installing OpenVino model (#2796)
This commit is contained in:
parent
9cfad87e3b
commit
049a8096d3
1 changed files with 33 additions and 20 deletions
|
@ -77,18 +77,6 @@ sed -i '/^s6-svc -O \.$/s/^/#/' /opt/frigate/docker/main/rootfs/etc/s6-overlay/s
|
||||||
cat <<EOF >/config/config.yml
|
cat <<EOF >/config/config.yml
|
||||||
mqtt:
|
mqtt:
|
||||||
enabled: false
|
enabled: false
|
||||||
detectors:
|
|
||||||
ov:
|
|
||||||
type: openvino
|
|
||||||
device: AUTO
|
|
||||||
model:
|
|
||||||
path: /openvino-model/FP16/ssdlite_mobilenet_v2.xml
|
|
||||||
model:
|
|
||||||
width: 300
|
|
||||||
height: 300
|
|
||||||
input_tensor: nhwc
|
|
||||||
input_pixel_format: bgr
|
|
||||||
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
|
|
||||||
cameras:
|
cameras:
|
||||||
test:
|
test:
|
||||||
ffmpeg:
|
ffmpeg:
|
||||||
|
@ -109,13 +97,38 @@ sed -i -e 's/^kvm:x:104:$/render:x:104:root,frigate/' -e 's/^render:x:105:root$/
|
||||||
echo "tmpfs /tmp/cache tmpfs defaults 0 0" >> /etc/fstab
|
echo "tmpfs /tmp/cache tmpfs defaults 0 0" >> /etc/fstab
|
||||||
msg_ok "Installed Frigate $RELEASE"
|
msg_ok "Installed Frigate $RELEASE"
|
||||||
|
|
||||||
msg_info "Installing Object Detection Models (Resilience)"
|
if grep -q -o -m1 'avx[^ ]*' /proc/cpuinfo; then
|
||||||
$STD pip install -r /opt/frigate/docker/main/requirements-ov.txt
|
echo -e "AVX support detected"
|
||||||
cd /opt/frigate/models
|
msg_info "Installing Openvino Object Detection Model (Resilience)"
|
||||||
export ENABLE_ANALYTICS=NO
|
$STD pip install -r /opt/frigate/docker/main/requirements-ov.txt
|
||||||
$STD /usr/local/bin/omz_downloader --name ssdlite_mobilenet_v2 --num_attempts 2
|
cd /opt/frigate/models
|
||||||
$STD /usr/local/bin/omz_converter --name ssdlite_mobilenet_v2 --precision FP16 --mo /usr/local/bin/mo
|
export ENABLE_ANALYTICS=NO
|
||||||
cd ..
|
$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
|
||||||
|
cat <<EOF >>/config/config.yml
|
||||||
|
detectors:
|
||||||
|
ov:
|
||||||
|
type: openvino
|
||||||
|
device: AUTO
|
||||||
|
model:
|
||||||
|
path: /openvino-model/FP16/ssdlite_mobilenet_v2.xml
|
||||||
|
model:
|
||||||
|
width: 300
|
||||||
|
height: 300
|
||||||
|
input_tensor: nhwc
|
||||||
|
input_pixel_format: bgr
|
||||||
|
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
|
||||||
|
EOF
|
||||||
|
msg_ok "Installed Openvino Object Detection Model (Resilience)"
|
||||||
|
else
|
||||||
|
cat <<EOF >>/config/config.yml
|
||||||
|
model:
|
||||||
|
path: /cpu_model.tflite
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
msg_info "Installing Coral Object Detection Model (Resilience)"
|
||||||
|
cd /opt/frigate
|
||||||
export CCACHE_DIR=/root/.ccache
|
export CCACHE_DIR=/root/.ccache
|
||||||
export CCACHE_MAXSIZE=2G
|
export CCACHE_MAXSIZE=2G
|
||||||
wget -q https://github.com/libusb/libusb/archive/v1.0.26.zip
|
wget -q https://github.com/libusb/libusb/archive/v1.0.26.zip
|
||||||
|
@ -142,7 +155,7 @@ wget -qO cpu_audio_model.tflite https://tfhub.dev/google/lite-model/yamnet/class
|
||||||
cp /opt/frigate/audio-labelmap.txt /audio-labelmap.txt
|
cp /opt/frigate/audio-labelmap.txt /audio-labelmap.txt
|
||||||
mkdir -p /media/frigate
|
mkdir -p /media/frigate
|
||||||
wget -qO /media/frigate/person-bicycle-car-detection.mp4 https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4
|
wget -qO /media/frigate/person-bicycle-car-detection.mp4 https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4
|
||||||
msg_ok "Installed Object Detection Models"
|
msg_ok "Installed Coral Object Detection Model"
|
||||||
|
|
||||||
msg_info "Building Nginx with Custom Modules"
|
msg_info "Building Nginx with Custom Modules"
|
||||||
$STD /opt/frigate/docker/main/build_nginx.sh
|
$STD /opt/frigate/docker/main/build_nginx.sh
|
||||||
|
|
Loading…
Reference in a new issue