#IMPORTANT PART ONLY #!pip install deepface import gradio as gr from deepface import DeepFace #from google.colab import drive #drive.mount('/content/drive') #img1_path = '/content/drive/My Drive/Colab Notebooks/DeepLearning/FaceRecognition/PhotoDataSet/10Jan_1.jpeg' import zipfile with zipfile.ZipFile("PhotoDataSet.zip","r") as zip_ref: zip_ref.extractall("db_path") #db_path='/content/drive/My Drive/Colab Notebooks/DeepLearning/FaceRecognition/PhotoDataSet/' import pandas as pd def get_deepface(image): df = DeepFace.find(img_path=image, db_path=db_path) #print(df.head()) return DeepFace.analyze(img_path=img1_path)) description = "Deepface is a lightweight face recognition and facial attribute analysis (age, gender, emotion and race) framework for python. It is a hybrid face recognition framework wrapping state-of-the-art models: VGG-Face, Google FaceNet, OpenFace, Facebook DeepFace, DeepID, ArcFace and Dlib." facial_attribute_demo = gr.Interface( fn=process_document, inputs="image", outputs="json", title="face recognition and facial attribute analysis (age, gender, emotion and race) framework", description=description, enable_queue=True, examples=[["10Jan_1.jpeg"]], cache_examples=False) facial_attribute_demo .launch()