Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
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()
|