Spaces:
Runtime error
Runtime error
sradc
commited on
Commit
•
cd44e6d
1
Parent(s):
7453c0d
return more frames
Browse files
video_semantic_search/app.py
CHANGED
@@ -10,6 +10,8 @@ import streamlit as st
|
|
10 |
|
11 |
from pipeline import clip_wrapper
|
12 |
|
|
|
|
|
13 |
|
14 |
class SemanticSearcher:
|
15 |
def __init__(self, dataset: pd.DataFrame):
|
@@ -22,7 +24,7 @@ class SemanticSearcher:
|
|
22 |
|
23 |
def search(self, query: str) -> list["SearchResult"]:
|
24 |
v = self.embedder([query]).detach().numpy()
|
25 |
-
D, I = self.index.search(v,
|
26 |
return [
|
27 |
SearchResult(
|
28 |
video_id=row["video_id"],
|
|
|
10 |
|
11 |
from pipeline import clip_wrapper
|
12 |
|
13 |
+
NUM_FRAMES_TO_RETURN = 21
|
14 |
+
|
15 |
|
16 |
class SemanticSearcher:
|
17 |
def __init__(self, dataset: pd.DataFrame):
|
|
|
24 |
|
25 |
def search(self, query: str) -> list["SearchResult"]:
|
26 |
v = self.embedder([query]).detach().numpy()
|
27 |
+
D, I = self.index.search(v, NUM_FRAMES_TO_RETURN)
|
28 |
return [
|
29 |
SearchResult(
|
30 |
video_id=row["video_id"],
|