File size: 735 Bytes
03e6add
 
c21a752
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
03e6add
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr

#def image_classifier(inp):
#    return {'cat': 0.3, 'dog': 0.7}

def get_pipeline_prediction(pil_image):
    # first get the pipeline output given the pil image
    pipeline_output = od_pipe(pil_image)

    #Then process the image using the pipeline output
    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 = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
demo.launch()