Spaces:
Sleeping
Sleeping
| import cv2 | |
| import numpy as np | |
| import gradio as gr | |
| from ultralytics import YOLO | |
| def predict(path:str): | |
| model = YOLO("yolov8s.yaml") | |
| model = YOLO("best-underwater.pt") | |
| imagen = cv2.imread(path) | |
| results = model.predict(source=path) | |
| for r in results: | |
| return r.plot() | |
| css = """ | |
| body {background-color: #ff0000;} """ | |
| gr.Interface(fn=predict, | |
| inputs=gr.components.Image(type="filepath", label="Input"), | |
| outputs=gr.components.Image(type="numpy", label="Output"), css=css).launch(debug=False) |