Ubuntu
commited on
Commit
·
72875a8
1
Parent(s):
7eda1e7
added type pil
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ model = YOLO('hotspot_detector.pt')
|
|
7 |
|
8 |
def detect_hotspots(image):
|
9 |
result = model(image)
|
10 |
-
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
11 |
|
12 |
for r in result:
|
13 |
im_array = r.plot()
|
@@ -15,5 +14,5 @@ def detect_hotspots(image):
|
|
15 |
return Image.fromarray(im_array)
|
16 |
|
17 |
|
18 |
-
demo = gr.Interface(fn=detect_hotspots, inputs=gr.Image(), outputs="image", title="YOLO Object Detection")
|
19 |
demo.launch()
|
|
|
7 |
|
8 |
def detect_hotspots(image):
|
9 |
result = model(image)
|
|
|
10 |
|
11 |
for r in result:
|
12 |
im_array = r.plot()
|
|
|
14 |
return Image.fromarray(im_array)
|
15 |
|
16 |
|
17 |
+
demo = gr.Interface(fn=detect_hotspots, inputs=gr.Image(type='pil'), outputs="image", title="YOLO Object Detection")
|
18 |
demo.launch()
|