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