mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-26 19:06:11 +01:00
better mask error handling
This commit is contained in:
parent
24b8bd7c85
commit
ca337c32b4
@ -1,5 +1,6 @@
|
|||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
@ -11,6 +12,8 @@ import yaml
|
|||||||
|
|
||||||
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
|
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
DETECTORS_SCHEMA = vol.Schema(
|
DETECTORS_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(str): {
|
vol.Required(str): {
|
||||||
@ -743,7 +746,9 @@ class CameraConfig():
|
|||||||
cv2.fillPoly(mask_img, pts=[contour], color=(0))
|
cv2.fillPoly(mask_img, pts=[contour], color=(0))
|
||||||
else:
|
else:
|
||||||
mask_file = cv2.imread(f"/config/{mask}", cv2.IMREAD_GRAYSCALE)
|
mask_file = cv2.imread(f"/config/{mask}", cv2.IMREAD_GRAYSCALE)
|
||||||
if not mask_file.size == 0:
|
if mask_file is None or mask_file.size == 0:
|
||||||
|
logger.warning(f"Could not read mask file {mask}")
|
||||||
|
else:
|
||||||
mask_img[np.where(mask_file==[0])] = [0]
|
mask_img[np.where(mask_file==[0])] = [0]
|
||||||
|
|
||||||
def _get_ffmpeg_cmd(self, ffmpeg_input):
|
def _get_ffmpeg_cmd(self, ffmpeg_input):
|
||||||
|
Loading…
Reference in New Issue
Block a user