diff --git a/frigate/output.py b/frigate/output.py index ab1fdbd78..b59d56a62 100644 --- a/frigate/output.py +++ b/frigate/output.py @@ -329,7 +329,6 @@ class BirdsEyeFrameManager: # update each position in the layout for position, camera in enumerate(self.camera_layout, start=0): - # if this camera was removed, replace it or clear it if camera in removed_cameras: # if replacing this camera with a newly added one diff --git a/frigate/record.py b/frigate/record.py index 7693db914..4ec3ff9a1 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -111,7 +111,6 @@ class RecordingMaintainer(threading.Thread): grouped_recordings[camera] = grouped_recordings[camera][-keep_count:] for camera, recordings in grouped_recordings.items(): - # clear out all the recording info for old frames while ( len(self.recordings_info[camera]) > 0 diff --git a/frigate/stats.py b/frigate/stats.py index 60f805c62..1ceb5f30d 100644 --- a/frigate/stats.py +++ b/frigate/stats.py @@ -23,7 +23,6 @@ logger = logging.getLogger(__name__) def get_latest_version(config: FrigateConfig) -> str: - if not config.telemetry.version_check: return "disabled" diff --git a/frigate/storage.py b/frigate/storage.py index 1ac67a00c..5b66abbdc 100644 --- a/frigate/storage.py +++ b/frigate/storage.py @@ -179,7 +179,6 @@ class StorageMaintainer(threading.Thread): def run(self): """Check every 5 minutes if storage needs to be cleaned up.""" while not self.stop_event.wait(300): - if not self.camera_storage_stats or True in [ r["needs_refresh"] for r in self.camera_storage_stats.values() ]: diff --git a/frigate/test/test_config.py b/frigate/test/test_config.py index 87f811fb2..be9bdcdfd 100644 --- a/frigate/test/test_config.py +++ b/frigate/test/test_config.py @@ -673,7 +673,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].detect.max_disappeared == 5 * 5 def test_motion_frame_height_wont_go_below_120(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -702,7 +701,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].motion.frame_height == 50 def test_motion_contour_area_dynamic(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -731,7 +729,6 @@ class TestConfig(unittest.TestCase): assert round(runtime_config.cameras["back"].motion.contour_area) == 30 def test_merge_labelmap(self): - config = { "mqtt": {"host": "mqtt"}, "model": {"labelmap": {7: "truck"}}, @@ -761,7 +758,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.model.merged_labelmap[7] == "truck" def test_default_labelmap_empty(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -790,7 +786,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.model.merged_labelmap[0] == "person" def test_default_labelmap(self): - config = { "mqtt": {"host": "mqtt"}, "model": {"width": 320, "height": 320}, @@ -820,7 +815,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.model.merged_labelmap[0] == "person" def test_fails_on_invalid_role(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -849,7 +843,6 @@ class TestConfig(unittest.TestCase): self.assertRaises(ValidationError, lambda: FrigateConfig(**config)) def test_fails_on_missing_role(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -880,7 +873,6 @@ class TestConfig(unittest.TestCase): self.assertRaises(ValueError, lambda: frigate_config.runtime_config) def test_works_on_missing_role_multiple_cams(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -929,7 +921,6 @@ class TestConfig(unittest.TestCase): runtime_config = frigate_config.runtime_config def test_global_detect(self): - config = { "mqtt": {"host": "mqtt"}, "detect": {"max_disappeared": 1}, @@ -959,7 +950,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].detect.height == 1080 def test_default_detect(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -983,7 +973,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].detect.height == 720 def test_global_detect_merge(self): - config = { "mqtt": {"host": "mqtt"}, "detect": {"max_disappeared": 1, "height": 720}, @@ -1014,7 +1003,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].detect.width == 1920 def test_global_snapshots(self): - config = { "mqtt": {"host": "mqtt"}, "snapshots": {"enabled": True}, @@ -1042,7 +1030,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].snapshots.height == 100 def test_default_snapshots(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1066,7 +1053,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].snapshots.quality == 70 def test_global_snapshots_merge(self): - config = { "mqtt": {"host": "mqtt"}, "snapshots": {"bounding_box": False, "height": 300}, @@ -1096,7 +1082,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].snapshots.enabled def test_global_rtmp_disabled(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1119,7 +1104,6 @@ class TestConfig(unittest.TestCase): assert not runtime_config.cameras["back"].rtmp.enabled def test_default_not_rtmp(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1142,7 +1126,6 @@ class TestConfig(unittest.TestCase): assert not runtime_config.cameras["back"].rtmp.enabled def test_global_rtmp_merge(self): - config = { "mqtt": {"host": "mqtt"}, "rtmp": {"enabled": False}, @@ -1169,7 +1152,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].rtmp.enabled def test_global_rtmp_default(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1196,7 +1178,6 @@ class TestConfig(unittest.TestCase): assert not runtime_config.cameras["back"].rtmp.enabled def test_global_jsmpeg(self): - config = { "mqtt": {"host": "mqtt"}, "live": {"quality": 4}, @@ -1220,7 +1201,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].live.quality == 4 def test_default_live(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1243,7 +1223,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].live.quality == 8 def test_global_live_merge(self): - config = { "mqtt": {"host": "mqtt"}, "live": {"quality": 4, "height": 480}, @@ -1271,7 +1250,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].live.height == 480 def test_global_timestamp_style(self): - config = { "mqtt": {"host": "mqtt"}, "timestamp_style": {"position": "bl"}, @@ -1295,7 +1273,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].timestamp_style.position == "bl" def test_default_timestamp_style(self): - config = { "mqtt": {"host": "mqtt"}, "cameras": { @@ -1318,7 +1295,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].timestamp_style.position == "tl" def test_global_timestamp_style_merge(self): - config = { "mqtt": {"host": "mqtt"}, "rtmp": {"enabled": False}, @@ -1345,7 +1321,6 @@ class TestConfig(unittest.TestCase): assert runtime_config.cameras["back"].timestamp_style.thickness == 4 def test_allow_retain_to_be_a_decimal(self): - config = { "mqtt": {"host": "mqtt"}, "snapshots": {"retain": {"default": 1.5}}, diff --git a/frigate/util.py b/frigate/util.py index a6fe4b294..887baf8de 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -772,7 +772,6 @@ def get_docker_memlimit_bytes() -> int: # check running a supported cgroups version if get_cgroups_version() == "cgroup2": - memlimit_command = ["cat", "/sys/fs/cgroup/memory.max"] p = sp.run( @@ -817,7 +816,6 @@ def get_cpu_stats() -> dict[str, dict]: for line in lines: stats = list(filter(lambda a: a != "", line.strip().split(" "))) try: - if docker_memlimit > 0: mem_res = int(stats[5]) mem_pct = str( diff --git a/frigate/video.py b/frigate/video.py index ca200fd53..a64809f45 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -162,7 +162,6 @@ def capture_frames( current_frame: mp.Value, stop_event: mp.Event, ): - frame_size = frame_shape[0] * frame_shape[1] frame_rate = EventsPerSecond() frame_rate.start() @@ -594,7 +593,6 @@ def process_frames( stop_event, exit_on_empty: bool = False, ): - fps = process_info["process_fps"] detection_fps = process_info["detection_fps"] current_frame_time = process_info["detection_frame"] @@ -748,7 +746,6 @@ def process_frames( selected_objects = [] for group in detected_object_groups.values(): - # apply non-maxima suppression to suppress weak, overlapping bounding boxes # o[2] is the box of the object: xmin, ymin, xmax, ymax # apply max/min to ensure values do not exceed the known frame size diff --git a/frigate/zeroconf.py b/frigate/zeroconf.py index c9c20aba6..22c0b1e4e 100644 --- a/frigate/zeroconf.py +++ b/frigate/zeroconf.py @@ -13,6 +13,7 @@ logger = logging.getLogger(__name__) ZEROCONF_TYPE = "_frigate._tcp.local." + # Taken from: http://stackoverflow.com/a/11735897 def get_local_ip() -> bytes: """Try to determine the local IP address of the machine.""" diff --git a/requirements-dev.txt b/requirements-dev.txt index 25ad461bd..29f004455 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ -pylint == 2.15.* -black == 22.12.* +pylint == 2.17.* +black == 23.3.*