mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 03:35:26 +03:00
fix typing
This commit is contained in:
parent
f3a8eef312
commit
99cdf10e1c
@ -343,7 +343,7 @@ class FrigateApp:
|
||||
migrate_db.close()
|
||||
|
||||
def init_embeddings(self) -> None:
|
||||
self.embeddings = None
|
||||
self.embeddings: Optional[Embeddings] = None
|
||||
try:
|
||||
self.embeddings = Embeddings(self.config)
|
||||
except ValueError:
|
||||
|
||||
@ -7,6 +7,7 @@ import queue
|
||||
import threading
|
||||
from multiprocessing import Queue
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
from typing import Optional
|
||||
|
||||
import google.generativeai as genai
|
||||
import numpy as np
|
||||
@ -27,7 +28,7 @@ class EmbeddingProcessor(threading.Thread):
|
||||
def __init__(
|
||||
self,
|
||||
config: FrigateConfig,
|
||||
embeddings: Embeddings,
|
||||
embeddings: Optional[Embeddings],
|
||||
queue: Queue,
|
||||
stop_event: MpEvent,
|
||||
) -> None:
|
||||
|
||||
@ -7,6 +7,7 @@ import threading
|
||||
from enum import Enum
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.const import CLIPS_DIR
|
||||
@ -23,7 +24,10 @@ class EventCleanupType(str, Enum):
|
||||
|
||||
class EventCleanup(threading.Thread):
|
||||
def __init__(
|
||||
self, config: FrigateConfig, embeddings: Embeddings, stop_event: MpEvent
|
||||
self,
|
||||
config: FrigateConfig,
|
||||
embeddings: Optional[Embeddings],
|
||||
stop_event: MpEvent,
|
||||
):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "event_cleanup"
|
||||
|
||||
@ -12,6 +12,7 @@ import traceback
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from functools import reduce
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
from urllib.parse import unquote
|
||||
|
||||
import cv2
|
||||
@ -78,7 +79,7 @@ def create_app(
|
||||
onvif: OnvifController,
|
||||
external_processor: ExternalEventProcessor,
|
||||
plus_api: PlusApi,
|
||||
embeddings: Embeddings,
|
||||
embeddings: Optional[Embeddings],
|
||||
):
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user