Spaces:
Runtime error
Runtime error
recompile
Browse files
app.py
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
from subprocess import Popen, PIPE, STDOUT, check_output
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
def run(input_image):
|
| 5 |
output = check_output(["chmod", "a+x", "bin/detect-image"])
|
| 6 |
-
cmd = 'bin/detect-image'
|
| 7 |
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
| 8 |
return p.stdout.read()
|
| 9 |
|
| 10 |
gr.Interface(
|
| 11 |
fn=run,
|
| 12 |
-
inputs=gr.Image(type="
|
| 13 |
outputs=gr.Textbox(),
|
| 14 |
).launch()
|
|
|
|
| 1 |
from subprocess import Popen, PIPE, STDOUT, check_output
|
| 2 |
+
import tempfile
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
def run(input_image):
|
| 6 |
output = check_output(["chmod", "a+x", "bin/detect-image"])
|
| 7 |
+
cmd = 'bin/detect-image ' + input_image
|
| 8 |
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
| 9 |
return p.stdout.read()
|
| 10 |
|
| 11 |
gr.Interface(
|
| 12 |
fn=run,
|
| 13 |
+
inputs=gr.Image(type="filepath", label="Input Image"),
|
| 14 |
outputs=gr.Textbox(),
|
| 15 |
).launch()
|