Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -34,8 +34,9 @@ def main():
|
|
34 |
|
35 |
|
36 |
while True:
|
37 |
-
|
38 |
-
|
|
|
39 |
if image is not None:
|
40 |
st.image(image)
|
41 |
|
@@ -52,7 +53,10 @@ def main():
|
|
52 |
st.sidebar.markdown("## Captured Images")
|
53 |
st.sidebar.markdown(sidebar_html, unsafe_allow_html=True)
|
54 |
|
55 |
-
|
|
|
|
|
|
|
56 |
|
57 |
if __name__ == "__main__":
|
58 |
main()
|
|
|
34 |
|
35 |
|
36 |
while True:
|
37 |
+
try:
|
38 |
+
image = camera_input_live()
|
39 |
+
|
40 |
if image is not None:
|
41 |
st.image(image)
|
42 |
|
|
|
53 |
st.sidebar.markdown("## Captured Images")
|
54 |
st.sidebar.markdown(sidebar_html, unsafe_allow_html=True)
|
55 |
|
56 |
+
time.sleep(0.1) # Add a short delay to reduce CPU usage
|
57 |
+
|
58 |
+
except:
|
59 |
+
st.write('.')
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
main()
|