Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import cv2
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
def predict(image):
|
| 6 |
+
result =model.predict(source =image,imgsz = 640, conf = 0.25)
|
| 7 |
+
annotated_image =result[0].plot()
|
| 8 |
+
annotated_image[:, :, ::-1]
|
| 9 |
+
return annotated_image
|
| 10 |
+
|
| 11 |
+
app = gr.Interface(
|
| 12 |
+
fn = predict,
|
| 13 |
+
inputs = gr.Image(type = "numpy", label ="Upload an Image"),
|
| 14 |
+
outputs = gr.Image(type = "numpy", label ="Detect a Tooth Cavity"),
|
| 15 |
+
title = "Tooth Cavity Detection Using YOLO V10 made by Pulastya 😎",
|
| 16 |
+
description = "Upload an Image ant eh YOLO V10 model will detect and Annotate the Tooth Decay"
|
| 17 |
+
)
|
| 18 |
+
app.launch()
|