Namit2111 commited on
Commit
3a9e50c
β€’
1 Parent(s): 8dbe535
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import face_checker as fc
2
+ import face_extract as fe
3
+ import gradio as gr
4
+ from PIL import Image
5
+ def fun(id_img_path,selfie_img_path):
6
+ img = Image.fromarray(id_img_path,'RGB')
7
+ img.save("id.jpg")
8
+ img2 = Image.fromarray(selfie_img_path,'RGB')
9
+ img2.save("selfie.jpg")
10
+ extracted_facename = fe.extract("id.jpg")
11
+ res = fc.check(extracted_facename,'selfie.jpg')
12
+ return str(res)
13
+
14
+ interface = gr.Interface(fun,inputs=[gr.Image(),gr.Image()],outputs='text')
15
+ # Will return True or false
16
+
17
+
18
+ interface.launch()
19
+
20
+ # id_img_path ="test.jpg" #give image path
21
+ # selfie_img_path = "142142_faces.jpg" #give path of curret face