Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update state.py
Browse files
state.py
CHANGED
|
@@ -462,6 +462,22 @@ def load_demo_single(demo_path):
|
|
| 462 |
return dname
|
| 463 |
|
| 464 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
def load_demo_multi(demo_paths):
|
| 466 |
"""Register and load multiple RTTM demo files."""
|
| 467 |
for demo_path in demo_paths:
|
|
|
|
| 462 |
return dname
|
| 463 |
|
| 464 |
|
| 465 |
+
def load_demo_single_sample(sample_path):
|
| 466 |
+
"""Register and load the pre-made short RTTM demo file, then run analyze()."""
|
| 467 |
+
import time
|
| 468 |
+
dname = sample_path.split("/")[-1]
|
| 469 |
+
register_file(dname)
|
| 470 |
+
st.session_state.file_paths[dname] = sample_path
|
| 471 |
+
start_time = time.time()
|
| 472 |
+
with st.spinner("Loading Sample Demo"):
|
| 473 |
+
load_annotation_file(dname, sample_path)
|
| 474 |
+
with st.spinner("Analyzing Sample Demo Data"):
|
| 475 |
+
analyze(dname)
|
| 476 |
+
st.success(f"Took {time.time() - start_time:.1f}s to analyze the sample demo!")
|
| 477 |
+
st.session_state.select_currFile = dname
|
| 478 |
+
return dname
|
| 479 |
+
|
| 480 |
+
|
| 481 |
def load_demo_multi(demo_paths):
|
| 482 |
"""Register and load multiple RTTM demo files."""
|
| 483 |
for demo_path in demo_paths:
|