Spaces:
Runtime error
Runtime error
sradc
commited on
Commit
•
b4233e1
1
Parent(s):
bac9ad8
log hash of query (so we can distuingish between queries, while preserving privacy)
Browse files
video_semantic_search/app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import base64
|
|
|
2 |
import os
|
3 |
import subprocess
|
4 |
from dataclasses import dataclass
|
@@ -8,11 +9,13 @@ import faiss
|
|
8 |
import numpy as np
|
9 |
import pandas as pd
|
10 |
import streamlit as st
|
|
|
11 |
|
12 |
from pipeline import clip_wrapper
|
13 |
from pipeline.process_videos import DATAFRAME_PATH
|
14 |
|
15 |
NUM_FRAMES_TO_RETURN = 21
|
|
|
16 |
|
17 |
|
18 |
class SemanticSearcher:
|
@@ -123,6 +126,7 @@ def main():
|
|
123 |
)
|
124 |
query = st.session_state["query"]
|
125 |
if query:
|
|
|
126 |
st.text("Click image to open video")
|
127 |
display_search_results(searcher.search(query))
|
128 |
st.text(f"Build: {get_git_hash()[0:7]}")
|
|
|
1 |
import base64
|
2 |
+
import hashlib
|
3 |
import os
|
4 |
import subprocess
|
5 |
from dataclasses import dataclass
|
|
|
9 |
import numpy as np
|
10 |
import pandas as pd
|
11 |
import streamlit as st
|
12 |
+
from streamlit.logger import get_logger
|
13 |
|
14 |
from pipeline import clip_wrapper
|
15 |
from pipeline.process_videos import DATAFRAME_PATH
|
16 |
|
17 |
NUM_FRAMES_TO_RETURN = 21
|
18 |
+
logger = get_logger(__name__)
|
19 |
|
20 |
|
21 |
class SemanticSearcher:
|
|
|
126 |
)
|
127 |
query = st.session_state["query"]
|
128 |
if query:
|
129 |
+
logger.info(f"Recieved query... {hashlib.md5(query.encode()).hexdigest()}")
|
130 |
st.text("Click image to open video")
|
131 |
display_search_results(searcher.search(query))
|
132 |
st.text(f"Build: {get_git_hash()[0:7]}")
|