chuanenlin commited on
Commit
b537766
1 Parent(s): a9cbf7c

Update instructions

Browse files
Files changed (1) hide show
  1. whichframe.py +4 -4
whichframe.py CHANGED
@@ -97,15 +97,15 @@ st.markdown(hide_streamlit_style, unsafe_allow_html=True)
97
  ss = SessionState.get(url=None, id=None, input=None, file_name=None, video=None, video_name=None, video_frames=None, video_features=None, fps=None, mode=None, query=None, progress=1)
98
 
99
  st.title("Which Frame?")
100
- st.markdown("Search a video **semantically**. For example: Which frame has a person with sunglasses and earphones?")
101
- url = st.text_input("Link to a YouTube video (Example: https://www.youtube.com/watch?v=sxaTnm_4YMY)")
102
 
103
  N = 30
104
 
105
  device = "cuda" if torch.cuda.is_available() else "cpu"
106
  model, preprocess = openai_clip.load("ViT-B/32", device=device)
107
 
108
- if st.button("Process video (this may take a while)"):
109
  ss.progress = 1
110
  ss.video_start_time = 0
111
  if url:
@@ -124,6 +124,6 @@ if st.button("Process video (this may take a while)"):
124
  if ss.progress == 2:
125
  ss.text_query = st.text_input("Enter search query (Example: a person with sunglasses and earphones)")
126
 
127
- if st.button("Submit"):
128
  if ss.text_query is not None:
129
  text_search(ss.text_query)
 
97
  ss = SessionState.get(url=None, id=None, input=None, file_name=None, video=None, video_name=None, video_frames=None, video_features=None, fps=None, mode=None, query=None, progress=1)
98
 
99
  st.title("Which Frame?")
100
+ st.markdown("**Semantic** video search. Example: Which frame has a person 🧑 with sunglasses 🕶️ and earphones 🎧?")
101
+ url = st.text_input("Enter YouTube video URL (Example: https://www.youtube.com/watch?v=sxaTnm_4YMY)")
102
 
103
  N = 30
104
 
105
  device = "cuda" if torch.cuda.is_available() else "cpu"
106
  model, preprocess = openai_clip.load("ViT-B/32", device=device)
107
 
108
+ if st.button("Process video"):
109
  ss.progress = 1
110
  ss.video_start_time = 0
111
  if url:
 
124
  if ss.progress == 2:
125
  ss.text_query = st.text_input("Enter search query (Example: a person with sunglasses and earphones)")
126
 
127
+ if st.button("Submit query"):
128
  if ss.text_query is not None:
129
  text_search(ss.text_query)