The files are uploaded.
Browse filesThe app.py, best.pt and requirements.txt file has been uploaded.
- app.py +18 -0
- best.pt +3 -0
- requirements.txt +4 -0
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
+
from ultralytics import YOLO
|
| 4 |
+
import cv2
|
| 5 |
+
|
| 6 |
+
# Load your YOLOv8 model
|
| 7 |
+
model = YOLO("best.pt")
|
| 8 |
+
|
| 9 |
+
# Inference function
|
| 10 |
+
def predict(image):
|
| 11 |
+
results = model(image)
|
| 12 |
+
annotated_img = results[0].plot()
|
| 13 |
+
return annotated_img
|
| 14 |
+
|
| 15 |
+
# Gradio Interface
|
| 16 |
+
iface = gr.Interface(fn=predict, inputs="image", outputs="image")
|
| 17 |
+
|
| 18 |
+
iface.launch()
|
best.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db7795aa77bec9bc6c140d7adb25e11d6d08072b6caab5a2e19bd9fb545da85d
|
| 3 |
+
size 52033803
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
ultralytics
|
| 3 |
+
opencv-python
|
| 4 |
+
torch
|