Spaces:
Runtime error
Runtime error
import gradio as gr | |
from pyAAMED import pyAAMED | |
import cv2 | |
title = """ | |
<h1>Arc Adjacency Matrix based Fast Ellipse Detection</h1> | |
<a href="https://github.com/Li-Zhaoxi/AAMED">Gitub</a> | |
""" | |
def detect_ellipses(img_path): | |
imgC = cv2.imread(img_path) | |
imgG = cv2.cvtColor(imgC, cv2.COLOR_BGR2GRAY) | |
aamed = pyAAMED(600, 600) | |
aamed.setParameters(3.1415926/3, 3.4, 0.77) | |
res = aamed.run_AAMED(imgG) | |
print(res) | |
return img | |
gr.Interface( | |
detect_ellipses, | |
inputs=gr.inputs.Image(label="Upload image with ellipses", type="filepath"), | |
outputs=gr.outputs.Image(label="Detected ellipses"), | |
title=title, | |
).launch() |