mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-09 15:05:26 +03:00
openvino log message and preview directory checks
This commit is contained in:
parent
ba4a6a53d7
commit
3809904ea8
@ -52,6 +52,12 @@ class OvDetector(DetectionApi):
|
|||||||
self.h = detector_config.model.height
|
self.h = detector_config.model.height
|
||||||
self.w = detector_config.model.width
|
self.w = detector_config.model.width
|
||||||
|
|
||||||
|
logger.info(
|
||||||
|
"Loading OpenVINO model %s on device %s",
|
||||||
|
detector_config.model.path,
|
||||||
|
detector_config.device,
|
||||||
|
)
|
||||||
|
|
||||||
self.runner = OpenVINOModelRunner(
|
self.runner = OpenVINOModelRunner(
|
||||||
model_path=detector_config.model.path,
|
model_path=detector_config.model.path,
|
||||||
device=detector_config.device,
|
device=detector_config.device,
|
||||||
|
|||||||
@ -349,6 +349,13 @@ def move_preview_frames(loc: str) -> None:
|
|||||||
if not os.path.exists(preview_holdover):
|
if not os.path.exists(preview_holdover):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not os.access(preview_holdover, os.R_OK | os.W_OK):
|
||||||
|
logger.error(
|
||||||
|
"Insufficient permissions on preview restart cache at %s",
|
||||||
|
preview_holdover,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
shutil.move(preview_holdover, preview_cache)
|
shutil.move(preview_holdover, preview_cache)
|
||||||
except shutil.Error:
|
except shutil.Error:
|
||||||
logger.error("Failed to restore preview cache.")
|
logger.error("Failed to restore preview cache.")
|
||||||
|
|||||||
@ -361,14 +361,17 @@ class PreviewRecorder:
|
|||||||
small_frame,
|
small_frame,
|
||||||
cv2.COLOR_YUV2BGR_I420,
|
cv2.COLOR_YUV2BGR_I420,
|
||||||
)
|
)
|
||||||
cv2.imwrite(
|
cache_path = get_cache_image_name(self.camera_name, frame_time)
|
||||||
get_cache_image_name(self.camera_name, frame_time),
|
|
||||||
|
if not cv2.imwrite(
|
||||||
|
cache_path,
|
||||||
small_frame,
|
small_frame,
|
||||||
[
|
[
|
||||||
int(cv2.IMWRITE_WEBP_QUALITY),
|
int(cv2.IMWRITE_WEBP_QUALITY),
|
||||||
PREVIEW_QUALITY_WEBP[self.config.record.preview.quality],
|
PREVIEW_QUALITY_WEBP[self.config.record.preview.quality],
|
||||||
],
|
],
|
||||||
)
|
):
|
||||||
|
logger.error("Failed to write preview frame to %s", cache_path)
|
||||||
|
|
||||||
def write_data(
|
def write_data(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user