From fd7580ce97c958174c535b1e8b31320a6afd9f9f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:45:45 -0500 Subject: [PATCH 01/10] use two columns on mobile view --- .../components/card/SearchThumbnailFooter.tsx | 45 +++++++++---------- web/src/views/search/SearchView.tsx | 17 ++++--- web/src/views/settings/SearchSettingsView.tsx | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/web/src/components/card/SearchThumbnailFooter.tsx b/web/src/components/card/SearchThumbnailFooter.tsx index 9037fcf25c..78841159b6 100644 --- a/web/src/components/card/SearchThumbnailFooter.tsx +++ b/web/src/components/card/SearchThumbnailFooter.tsx @@ -10,8 +10,6 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { @@ -24,13 +22,7 @@ import { AlertDialogHeader, AlertDialogTitle, } from "../ui/alert-dialog"; -import { - LuCamera, - LuCheck, - LuDownload, - LuMoreVertical, - LuTrash2, -} from "react-icons/lu"; +import { LuCamera, LuDownload, LuMoreVertical, LuTrash2 } from "react-icons/lu"; import FrigatePlusIcon from "@/components/icons/FrigatePlusIcon"; import { FrigatePlusDialog } from "../overlay/dialog/FrigatePlusDialog"; import { Event } from "@/types/event"; @@ -39,6 +31,7 @@ import { baseUrl } from "@/api/baseUrl"; import axios from "axios"; import { toast } from "sonner"; import { MdImageSearch } from "react-icons/md"; +import { isMobileOnly } from "react-device-detect"; type SearchThumbnailProps = { searchResult: SearchResult; @@ -130,18 +123,12 @@ export default function SearchThumbnailFooter({ )} {formattedDate} -
- {config?.plus?.enabled && +
+ {!isMobileOnly && + config?.plus?.enabled && searchResult.has_snapshot && searchResult.end_time && - (searchResult.plus_id ? ( - - - - - Submitted to Frigate+ - - ) : ( + !searchResult.plus_id && ( Submit to Frigate+ - ))} + )} {config?.semantic_search?.enabled && ( @@ -170,10 +157,6 @@ export default function SearchThumbnailFooter({ - - Tracked Object Actions - - {searchResult.has_clip && ( View object lifecycle + + {isMobileOnly && + config?.plus?.enabled && + searchResult.has_snapshot && + searchResult.end_time && + !searchResult.plus_id && ( + setShowFrigatePlus(true)} + > + + Submit to Frigate+ + + )} setDeleteDialogOpen(true)} diff --git a/web/src/views/search/SearchView.tsx b/web/src/views/search/SearchView.tsx index bc4f5b54d5..5d18e53d46 100644 --- a/web/src/views/search/SearchView.tsx +++ b/web/src/views/search/SearchView.tsx @@ -73,13 +73,16 @@ export default function SearchView({ const [columnCount, setColumnCount] = usePersistence("exploreGridColumns", 4); const effectiveColumnCount = useMemo(() => columnCount ?? 4, [columnCount]); - const gridClassName = cn("grid w-full gap-2 px-1 gap-2 lg:gap-4 md:mx-2", { - "sm:grid-cols-2": effectiveColumnCount <= 2, - "sm:grid-cols-3": effectiveColumnCount === 3, - "sm:grid-cols-4": effectiveColumnCount === 4, - "sm:grid-cols-5": effectiveColumnCount === 5, - "sm:grid-cols-6": effectiveColumnCount === 6, - }); + const gridClassName = cn( + "grid w-full gap-2 px-1 gap-2 lg:gap-4 md:mx-2 grid-cols-2", + { + "sm:grid-cols-2": effectiveColumnCount <= 2, + "sm:grid-cols-3": effectiveColumnCount === 3, + "sm:grid-cols-4": effectiveColumnCount === 4, + "sm:grid-cols-5": effectiveColumnCount === 5, + "sm:grid-cols-6": effectiveColumnCount === 6, + }, + ); // suggestions values diff --git a/web/src/views/settings/SearchSettingsView.tsx b/web/src/views/settings/SearchSettingsView.tsx index 0bbb8a15a9..904eb980cf 100644 --- a/web/src/views/settings/SearchSettingsView.tsx +++ b/web/src/views/settings/SearchSettingsView.tsx @@ -169,7 +169,7 @@ export default function SearchSettingsView({ rel="noopener noreferrer" className="inline" > - Read the semantic search docs + Read the documentation
From 37bece341932c366089416553fda354fb9954ad3 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:06:36 -0500 Subject: [PATCH 02/10] clean up search settings view --- web/src/views/settings/SearchSettingsView.tsx | 121 +++++++++--------- 1 file changed, 64 insertions(+), 57 deletions(-) diff --git a/web/src/views/settings/SearchSettingsView.tsx b/web/src/views/settings/SearchSettingsView.tsx index 904eb980cf..ccf3a5629e 100644 --- a/web/src/views/settings/SearchSettingsView.tsx +++ b/web/src/views/settings/SearchSettingsView.tsx @@ -125,7 +125,7 @@ export default function SearchSettingsView({ if (changedValue) { addMessage( "search_settings", - `Unsaved search settings changes)`, + `Unsaved search settings changes`, undefined, "search_settings", ); @@ -151,31 +151,37 @@ export default function SearchSettingsView({ Search Settings -
-

- Semantic Search in Frigate allows you to find tracked objects within - your review items using either the image itself, a user-defined text - description, or an automatically generated one. This feature works - by creating embeddings — numerical vector representations — for both - the images and text descriptions of your tracked objects. By - comparing these embeddings, Frigate assesses their similarities to - deliver relevant search results. -

+ + + Semantic Search + +
+
+

+ Semantic Search in Frigate allows you to find tracked objects + within your review items using either the image itself, a + user-defined text description, or an automatically generated one. + This feature works by creating embeddings — numerical vector + representations — for both the images and text descriptions of + your tracked objects. By comparing these embeddings, Frigate + assesses their similarities to deliver relevant search results. +

-
- - Read the documentation - - +
+ + Read the Documentation + + +
- -
+ +
@@ -210,23 +216,24 @@ export default function SearchSettingsView({ />
-
+
-
Model Size
+
Model Size

- Configure the size of the model used for semantic search - embeddings: -

-

- • Configuring the small model employs a quantized - version of the model that uses much less RAM and runs faster - on CPU with a very negligible difference in embedding quality. -

-

- • Configuring the large model employs the full Jina - model and will automatically run on the GPU if applicable. + The size of the model used for semantic search embeddings.

+
    +
  • + Using small employs a quantized version of the + model that uses much less RAM and runs faster on CPU with a + very negligible difference in embedding quality. +
  • +
  • + Using large employs the full Jina model and will + automatically run on the GPU if applicable. +
  • +