awacke1 commited on
Commit
e37b28b
1 Parent(s): 57034fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -18,13 +18,16 @@ def save_image(image):
18
 
19
  return filename
20
 
 
 
 
21
  def main():
22
  st.title("Streamlit Camera Input Live Demo")
23
  st.header("Try holding a QR code in front of your webcam")
24
 
25
  # Sidebar for captured images
26
  st.sidebar.markdown("## Captured Images")
27
- captured_images = []
28
 
29
  # Initialize session state
30
  if 'last_captured' not in st.session_state:
@@ -44,7 +47,7 @@ def main():
44
 
45
  # Update sidebar
46
  for img_file in captured_images:
47
- st.sidebar.markdown(f"- [{img_file}](./{img_file})")
48
 
49
  # QR Code Detection
50
  detector = cv2.QRCodeDetector()
 
18
 
19
  return filename
20
 
21
+ def list_png_files():
22
+ return [f for f in os.listdir('.') if f.endswith('.png')]
23
+
24
  def main():
25
  st.title("Streamlit Camera Input Live Demo")
26
  st.header("Try holding a QR code in front of your webcam")
27
 
28
  # Sidebar for captured images
29
  st.sidebar.markdown("## Captured Images")
30
+ captured_images = list_png_files()
31
 
32
  # Initialize session state
33
  if 'last_captured' not in st.session_state:
 
47
 
48
  # Update sidebar
49
  for img_file in captured_images:
50
+ st.sidebar.markdown(f"- [{img_file}](your_base_url/{img_file})")
51
 
52
  # QR Code Detection
53
  detector = cv2.QRCodeDetector()