Format changes with Black

This commit is contained in:
Chris OBryan 2023-06-08 14:26:55 -05:00
parent 8390f054ac
commit 21f00b3858
3 changed files with 8 additions and 7 deletions

View File

@ -98,7 +98,7 @@ class Dispatcher:
def _on_capture_command(self, camera_name: str, payload: str) -> None: def _on_capture_command(self, camera_name: str, payload: str) -> None:
"""Callback for detect topic.""" """Callback for detect topic."""
logger.info(f"Received capture command [{payload}] for [{camera_name}]") logger.info(f"Received capture command [{payload}] for [{camera_name}]")
capture_proc = self.camera_metrics[camera_name]['capture_process'] capture_proc = self.camera_metrics[camera_name]["capture_process"]
# Send SIGUSR1 to resume, SIGUSR2 to pause # Send SIGUSR1 to resume, SIGUSR2 to pause
new_state = True if payload == "ON" else False if payload == "OFF" else None new_state = True if payload == "ON" else False if payload == "OFF" else None

View File

@ -641,7 +641,7 @@ def terminate_process(
proc: sp.Popen, logger_inst: logging.Logger = None, timeout: float = 30.0 proc: sp.Popen, logger_inst: logging.Logger = None, timeout: float = 30.0
): ):
logger_inst = logger_inst or logger logger_inst = logger_inst or logger
if proc is not None and proc.poll() == None: if proc is not None and proc.poll() is None:
proc_name: str = proc.args[0] proc_name: str = proc.args[0]
logger_inst.info(f"Terminating the existing {proc_name} process...") logger_inst.info(f"Terminating the existing {proc_name} process...")
proc.terminate() proc.terminate()

View File

@ -113,6 +113,7 @@ def create_tensor_input(frame, model_config, region):
# Expand dimensions since the model expects images to have shape: [1, height, width, 3] # Expand dimensions since the model expects images to have shape: [1, height, width, 3]
return np.expand_dims(cropped_frame, axis=0) return np.expand_dims(cropped_frame, axis=0)
def start_or_restart_ffmpeg( def start_or_restart_ffmpeg(
ffmpeg_cmd, logger, logpipe: LogPipe, frame_size=None, ffmpeg_process=None ffmpeg_cmd, logger, logpipe: LogPipe, frame_size=None, ffmpeg_process=None
): ):