Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,9 @@ from PIL import Image
|
|
4 |
from ultralytics import YOLO
|
5 |
from PIL import Image
|
6 |
from ultralytics.utils.plotting import Annotator,colors
|
7 |
-
|
8 |
-
|
9 |
model = YOLO('Dental_model.pt') # Replace 'yolov8n.pt' with your model file if using a custom one
|
10 |
-
|
11 |
names=model.model.names
|
12 |
def detect_objects(image):
|
13 |
image1=image.copy()
|
@@ -29,7 +28,8 @@ description = "Upload an image to detect objects using a YOLOv8 model."
|
|
29 |
gradio_app =gr.Interface(fn=detect_objects,
|
30 |
inputs=gr.Image(type="pil"),
|
31 |
outputs=[gr.Image(type='pil', label="Dental Analysis"),
|
32 |
-
gr.Image(type='pil', label="Dental Analysis")]
|
|
|
33 |
|
34 |
if __name__=="__main__":
|
35 |
gradio_app.launch()
|
|
|
4 |
from ultralytics import YOLO
|
5 |
from PIL import Image
|
6 |
from ultralytics.utils.plotting import Annotator,colors
|
7 |
+
import glob
|
|
|
8 |
model = YOLO('Dental_model.pt') # Replace 'yolov8n.pt' with your model file if using a custom one
|
9 |
+
pic_files=glob.glob(*.jpg)
|
10 |
names=model.model.names
|
11 |
def detect_objects(image):
|
12 |
image1=image.copy()
|
|
|
28 |
gradio_app =gr.Interface(fn=detect_objects,
|
29 |
inputs=gr.Image(type="pil"),
|
30 |
outputs=[gr.Image(type='pil', label="Dental Analysis"),
|
31 |
+
gr.Image(type='pil', label="Dental Analysis")],
|
32 |
+
examples=pic_files)
|
33 |
|
34 |
if __name__=="__main__":
|
35 |
gradio_app.launch()
|