eyad222 commited on
Commit
7a66035
·
verified ·
1 Parent(s): d6886c0

Upload 2 files

Browse files
Files changed (2) hide show
  1. ifacecheck/app.py +20 -0
  2. ifacecheck/requirements.txt +4 -0
ifacecheck/app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import face_recognition
3
+ from PIL import Image
4
+ import numpy as np
5
+
6
+ def recognize_face(uploaded_image):
7
+ image = face_recognition.load_image_file(uploaded_image)
8
+ face_locations = face_recognition.face_locations(image)
9
+ if face_locations:
10
+ return "Face detected!"
11
+ else:
12
+ return "No face detected."
13
+
14
+ iface = gr.Interface(
15
+ fn=recognize_face,
16
+ inputs=gr.Image(type="filepath"),
17
+ outputs="text"
18
+ )
19
+
20
+ iface.launch()
ifacecheck/requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ gradio
2
+ face_recognition
3
+ pillow
4
+ numpy