Spaces:
Sleeping
Sleeping
Add Streamlit version of the app
Browse files- streamlit_app.py +6 -3
streamlit_app.py
CHANGED
@@ -388,12 +388,15 @@ clicked_example = None
|
|
388 |
if not example_files:
|
389 |
st.warning("No example videos found in ./test_videos directory.")
|
390 |
else:
|
391 |
-
# Create columns for
|
392 |
cols = st.columns(len(example_files))
|
393 |
for i, example_file in enumerate(example_files):
|
|
|
394 |
with cols[i]:
|
395 |
-
|
396 |
-
|
|
|
|
|
397 |
# --- End Example Videos Section ---
|
398 |
|
399 |
process_button_main = st.button("Detect Mites from Uploaded Video")
|
|
|
388 |
if not example_files:
|
389 |
st.warning("No example videos found in ./test_videos directory.")
|
390 |
else:
|
391 |
+
# Create columns for examples
|
392 |
cols = st.columns(len(example_files))
|
393 |
for i, example_file in enumerate(example_files):
|
394 |
+
example_full_path = os.path.join(example_video_dir, example_file)
|
395 |
with cols[i]:
|
396 |
+
st.markdown(f"**{example_file}**") # Display filename
|
397 |
+
st.video(example_full_path) # Display the video
|
398 |
+
if st.button(f"Use Example: {example_file}", key=f"ex_{i}"): # Use unique key for buttons
|
399 |
+
clicked_example = example_full_path
|
400 |
# --- End Example Videos Section ---
|
401 |
|
402 |
process_button_main = st.button("Detect Mites from Uploaded Video")
|