Spaces:
Build error
Build error
Commit ·
f259229
1
Parent(s): 67f946e
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,16 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
while True:
|
| 4 |
-
|
| 5 |
-
|
|
|
|
| 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)
|