abcdef12356 commited on
Commit
f259229
·
1 Parent(s): 67f946e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -1,5 +1,16 @@
1
  import streamlit as st
2
  import time
 
 
 
 
 
 
 
 
 
 
 
3
  while True:
4
- st.image(st.camera_input("First, take a picture..."))
5
- time.sleep(10)
 
1
  import streamlit as st
2
  import time
3
+
4
+ # Capture a photo using the camera input
5
+ picture = st.camera_input("Take a picture...")
6
+
7
+ if picture:
8
+ # Save the picture to a file (e.g., test.jpg)
9
+ with open('test.jpg', 'wb') as file:
10
+ file.write(picture.getbuffer())
11
+ st.image(picture, caption="Captured Photo", use_column_width=True)
12
+
13
+ # Display the photo every 10 seconds
14
  while True:
15
+ time.sleep(10)
16
+ st.image(picture, caption="Captured Photo", use_column_width=True)