DPL-Project / app.py
LBLong's picture
Create app.py
bf418dd verified
raw
history blame contribute delete
No virus
619 Bytes
from huggingface_hub import hf_hub_download
import cv2
import gradio as gr
from PIL import Image
import numpy as np
model_path = hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")
model = YOLO(model_path)
def detect_faces(image):
return (image_np,im)
interface = gr.Interface(
fn=detect_faces,
inputs=gr.Image(label='Upload Image'),
outputs=[gr.Image(label='Original'),gr.Image(label='Deep learning')],
title="Face Detection Deep Learning",
description="Upload an image, and the model will detect faces and draw bounding boxes around them.",
)
interface.launch()