Spaces:
Runtime error
Runtime error
from subprocess import Popen, PIPE, STDOUT, check_output | |
import gradio as gr | |
def run(input_image): | |
output = check_output(["chmod", "a+x", "bin/detect-image"]) | |
cmd = 'bin/detect-image' | |
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) | |
return p.stdout.read() | |
gr.Interface( | |
fn=run, | |
inputs=gr.Image(type="pil", label="Input Image"), | |
outputs=gr.Textbox(), | |
).launch() | |