Skip to content

Commit 478b69e

Browse files
formatting
1 parent 1687aaf commit 478b69e

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

  • inference/core/interfaces/stream_manager/manager_app

inference/core/interfaces/stream_manager/manager_app/webrtc.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,35 @@ async def recv(self):
141141
if self._consecutive_timeouts >= self._max_consecutive_timeouts:
142142
self._consecutive_on_time = 0
143143

144-
workflow_too_slow_message = ["Workflow is too heavy to process all frames on time..."]
144+
workflow_too_slow_message = [
145+
"Workflow is too heavy to process all frames on time..."
146+
]
145147
if np_frame is None:
146148
if not self._last_frame:
147149
np_frame = overlay_text_on_np_frame(
148-
frame.to_ndarray(format="bgr24"), ["Inference pipeline is starting..."]
150+
frame.to_ndarray(format="bgr24"),
151+
["Inference pipeline is starting..."],
149152
)
150153
new_frame = VideoFrame.from_ndarray(np_frame, format="bgr24")
151-
elif self._max_consecutive_timeouts and self._consecutive_timeouts >= self._max_consecutive_timeouts:
154+
elif (
155+
self._max_consecutive_timeouts
156+
and self._consecutive_timeouts >= self._max_consecutive_timeouts
157+
):
152158
np_frame = overlay_text_on_np_frame(
153-
self._last_frame.to_ndarray(format="bgr24"), workflow_too_slow_message
159+
self._last_frame.to_ndarray(format="bgr24"),
160+
workflow_too_slow_message,
154161
)
155162
new_frame = VideoFrame.from_ndarray(np_frame, format="bgr24")
156163
else:
157164
new_frame = self._last_frame
158165
else:
159-
if self._max_consecutive_timeouts and self._consecutive_timeouts >= self._max_consecutive_timeouts:
166+
if (
167+
self._max_consecutive_timeouts
168+
and self._consecutive_timeouts >= self._max_consecutive_timeouts
169+
):
160170
np_frame = overlay_text_on_np_frame(
161-
self._last_frame.to_ndarray(format="bgr24"), workflow_too_slow_message
171+
self._last_frame.to_ndarray(format="bgr24"),
172+
workflow_too_slow_message,
162173
)
163174
new_frame = VideoFrame.from_ndarray(np_frame, format="bgr24")
164175
else:

0 commit comments

Comments
 (0)