Fix a couple bugs (#8045)

This commit is contained in:
Nicolas Mowen 2023-10-07 08:18:34 -06:00 committed by GitHub
parent fe9fcf3eaa
commit 8bde914939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -163,7 +163,7 @@ class AudioEventMaintainer(threading.Thread):
self.recordings_info_queue = recordings_info_queue self.recordings_info_queue = recordings_info_queue
self.feature_metrics = feature_metrics self.feature_metrics = feature_metrics
self.inter_process_communicator = inter_process_communicator self.inter_process_communicator = inter_process_communicator
self.detections: dict[dict[str, any]] = feature_metrics self.detections: dict[dict[str, any]] = {}
self.stop_event = stop_event self.stop_event = stop_event
self.detector = AudioTfl(stop_event, self.config.audio.num_threads) self.detector = AudioTfl(stop_event, self.config.audio.num_threads)
self.shape = (int(round(AUDIO_DURATION * AUDIO_SAMPLE_RATE)),) self.shape = (int(round(AUDIO_DURATION * AUDIO_SAMPLE_RATE)),)

View File

@ -60,7 +60,7 @@ def get_canvas_shape(width: int, height: int) -> tuple[int, int]:
if round(a_w / a_h, 2) != round(width / height, 2): if round(a_w / a_h, 2) != round(width / height, 2):
canvas_width = width canvas_width = width
canvas_height = (canvas_width / a_w) * a_h canvas_height = int((canvas_width / a_w) * a_h)
logger.warning( logger.warning(
f"The birdseye resolution is a non-standard aspect ratio, forcing birdseye resolution to {canvas_width} x {canvas_height}" f"The birdseye resolution is a non-standard aspect ratio, forcing birdseye resolution to {canvas_width} x {canvas_height}"
) )