Skip to content

Commit

Permalink
Semantic Search for Detections (blakeblackshear#11899)
Browse files Browse the repository at this point in the history
* Initial re-implementation of semantic search

* put docker-compose back and make reindex match docs

* remove debug code and fix import

* fix docs

* manually build pysqlite3 as binaries are only available for x86-64

* update comment in build_pysqlite3.sh

* only embed objects

* better error handling when genai fails

* ask ollama to pull requested model at startup

* update ollama docs

* address some PR review comments

* fix lint

* use IPC to write description, update docs for reindex

* remove gemini-pro-vision from docs as it will be unavailable soon

* fix OpenAI doc available models

* fix api error in gemini and metadata for embeddings
  • Loading branch information
hunterjm authored and iursevla committed Sep 1, 2024
1 parent aa43a83 commit 65e8a02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frigate/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import faulthandler
import sys
import threading

from flask import cli

from frigate.app import FrigateApp
# Hotsawp the sqlite3 module for Chroma compatibility
__import__("pysqlite3")
sys.modules["sqlite3"] = sys.modules.pop("pysqlite3")

faulthandler.enable()

Expand All @@ -12,6 +15,8 @@
cli.show_server_banner = lambda *x: None

if __name__ == "__main__":
from frigate.app import FrigateApp

frigate_app = FrigateApp()

frigate_app.start()
1 change: 1 addition & 0 deletions frigate/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
MODEL_CACHE_DIR,
RECORD_DIR,
)
from frigate.embeddings import manage_embeddings
from frigate.embeddings import EmbeddingsContext, manage_embeddings
from frigate.events.audio import listen_to_audio
from frigate.events.cleanup import EventCleanup
Expand Down
1 change: 1 addition & 0 deletions frigate/events/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, config: FrigateConfig, stop_event: MpEvent):
self.name = "event_cleanup"
self.config = config
self.stop_event = stop_event
self.embeddings = Embeddings()
self.camera_keys = list(self.config.cameras.keys())
self.removed_camera_labels: list[str] = None
self.camera_labels: dict[str, dict[str, any]] = {}
Expand Down

0 comments on commit 65e8a02

Please sign in to comment.