Ubuntu
commited on
Commit
·
a376dac
1
Parent(s):
358c731
added new app version
Browse files- app.py +12 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from ultralytics import YOLO
|
3 |
|
4 |
+
model = YOLO('hotspot_detector.pt')
|
|
|
5 |
|
6 |
+
def detect_hotspots(image):
|
7 |
+
result = model(image)
|
8 |
+
|
9 |
+
for r in result:
|
10 |
+
im_array = r.plot()
|
11 |
+
# im = Image.fromarray(im_array[..., ::-1])
|
12 |
+
return im_array[..., ::-1]
|
13 |
+
|
14 |
+
|
15 |
+
demo = gr.Interface(fn=detect_hotspots, inputs=gr.Image(shape=(640, 640)), outputs="image", title="YOLO Object Detection")
|
16 |
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ultralytics
|