mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-20 13:54:36 +01:00
Miscellaneous Fixes (0.17 Beta) (#21320)
* Exclude D-FINE from using CUDA Graphs * fix objects count in detail stream * Add debugging for classification models * validate idb stored stream name and reset if invalid fixes https://github.com/blakeblackshear/frigate/discussions/21311 * ensure jina loading takes place in the main thread to prevent lazily importing tensorflow in another thread later reverts atexit changes in https://github.com/blakeblackshear/frigate/pull/21301 and fixes https://github.com/blakeblackshear/frigate/discussions/21306 * revert old atexit change in bird too * revert types * ensure we bail in the live mode hook for empty camera groups prevent infinite rendering on camera groups with no cameras --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
@@ -345,9 +345,9 @@ function ReviewGroup({
|
||||
}
|
||||
|
||||
const reviewInfo = useMemo(() => {
|
||||
const objectCount = fetchedEvents
|
||||
? fetchedEvents.length
|
||||
: (review.data.objects ?? []).length;
|
||||
const detectionsCount =
|
||||
review.data?.detections?.length ?? (review.data?.objects ?? []).length;
|
||||
const objectCount = fetchedEvents ? fetchedEvents.length : detectionsCount;
|
||||
|
||||
return `${t("detail.trackedObject", { count: objectCount })}`;
|
||||
}, [review, t, fetchedEvents]);
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function useCameraLiveMode(
|
||||
}>({});
|
||||
|
||||
useEffect(() => {
|
||||
if (!cameras) return;
|
||||
if (!cameras || cameras.length === 0) return;
|
||||
|
||||
const mseSupported =
|
||||
"MediaSource" in window || "ManagedMediaSource" in window;
|
||||
|
||||
@@ -147,10 +147,11 @@ export default function LiveCameraView({
|
||||
|
||||
// supported features
|
||||
|
||||
const [streamName, setStreamName] = useUserPersistence<string>(
|
||||
`${camera.name}-stream`,
|
||||
Object.values(camera.live.streams)[0],
|
||||
);
|
||||
const [streamName, setStreamName, streamNameLoaded] =
|
||||
useUserPersistence<string>(
|
||||
`${camera.name}-stream`,
|
||||
Object.values(camera.live.streams)[0],
|
||||
);
|
||||
|
||||
const isRestreamed = useMemo(
|
||||
() =>
|
||||
@@ -159,6 +160,19 @@ export default function LiveCameraView({
|
||||
[config, streamName],
|
||||
);
|
||||
|
||||
// validate stored stream name and reset if now invalid
|
||||
|
||||
useEffect(() => {
|
||||
if (!streamNameLoaded) return;
|
||||
|
||||
const available = Object.values(camera.live.streams || {});
|
||||
if (available.length === 0) return;
|
||||
|
||||
if (streamName != null && !available.includes(streamName)) {
|
||||
setStreamName(available[0]);
|
||||
}
|
||||
}, [streamNameLoaded, camera.live.streams, streamName, setStreamName]);
|
||||
|
||||
const { data: cameraMetadata } = useSWR<LiveStreamMetadata>(
|
||||
isRestreamed ? `go2rtc/streams/${streamName}` : null,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user