File size: 538 Bytes
8bbd18e
79ce202
 
 
 
 
 
8bbd18e
79ce202
 
 
 
 
 
8bbd18e
 
 
 
79ce202
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
from supervision import Detections
from PIL import Image
model_path = hf_hub_download(repo_id="arnabdhar/YOLOv8-Face-Detection", filename="model.pt")
model = YOLO(model_path)


def greet(img):
    output = YOLO(img)
    results = Detections.from_ultralytics(output[0])
    print(results)
    return results

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
    
if __name__ == "__main__":
    demo.launch(show_api=False, share=True)