File size: 1,107 Bytes
9a14eb7 08b5858 9a14eb7 f37d5d2 9a14eb7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import glob
import gradio as gr
from ultralytics import YOLO
model_path = "fathomnet23-comp-baseline.pt"
model = YOLO(model_path)
def run(image_path):
results = model.predict(image_path)
return results[0].plot()[:, :, ::-1] # reverse channels for gradio
title = "FathomNet2023 Competition Baseline"
description = (
"Gradio demo for the FathomNet2023 Baseline Model: Developed by researchers"
" at the Monterey Bay Aquarium Research Institute (MBARI) to serve as a"
" baseline YOLOv8m model for the FathomNet2023 Kaggle Competition, in"
" conjunction with the Fine Grained Visual Categorization workshop at CVPR"
" 2023. The training dataset comprises both the FathomNet2023 competition"
" split and internal MBARI data, including 290 fine-grained taxonomic"
" categories of benthic animals."
)
examples = glob.glob("images/*.png")
interface = gr.Interface(
run,
inputs=[gr.components.Image(type="filepath")],
outputs=gr.components.Image(type="numpy"),
title=title,
description=description,
examples=examples,
)
interface.queue().launch()
|