rathapech commited on
Commit
50a2f63
·
verified ·
1 Parent(s): c714d05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -5,9 +5,16 @@ from IPython.display import Audio as IPythonAudio
5
  itt_pipe = pipeline("image-to-text",
6
  model="Salesforce/blip-image-captioning-base")
7
 
8
-
 
 
 
 
 
 
 
9
  text = gr.Interface(
10
- fn=itt_pipe,
11
  inputs=gr.Image(label="Input image", type="pil"), outputs=gr.Image(label="Text describe the image", type="pil")
12
  )
13
  text.launch()
 
5
  itt_pipe = pipeline("image-to-text",
6
  model="Salesforce/blip-image-captioning-base")
7
 
8
+ def get_pipeline_prediction(pil_image):
9
+
10
+ pipeline_output = itt_pipe(pil_image)
11
+
12
+ processed_image = render_results_in_image(pil_image,
13
+ pipeline_output)
14
+ return processed_image
15
+
16
  text = gr.Interface(
17
+ fn=get_pipeline_prediction,
18
  inputs=gr.Image(label="Input image", type="pil"), outputs=gr.Image(label="Text describe the image", type="pil")
19
  )
20
  text.launch()