Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,7 @@ from ultralytics import YOLO
|
|
6 |
model = YOLO("best (1).pt")
|
7 |
|
8 |
def detect(image):
|
9 |
-
|
10 |
-
Runs object detection on the input image.
|
11 |
-
|
12 |
-
Args:
|
13 |
-
image: A numpy array representing the input image.
|
14 |
-
|
15 |
-
Returns:
|
16 |
-
Annotated image as a numpy array.
|
17 |
-
"""
|
18 |
# Run inference
|
19 |
results = model(image)
|
20 |
|
@@ -27,8 +19,9 @@ iface = gr.Interface(
|
|
27 |
fn=detect,
|
28 |
inputs=gr.Image(type="numpy", label="Input Image"),
|
29 |
outputs=gr.Image(type="numpy", label="Detection Output"),
|
30 |
-
title="
|
31 |
-
description="Upload an image and the model will detect
|
|
|
32 |
)
|
33 |
|
34 |
# Launch the interface (Hugging Face Spaces will automatically run the app)
|
|
|
6 |
model = YOLO("best (1).pt")
|
7 |
|
8 |
def detect(image):
|
9 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# Run inference
|
11 |
results = model(image)
|
12 |
|
|
|
19 |
fn=detect,
|
20 |
inputs=gr.Image(type="numpy", label="Input Image"),
|
21 |
outputs=gr.Image(type="numpy", label="Detection Output"),
|
22 |
+
title="Solar Panel Detection",
|
23 |
+
description="Upload an image, and the model will detect the Solar Panels.",
|
24 |
+
examples=["Aumkeshchy2003/Solar_Panel_detection", "solarpanels_native_3__x0_10924_y0_9818_dxdy_416.jpg"]
|
25 |
)
|
26 |
|
27 |
# Launch the interface (Hugging Face Spaces will automatically run the app)
|