BananaCircuit commited on
Commit
6c63420
·
verified ·
1 Parent(s): fefdb07

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from ultralytics import YOLO
3
+ import cv2
4
+
5
+ model = YOLO("https://huggingface.co/MiguelEscamilla/id-card-yolo/resolve/main/best.pt")
6
+
7
+ def detect(image):
8
+ results = model(image)
9
+ return results[0].plot()
10
+
11
+ demo = gr.Interface(
12
+ fn=detect,
13
+ inputs=gr.Image(type="filepath"),
14
+ outputs="image"
15
+ )
16
+
17
+ demo.launch()