Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,9 +30,9 @@ COLORS = [
|
|
| 30 |
|
| 31 |
|
| 32 |
def load_model():
|
| 33 |
-
"""Load pretrained
|
| 34 |
-
model = keras_cv.models.
|
| 35 |
-
"
|
| 36 |
bounding_box_format="xyxy",
|
| 37 |
)
|
| 38 |
return model
|
|
@@ -120,8 +120,8 @@ def detect_objects(image, confidence_threshold=0.5):
|
|
| 120 |
|
| 121 |
# Build the Gradio interface
|
| 122 |
with gr.Blocks(title="Keras Object Detection") as demo:
|
| 123 |
-
gr.Markdown("# Object Detection with KerasCV
|
| 124 |
-
gr.Markdown("Upload an image to detect objects using a pretrained
|
| 125 |
|
| 126 |
with gr.Row():
|
| 127 |
with gr.Column():
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
def load_model():
|
| 33 |
+
"""Load pretrained YOLOv8 model from KerasCV."""
|
| 34 |
+
model = keras_cv.models.YOLOV8Detector.from_preset(
|
| 35 |
+
"yolo_v8_m_pascalvoc",
|
| 36 |
bounding_box_format="xyxy",
|
| 37 |
)
|
| 38 |
return model
|
|
|
|
| 120 |
|
| 121 |
# Build the Gradio interface
|
| 122 |
with gr.Blocks(title="Keras Object Detection") as demo:
|
| 123 |
+
gr.Markdown("# Object Detection with KerasCV YOLOv8")
|
| 124 |
+
gr.Markdown("Upload an image to detect objects using a pretrained YOLOv8 model.")
|
| 125 |
|
| 126 |
with gr.Row():
|
| 127 |
with gr.Column():
|