mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-15 11:32:09 +03:00
ruff format
This commit is contained in:
parent
b92af01b38
commit
42c6db81a7
@ -215,7 +215,6 @@ class MemryXDetector(DetectionApi):
|
|||||||
self._acquire_file_lock(lock_path)
|
self._acquire_file_lock(lock_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
# ---------- CASE 1: user provided a custom model path ----------
|
# ---------- CASE 1: user provided a custom model path ----------
|
||||||
if self.memx_model_path:
|
if self.memx_model_path:
|
||||||
if not self.memx_model_path.endswith(".zip"):
|
if not self.memx_model_path.endswith(".zip"):
|
||||||
@ -273,7 +272,9 @@ class MemryXDetector(DetectionApi):
|
|||||||
self.memx_post_model = None
|
self.memx_post_model = None
|
||||||
else:
|
else:
|
||||||
# Future model types can optionally use post if present
|
# Future model types can optionally use post if present
|
||||||
self.memx_post_model = post_candidates[0] if post_candidates else None
|
self.memx_post_model = (
|
||||||
|
post_candidates[0] if post_candidates else None
|
||||||
|
)
|
||||||
|
|
||||||
logger.info(f"Using custom model: {self.memx_model_path}")
|
logger.info(f"Using custom model: {self.memx_model_path}")
|
||||||
return
|
return
|
||||||
@ -315,7 +316,9 @@ class MemryXDetector(DetectionApi):
|
|||||||
logger.info(f"Model extracted to {self.cache_dir}.")
|
logger.info(f"Model extracted to {self.cache_dir}.")
|
||||||
|
|
||||||
# Re-assign model paths after extraction
|
# Re-assign model paths after extraction
|
||||||
self.memx_model_path = os.path.join(model_subdir, self.expected_dfp_model)
|
self.memx_model_path = os.path.join(
|
||||||
|
model_subdir, self.expected_dfp_model
|
||||||
|
)
|
||||||
self.memx_post_model = (
|
self.memx_post_model = (
|
||||||
os.path.join(model_subdir, self.expected_post_model)
|
os.path.join(model_subdir, self.expected_post_model)
|
||||||
if self.expected_post_model
|
if self.expected_post_model
|
||||||
@ -331,7 +334,9 @@ class MemryXDetector(DetectionApi):
|
|||||||
os.remove(zip_path)
|
os.remove(zip_path)
|
||||||
logger.info("Cleaned up ZIP file after extraction.")
|
logger.info("Cleaned up ZIP file after extraction.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"Failed to remove downloaded zip {zip_path}: {e}")
|
logger.warning(
|
||||||
|
f"Failed to remove downloaded zip {zip_path}: {e}"
|
||||||
|
)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
self._release_file_lock(lock_path)
|
self._release_file_lock(lock_path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user