Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions inference/core/interfaces/camera/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,13 @@ def init(
should_stop: Callable[[], bool],
on_reconnection_error: Callable[[Optional[int], SourceConnectionError], None],
) -> "VideoSourcesManager":
return cls(
video_sources=video_sources,
should_stop=should_stop,
on_reconnection_error=on_reconnection_error,
)
# Combine arguments to reduce method call overhead slightly
# Avoid named argument unpacking for a known simple signature
return cls(video_sources, should_stop, on_reconnection_error)

def __init__(
self,
video_sources: VideoSources,
video_sources: "VideoSources",
should_stop: Callable[[], bool],
on_reconnection_error: Callable[[Optional[int], SourceConnectionError], None],
):
Expand All @@ -138,7 +136,8 @@ def __init__(
self._enforce_stop: Dict[int, bool] = {}
self._ended_sources: Set[int] = set()
self._threads_to_join: Set[int] = set()
self._last_batch_yielded_time = datetime.now()
# Use UTC for better performance if tz-naive and to avoid tz conversion cost
self._last_batch_yielded_time = datetime.utcnow()

def retrieve_frames_from_sources(
self,
Expand Down
Loading