Spaces:
Runtime error
Runtime error
jawadrashid
commited on
Commit
•
7e27a4c
1
Parent(s):
0eb715d
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def get_pipeline_prediction(pil_image):
|
5 |
+
|
6 |
+
pipeline_output = od_pipe(pil_image)
|
7 |
+
|
8 |
+
processed_image = render_results_in_image(pil_image,
|
9 |
+
pipeline_output)
|
10 |
+
return processed_image
|
11 |
+
|
12 |
+
demo = gr.Interface(
|
13 |
+
fn=get_pipeline_prediction,
|
14 |
+
inputs=gr.Image(label="Input image",
|
15 |
+
type="pil"),
|
16 |
+
outputs=gr.Image(label="Output image with predicted instances",
|
17 |
+
type="pil")
|
18 |
+
)
|
19 |
+
|
20 |
+
demo.launch(share=True, server_port=int(os.environ['PORT1']))
|