Spaces:
Build error
Build error
| import gradio as gr | |
| import face_recognition | |
| from PIL import Image | |
| import numpy as np | |
| def recognize_face(uploaded_image): | |
| image = face_recognition.load_image_file(uploaded_image) | |
| face_locations = face_recognition.face_locations(image) | |
| if face_locations: | |
| return "Face detected!" | |
| else: | |
| return "No face detected." | |
| iface = gr.Interface( | |
| fn=recognize_face, | |
| inputs=gr.Image(type="filepath"), | |
| outputs="text" | |
| ) | |
| iface.launch() | |