Update app.py
Browse files
app.py
CHANGED
@@ -535,17 +535,21 @@ with tab1:
|
|
535 |
with tab2:
|
536 |
st.header("Camera Snap 📷 (Dual Capture!)")
|
537 |
video_devices = get_available_video_devices()
|
538 |
-
st.subheader("
|
539 |
if not video_devices:
|
540 |
st.warning("No video devices detected! 📷 Please connect a camera.")
|
541 |
else:
|
542 |
st.write(f"Detected Video Devices: {', '.join(video_devices)}")
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
|
|
|
|
|
|
547 |
slice_count = st.number_input("Image Slice Count 🎞️", min_value=1, max_value=20, value=10, help="How many snaps to dream of? (Automation’s on vacation! 😜)")
|
548 |
video_length = st.number_input("Video Dream Length (seconds) 🎥", min_value=1, max_value=30, value=10, help="Imagine a vid this long—sadly, we’re stuck with pics for now! 😂")
|
|
|
549 |
cols = st.columns(2)
|
550 |
with cols[0]:
|
551 |
st.subheader(f"Camera 0 ({selected_cam0}) 🎬" if selected_cam0 else "Camera 0 (None Detected)")
|
|
|
535 |
with tab2:
|
536 |
st.header("Camera Snap 📷 (Dual Capture!)")
|
537 |
video_devices = get_available_video_devices()
|
538 |
+
st.subheader("Camera Settings ⚙️")
|
539 |
if not video_devices:
|
540 |
st.warning("No video devices detected! 📷 Please connect a camera.")
|
541 |
else:
|
542 |
st.write(f"Detected Video Devices: {', '.join(video_devices)}")
|
543 |
+
|
544 |
+
# Camera selection with defaults
|
545 |
+
default_cam0_index = 0 if video_devices else -1
|
546 |
+
default_cam1_index = 1 if len(video_devices) > 1 else (0 if video_devices else -1)
|
547 |
+
selected_cam0 = st.selectbox("Select Camera 0", video_devices, index=default_cam0_index, key="cam0_select")
|
548 |
+
selected_cam1 = st.selectbox("Select Camera 1", video_devices, index=default_cam1_index, key="cam1_select")
|
549 |
+
|
550 |
slice_count = st.number_input("Image Slice Count 🎞️", min_value=1, max_value=20, value=10, help="How many snaps to dream of? (Automation’s on vacation! 😜)")
|
551 |
video_length = st.number_input("Video Dream Length (seconds) 🎥", min_value=1, max_value=30, value=10, help="Imagine a vid this long—sadly, we’re stuck with pics for now! 😂")
|
552 |
+
|
553 |
cols = st.columns(2)
|
554 |
with cols[0]:
|
555 |
st.subheader(f"Camera 0 ({selected_cam0}) 🎬" if selected_cam0 else "Camera 0 (None Detected)")
|