ArchiMathur commited on
Commit
5e281e2
·
verified ·
1 Parent(s): e920ad7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -181,8 +181,8 @@ with gr.Blocks(title="Attendance System") as app:
181
 
182
  with gr.Row():
183
  with gr.Column(scale=2):
184
- # Use Gradio's webcam component which captures on the client side
185
- input_image = gr.Image(source="webcam", label="Webcam Feed")
186
  process_button = gr.Button("Process Image")
187
  output_image = gr.Image(label="Processed Feed")
188
  status_text = gr.Textbox(label="Status", value="Capture an image and click 'Process Image'")
@@ -222,7 +222,7 @@ with gr.Blocks(title="Attendance System") as app:
222
 
223
  # Create a requirements.txt file for Hugging Face
224
  with open('requirements.txt', 'w') as f:
225
- f.write('opencv-python-headless\npandas\ngradio\nultralytics')
226
 
227
  # Launch the app
228
  if __name__ == "__main__":
 
181
 
182
  with gr.Row():
183
  with gr.Column(scale=2):
184
+ # Fixed: Use sources instead of source for the webcam component
185
+ input_image = gr.Image(label="Webcam Feed", sources=["webcam"])
186
  process_button = gr.Button("Process Image")
187
  output_image = gr.Image(label="Processed Feed")
188
  status_text = gr.Textbox(label="Status", value="Capture an image and click 'Process Image'")
 
222
 
223
  # Create a requirements.txt file for Hugging Face
224
  with open('requirements.txt', 'w') as f:
225
+ f.write('opencv-python-headless\npandas\ngradio>=3.32.0\nultralytics')
226
 
227
  # Launch the app
228
  if __name__ == "__main__":