mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-01 20:36:51 +03:00
Compare commits
3
Commits
analytics
...
78e05f1e55
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78e05f1e55 | ||
|
|
4c3e0fdea9 | ||
|
|
fa2452e0c8 |
@@ -288,6 +288,10 @@ class FaceRealTimeProcessor(RealTimeProcessorApi):
|
|||||||
max(0, face_box[0]) : min(frame.shape[1], face_box[2]),
|
max(0, face_box[0]) : min(frame.shape[1], face_box[2]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if face_frame.size == 0:
|
||||||
|
logger.debug(f"Empty face crop for {id}")
|
||||||
|
return
|
||||||
|
|
||||||
res = self.recognizer.classify(face_frame)
|
res = self.recognizer.classify(face_frame)
|
||||||
|
|
||||||
if not res:
|
if not res:
|
||||||
|
|||||||
@@ -684,22 +684,21 @@ class TrackedObjectProcessor(threading.Thread):
|
|||||||
# check for config updates
|
# check for config updates
|
||||||
updated_topics = self.camera_config_subscriber.check_for_updates()
|
updated_topics = self.camera_config_subscriber.check_for_updates()
|
||||||
|
|
||||||
if "enabled" in updated_topics:
|
# a single drain can carry several topics at once, so add and
|
||||||
for camera in updated_topics["enabled"]:
|
# remove are handled independently rather than as exclusive branches
|
||||||
if self.camera_states[camera].prev_enabled is None:
|
for camera in updated_topics.get("add", []):
|
||||||
self.camera_states[camera].prev_enabled = self.config.cameras[
|
|
||||||
camera
|
|
||||||
].enabled
|
|
||||||
elif "add" in updated_topics:
|
|
||||||
for camera in updated_topics["add"]:
|
|
||||||
self.config.cameras[camera] = (
|
self.config.cameras[camera] = (
|
||||||
self.camera_config_subscriber.camera_configs[camera]
|
self.camera_config_subscriber.camera_configs[camera]
|
||||||
)
|
)
|
||||||
self.create_camera_state(camera)
|
self.create_camera_state(camera)
|
||||||
elif "remove" in updated_topics:
|
|
||||||
|
if "remove" in updated_topics:
|
||||||
for camera in updated_topics["remove"]:
|
for camera in updated_topics["remove"]:
|
||||||
removed_camera_state = self.camera_states[camera]
|
camera_state = self.camera_states.get(camera)
|
||||||
removed_camera_state.shutdown()
|
if camera_state is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
camera_state.shutdown()
|
||||||
self.camera_states.pop(camera)
|
self.camera_states.pop(camera)
|
||||||
self.camera_activity.pop(camera, None)
|
self.camera_activity.pop(camera, None)
|
||||||
self.last_motion_detected.pop(camera, None)
|
self.last_motion_detected.pop(camera, None)
|
||||||
|
|||||||
@@ -770,6 +770,34 @@ export default function MotionSearchView({
|
|||||||
};
|
};
|
||||||
}, [cancelMotionSearchJobViaBeacon]);
|
}, [cancelMotionSearchJobViaBeacon]);
|
||||||
|
|
||||||
|
const handleBack = useCallback(() => {
|
||||||
|
if (onBack) {
|
||||||
|
onBack();
|
||||||
|
} else {
|
||||||
|
navigate(-1);
|
||||||
|
}
|
||||||
|
}, [navigate, onBack]);
|
||||||
|
|
||||||
|
// Dismissing the entry dialog (escape / click outside) before a search has
|
||||||
|
// run leaves nothing behind it, so cancel the flow instead of revealing an
|
||||||
|
// empty page.
|
||||||
|
const handleSearchDialogOpenChange = useCallback(
|
||||||
|
(nextOpen: boolean) => {
|
||||||
|
if (
|
||||||
|
!nextOpen &&
|
||||||
|
!isSearching &&
|
||||||
|
!hasSearched &&
|
||||||
|
searchResults.length === 0
|
||||||
|
) {
|
||||||
|
handleBack();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsSearchDialogOpen(nextOpen);
|
||||||
|
},
|
||||||
|
[handleBack, hasSearched, isSearching, searchResults.length],
|
||||||
|
);
|
||||||
|
|
||||||
const handleNewSearch = useCallback(() => {
|
const handleNewSearch = useCallback(() => {
|
||||||
if (jobId && jobCamera) {
|
if (jobId && jobCamera) {
|
||||||
void cancelMotionSearchJob(jobId, jobCamera);
|
void cancelMotionSearchJob(jobId, jobCamera);
|
||||||
@@ -1238,7 +1266,7 @@ export default function MotionSearchView({
|
|||||||
<Toaster closeButton={true} position="top-center" />
|
<Toaster closeButton={true} position="top-center" />
|
||||||
<MotionSearchDialog
|
<MotionSearchDialog
|
||||||
open={isSearchDialogOpen}
|
open={isSearchDialogOpen}
|
||||||
onOpenChange={setIsSearchDialogOpen}
|
onOpenChange={handleSearchDialogOpenChange}
|
||||||
config={config}
|
config={config}
|
||||||
cameras={cameras}
|
cameras={cameras}
|
||||||
selectedCamera={selectedCamera}
|
selectedCamera={selectedCamera}
|
||||||
@@ -1276,7 +1304,7 @@ export default function MotionSearchView({
|
|||||||
className="flex items-center gap-2.5 rounded-lg"
|
className="flex items-center gap-2.5 rounded-lg"
|
||||||
aria-label={t("label.back", { ns: "common" })}
|
aria-label={t("label.back", { ns: "common" })}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => (onBack ? onBack() : navigate(-1))}
|
onClick={handleBack}
|
||||||
>
|
>
|
||||||
<IoMdArrowRoundBack className="size-5 text-secondary-foreground" />
|
<IoMdArrowRoundBack className="size-5 text-secondary-foreground" />
|
||||||
{isDesktop && (
|
{isDesktop && (
|
||||||
|
|||||||
Reference in New Issue
Block a user