NTAMBARA Etienne commited on
Commit
ee14dad
1 Parent(s): 348c3ba

Changes Made Keys Final

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -64,22 +64,16 @@ def recognize_face(input_image):
64
  # Convert back to PIL Image
65
  pil_img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
66
  return pil_img, results
67
- # Define a function to handle webcam images
68
- def process_webcam_image(image):
69
- # Convert the base64 image to a format that can be processed
70
- # Process the image through the face recognition function
71
- return recognize_face(image)
72
  # Gradio interface
73
  iface = gr.Interface(
74
  fn=recognize_face,
75
- inputs=gr.Image(tool="editor", source="webcam"),
76
- outputs=[
77
- gr.Image(),
78
- gr.JSON(label="Student Information")
79
- ],
80
- title="Real-time Face Recognition Attendance System",
81
- description="Activate your webcam and take a photo to check attendance."
82
  )
83
 
84
  if __name__ == "__main__":
85
- iface.launch()
 
64
  # Convert back to PIL Image
65
  pil_img = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
66
  return pil_img, results
67
+
68
+
 
 
 
69
  # Gradio interface
70
  iface = gr.Interface(
71
  fn=recognize_face,
72
+ inputs=gr.Image(type="pil"),
73
+ outputs=[gr.Image(type="pil"), gr.JSON(label="Student Information")],
74
+ title="Face Recognition Attendance System",
75
+ description="Upload an image to identify individuals."
 
 
 
76
  )
77
 
78
  if __name__ == "__main__":
79
+ iface.launch(debug=True,inline=False)