File size: 337 Bytes
6c63420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from ultralytics import YOLO
import cv2

model = YOLO("https://huggingface.co/MiguelEscamilla/id-card-yolo/resolve/main/best.pt")

def detect(image):
    results = model(image)
    return results[0].plot()

demo = gr.Interface(
    fn=detect,
    inputs=gr.Image(type="filepath"),
    outputs="image"
)

demo.launch()