|
import face_checker as fc |
|
import face_extract as fe |
|
import gradio as gr |
|
from PIL import Image |
|
import easyocr |
|
import ocr as o |
|
reader = easyocr.Reader(['en']) |
|
def fun(id_img_path,selfie_img_path): |
|
res = False |
|
img = Image.fromarray(id_img_path,'RGB') |
|
img.save("id.jpg") |
|
img2 = Image.fromarray(selfie_img_path,'RGB') |
|
img2.save("selfie.jpg") |
|
r = o.ocr("id.jpg",reader) |
|
if r: |
|
extracted_facename = fe.extract("id.jpg") |
|
res = fc.check(extracted_facename,'selfie.jpg') |
|
return str(res) |
|
|
|
interface = gr.Interface(fun,inputs=[gr.Image(),gr.Image()],outputs='text') |
|
|
|
|
|
|
|
interface.launch() |
|
|
|
|
|
|