mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-25 17:48:38 +03:00
Compare commits
No commits in common. "edeab2f491ef7bab400a6ce75475440f3012492a" and "ec79c33b6ca6df29d8e4399228c5c4f8d32ee84d" have entirely different histories.
edeab2f491
...
ec79c33b6c
@ -239,12 +239,6 @@ class ImprovedMotionDetector(MotionDetector):
|
|||||||
)
|
)
|
||||||
self.mask = np.where(resized_mask == [0])
|
self.mask = np.where(resized_mask == [0])
|
||||||
|
|
||||||
# Reset motion detection state when mask changes
|
|
||||||
# so motion detection can quickly recalibrate with the new mask
|
|
||||||
self.avg_frame = np.zeros(self.motion_frame_size, np.float32)
|
|
||||||
self.calibrating = True
|
|
||||||
self.motion_frame_count = 0
|
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
"""stop the motion detector."""
|
"""stop the motion detector."""
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -771,7 +771,6 @@ def process_frames(
|
|||||||
camera_enabled = camera_config.enabled
|
camera_enabled = camera_config.enabled
|
||||||
|
|
||||||
if "motion" in updated_configs:
|
if "motion" in updated_configs:
|
||||||
motion_detector.config = camera_config.motion
|
|
||||||
motion_detector.update_mask()
|
motion_detector.update_mask()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import {
|
|||||||
toRGBColorString,
|
toRGBColorString,
|
||||||
} from "@/utils/canvasUtil";
|
} from "@/utils/canvasUtil";
|
||||||
import { Polygon, PolygonType } from "@/types/canvas";
|
import { Polygon, PolygonType } from "@/types/canvas";
|
||||||
import { useCallback, useMemo, useState } from "react";
|
import { useCallback, useContext, useMemo, useState } from "react";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { Toaster } from "@/components/ui/sonner";
|
import { Toaster } from "@/components/ui/sonner";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
@ -34,6 +34,7 @@ import useSWR from "swr";
|
|||||||
import { FrigateConfig } from "@/types/frigateConfig";
|
import { FrigateConfig } from "@/types/frigateConfig";
|
||||||
import { reviewQueries } from "@/utils/zoneEdutUtil";
|
import { reviewQueries } from "@/utils/zoneEdutUtil";
|
||||||
import IconWrapper from "../ui/icon-wrapper";
|
import IconWrapper from "../ui/icon-wrapper";
|
||||||
|
import { StatusBarMessagesContext } from "@/context/statusbar-provider";
|
||||||
import { buttonVariants } from "../ui/button";
|
import { buttonVariants } from "../ui/button";
|
||||||
import { Trans, useTranslation } from "react-i18next";
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@ -60,6 +61,7 @@ export default function PolygonItem({
|
|||||||
const { data: config, mutate: updateConfig } =
|
const { data: config, mutate: updateConfig } =
|
||||||
useSWR<FrigateConfig>("config");
|
useSWR<FrigateConfig>("config");
|
||||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||||
|
const { addMessage } = useContext(StatusBarMessagesContext)!;
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
const cameraConfig = useMemo(() => {
|
const cameraConfig = useMemo(() => {
|
||||||
@ -169,22 +171,10 @@ export default function PolygonItem({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateTopicType =
|
|
||||||
polygon.type === "zone"
|
|
||||||
? "zones"
|
|
||||||
: polygon.type === "motion_mask"
|
|
||||||
? "motion"
|
|
||||||
: polygon.type === "object_mask"
|
|
||||||
? "objects"
|
|
||||||
: polygon.type;
|
|
||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
await axios
|
await axios
|
||||||
.put(`config/set?${url}`, {
|
.put(`config/set?${url}`, { requires_restart: 0 })
|
||||||
requires_restart: 0,
|
|
||||||
update_topic: `config/cameras/${polygon.camera}/${updateTopicType}`,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
toast.success(
|
toast.success(
|
||||||
@ -230,6 +220,12 @@ export default function PolygonItem({
|
|||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
setActivePolygonIndex(undefined);
|
setActivePolygonIndex(undefined);
|
||||||
saveToConfig(polygon);
|
saveToConfig(polygon);
|
||||||
|
addMessage(
|
||||||
|
"masks_zones",
|
||||||
|
t("masksAndZones.restart_required"),
|
||||||
|
undefined,
|
||||||
|
"masks_zones",
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user