Spaces:
Running
on
Zero
Running
on
Zero
derektan
commited on
Commit
·
cfbbf4b
1
Parent(s):
f1165ca
Improved UI. Attempt to fix issue where one heatmap pane freezes when the other one has completed
Browse files- app.py +14 -4
- app_multimodal_inference.py +2 -1
app.py
CHANGED
@@ -200,6 +200,10 @@ def process_search_tta(
|
|
200 |
sent_no: set[str] = set()
|
201 |
last_tta = None
|
202 |
last_no = None
|
|
|
|
|
|
|
|
|
203 |
|
204 |
try:
|
205 |
while thread_tta.is_alive() or thread_no.is_alive():
|
@@ -221,10 +225,14 @@ def process_search_tta(
|
|
221 |
last_no = fp
|
222 |
updated = True
|
223 |
|
224 |
-
if
|
225 |
-
|
226 |
-
|
|
|
|
|
227 |
yield gr.update(interactive=False), last_tta, last_no, gr.update(value=status_tta), gr.update(value=status_no)
|
|
|
|
|
228 |
|
229 |
time.sleep(POLL_INTERVAL)
|
230 |
finally:
|
@@ -244,7 +252,9 @@ with gr.Blocks(title="Search-TTA (Simplified)", theme=gr.themes.Base()) as demo:
|
|
244 |
gr.Markdown(
|
245 |
"""
|
246 |
# Search-TTA: A Multimodal Test-Time Adaptation Framework for Visual Search in the Wild Demo
|
247 |
-
|
|
|
|
|
248 |
"""
|
249 |
)
|
250 |
# gr.Markdown(
|
|
|
200 |
sent_no: set[str] = set()
|
201 |
last_tta = None
|
202 |
last_no = None
|
203 |
+
# Track previous status strings so we can emit updates when only the
|
204 |
+
# status (Running…/Done.) changes even if no new frame was produced.
|
205 |
+
prev_status_tta = "Running…"
|
206 |
+
prev_status_no = "Running…"
|
207 |
|
208 |
try:
|
209 |
while thread_tta.is_alive() or thread_no.is_alive():
|
|
|
225 |
last_no = fp
|
226 |
updated = True
|
227 |
|
228 |
+
status_tta = "Running…" if thread_tta.is_alive() else "Done."
|
229 |
+
status_no = "Running…" if thread_no.is_alive() else "Done."
|
230 |
+
|
231 |
+
# Emit update if we have a new frame OR if the status label has changed
|
232 |
+
if updated or status_tta != prev_status_tta or status_no != prev_status_no:
|
233 |
yield gr.update(interactive=False), last_tta, last_no, gr.update(value=status_tta), gr.update(value=status_no)
|
234 |
+
prev_status_tta = status_tta
|
235 |
+
prev_status_no = status_no
|
236 |
|
237 |
time.sleep(POLL_INTERVAL)
|
238 |
finally:
|
|
|
252 |
gr.Markdown(
|
253 |
"""
|
254 |
# Search-TTA: A Multimodal Test-Time Adaptation Framework for Visual Search in the Wild Demo
|
255 |
+
Click on any of the examples below and run the demo. <br>
|
256 |
+
Note that the model initialization, RL planner, and TTA updates are not fully optimized on GPU for this huggingface demo, and hence may experience some lag during execution. We will improve this in the future. <br>
|
257 |
+
<a href="https://search-tta.github.io">Project Website</a>
|
258 |
"""
|
259 |
)
|
260 |
# gr.Markdown(
|
app_multimodal_inference.py
CHANGED
@@ -184,7 +184,8 @@ with gr.Blocks(title="Search-TTA", theme=gr.themes.Base()) as demo:
|
|
184 |
gr.Markdown(
|
185 |
"""
|
186 |
# Search-TTA: A Multimodal Test-Time Adaptation Framework for Visual Search in the Wild Demo
|
187 |
-
|
|
|
188 |
"""
|
189 |
)
|
190 |
|
|
|
184 |
gr.Markdown(
|
185 |
"""
|
186 |
# Search-TTA: A Multimodal Test-Time Adaptation Framework for Visual Search in the Wild Demo
|
187 |
+
Click on any of the examples below and run the demo. <br>
|
188 |
+
<a href="https://search-tta.github.io">Project Website</a>
|
189 |
"""
|
190 |
)
|
191 |
|