layout_anal / app.py
μ „μ›ν‘œ
edit app.py
e35a5a5
raw
history blame contribute delete
550 Bytes
import gradio as gr
import PIL.Image as Image
from ultralytics import YOLO
model = YOLO('./models/best.pt')
def infer(img_path):
results = model(img_path)
im_array = results[0].plot()
im = Image.fromarray(im_array[..., ::-1])
return im
article = "**이미지λ₯Ό μ—…λ‘œλ“œν•˜μ„Έμš”.**" \
demo = gr.Interface(fn=infer,
inputs=gr.Image(type="numpy", label="Input Image"),
outputs=gr.Image(type="pil", label="Result")
# examples=[image_path,]
)
demo.launch()