objectdetection / app.py
jawadrashid's picture
Create app.py
7e27a4c verified
raw
history blame
551 Bytes
import os
import gradio as gr
def get_pipeline_prediction(pil_image):
pipeline_output = od_pipe(pil_image)
processed_image = render_results_in_image(pil_image,
pipeline_output)
return processed_image
demo = gr.Interface(
fn=get_pipeline_prediction,
inputs=gr.Image(label="Input image",
type="pil"),
outputs=gr.Image(label="Output image with predicted instances",
type="pil")
)
demo.launch(share=True, server_port=int(os.environ['PORT1']))