diff --git a/docker/main/install_deps.sh b/docker/main/install_deps.sh index 43fff479b..791124332 100755 --- a/docker/main/install_deps.sh +++ b/docker/main/install_deps.sh @@ -16,6 +16,14 @@ apt-get -qq install --no-install-recommends -y \ jq \ nethogs +# Use latest distro-provided numpy-related libraries, rather than building wheels from scatch +apt-get -qq install --no-install-recommends --no-install-suggests -y \ + python3-numpy python3-matplotlib python3-opencv python3-scipy -y + +# Again, avoid complicated wheel build for lxml and onif_zeep by using distro-provided libraries +apt-get -qq install --no-install-recommends --no-install-suggests -y \ + python3-lxml -y + # ensure python3 defaults to python3.9 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 @@ -78,7 +86,14 @@ apt-get autoremove --purge -y rm -rf /var/lib/apt/lists/* # Install yq, for frigate-prepare and go2rtc echo source +if [[ "${TARGETARCH}" == "arm" ]]; then +curl -fsSL \ + "https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_arm" \ + --output /usr/local/bin/yq +chmod +x /usr/local/bin/yq +else curl -fsSL \ "https://github.com/mikefarah/yq/releases/download/v4.33.3/yq_linux_$(dpkg --print-architecture)" \ --output /usr/local/bin/yq chmod +x /usr/local/bin/yq +fi \ No newline at end of file diff --git a/docker/main/install_s6_overlay.sh b/docker/main/install_s6_overlay.sh index 75acba774..1c2c368f1 100755 --- a/docker/main/install_s6_overlay.sh +++ b/docker/main/install_s6_overlay.sh @@ -6,6 +6,8 @@ s6_version="3.1.5.0" if [[ "${TARGETARCH}" == "amd64" ]]; then s6_arch="x86_64" +elif [[ "${TARGETARCH}" == "arm" ]]; then + s6_arch="armhf" elif [[ "${TARGETARCH}" == "arm64" ]]; then s6_arch="aarch64" fi diff --git a/docker/main/requirements-wheels.txt b/docker/main/requirements-wheels.txt index 6831fc972..703a624ef 100644 --- a/docker/main/requirements-wheels.txt +++ b/docker/main/requirements-wheels.txt @@ -2,11 +2,11 @@ click == 8.1.* Flask == 3.0.* imutils == 0.5.* markupsafe == 2.1.* -matplotlib == 3.8.* +# matplotlib == 3.8.* mypy == 1.6.1 -numpy == 1.26.* +# numpy == 1.26.* onvif_zeep == 0.2.12 -opencv-python-headless == 4.9.0.* +# opencv-python-headless == 4.9.0.* paho-mqtt == 2.0.* pandas == 2.2.* peewee == 3.17.* @@ -22,8 +22,8 @@ tzlocal == 5.2 types-PyYAML == 6.0.* requests == 2.31.* types-requests == 2.31.* -scipy == 1.13.* -norfair == 2.2.* +# scipy == 1.13.* +# norfair == 2.2.* setproctitle == 1.3.* ws4py == 0.5.* unidecode == 1.3.* diff --git a/docker/main/requirements.txt b/docker/main/requirements.txt index 90780e2b4..eb32f4213 100644 --- a/docker/main/requirements.txt +++ b/docker/main/requirements.txt @@ -1,2 +1,6 @@ +--only-binary :all: scikit-build == 0.17.* nvidia-pyindex +norfair == 2.1.1 +zeep == 3.0.0 +onvif_zeep \ No newline at end of file diff --git a/docker/rpi/Dockerfile b/docker/rpi/Dockerfile index 581ca7ff8..880736d6a 100644 --- a/docker/rpi/Dockerfile +++ b/docker/rpi/Dockerfile @@ -6,7 +6,7 @@ ARG DEBIAN_FRONTEND=noninteractive FROM deps AS rpi-deps ARG TARGETARCH -RUN rm -rf /usr/lib/btbn-ffmpeg/ +RUN if [[ "${TARGETARCH}" == "arm64" ]]; then rm -rf /usr/lib/btbn-ffmpeg/; fi # Install dependencies RUN --mount=type=bind,source=docker/rpi/install_deps.sh,target=/deps/install_deps.sh \ diff --git a/docker/rpi/install_deps.sh b/docker/rpi/install_deps.sh index 9716623ca..e6d85e032 100755 --- a/docker/rpi/install_deps.sh +++ b/docker/rpi/install_deps.sh @@ -27,4 +27,11 @@ if [[ "${TARGETARCH}" == "arm64" ]]; then echo "deb [signed-by=/usr/share/keyrings/raspbian.gpg] https://archive.raspberrypi.org/debian/ bullseye main" | tee /etc/apt/sources.list.d/raspi.list apt-get -qq update apt-get -qq install --no-install-recommends --no-install-suggests -y ffmpeg +# ffmpeg -> arm32 +elif [[ "${TARGETARCH}" == "arm" ]]; then + # add raspberry pi repo + gpg --no-default-keyring --keyring /usr/share/keyrings/raspbian.gpg --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E + echo "deb [signed-by=/usr/share/keyrings/raspbian.gpg] http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi" | tee /etc/apt/sources.list.d/raspi.list + apt-get -qq update + apt-get -qq install --no-install-recommends --no-install-suggests -y ffmpeg fi diff --git a/frigate/motion/improved_motion.py b/frigate/motion/improved_motion.py index 6fb17ec29..5ca3ea93c 100644 --- a/frigate/motion/improved_motion.py +++ b/frigate/motion/improved_motion.py @@ -19,7 +19,6 @@ class ImprovedMotionDetector(MotionDetector): config: MotionConfig, fps: int, name="improved", - blur_radius=1, interpolation=cv2.INTER_NEAREST, contrast_frame_history=50, ): @@ -42,7 +41,6 @@ class ImprovedMotionDetector(MotionDetector): self.mask = np.where(resized_mask == [0]) self.save_images = False self.calibrating = True - self.blur_radius = blur_radius self.interpolation = interpolation self.contrast_values = np.zeros((contrast_frame_history, 2), np.uint8) self.contrast_values[:, 1:2] = 255 @@ -104,7 +102,7 @@ class ImprovedMotionDetector(MotionDetector): # Setting masked pixels to zero, to match the average frame at startup resized_frame[self.mask] = [0] - resized_frame = gaussian_filter(resized_frame, sigma=1, radius=self.blur_radius) + resized_frame = gaussian_filter(resized_frame, sigma=1) if self.save_images: blurred_saved = resized_frame.copy()