edpf / app.py
Gerold Meisinger
blub
45954f3
raw
history blame
448 Bytes
import gradio as gr
import cv2
ed = cv2.ximgproc.createEdgeDrawing()
params = cv2.ximgproc.EdgeDrawing.Params()
params.PFmode = True
ed.setParams(params)
def edpf(image_rgb):
img_gray = cv2.cvtColor(image_rgb, cv2.COLOR_BGR2GRAY)
edges = ed.detectEdges(img_gray)
edge_map = ed.getEdgeImage(edges)
return edge_map
demo = gr.Interface(edpf, gr.Image(shape=(512, 512)), "image")
if __name__ == "__main__":
demo.launch()