Update app.py
Browse files
app.py
CHANGED
|
@@ -29,10 +29,11 @@ def load_image(img_url):
|
|
| 29 |
|
| 30 |
#Open the images
|
| 31 |
#Image1=Image.open('dlaima/Multiple_Image_captioning/main/image1.jpg')
|
| 32 |
-
Image2=Image.open('https://huggingface.co/spaces/dlaima/Multiple_Image_captioning/resolve/main/image2.jpeg')
|
| 33 |
#Image3=Image.open('https://huggingface.co/spaces/dlaima/Multiple_Image_captioning/resolve/main/image3.jpeg')
|
| 34 |
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
# Gradio interface
|
| 38 |
|
|
@@ -41,7 +42,7 @@ demo = gr.Interface(
|
|
| 41 |
inputs=gr.Image(type="pil", label="Upload Image"),
|
| 42 |
outputs=gr.Textbox(label="Generated Caption"),
|
| 43 |
#examples=[Image1, Image2, Image3],
|
| 44 |
-
examples=[
|
| 45 |
title="Image Captioning App",
|
| 46 |
description=(
|
| 47 |
"Upload an image or use one of the predefined samples to generate a caption. "
|
|
|
|
| 29 |
|
| 30 |
#Open the images
|
| 31 |
#Image1=Image.open('dlaima/Multiple_Image_captioning/main/image1.jpg')
|
| 32 |
+
#Image2=Image.open('https://huggingface.co/spaces/dlaima/Multiple_Image_captioning/resolve/main/image2.jpeg')
|
| 33 |
#Image3=Image.open('https://huggingface.co/spaces/dlaima/Multiple_Image_captioning/resolve/main/image3.jpeg')
|
| 34 |
|
| 35 |
+
image_url = 'https://free-images.com/lg/9e46/white_bengal_tiger_tiger_0.jpg'
|
| 36 |
+
image = load_image(image_url)
|
| 37 |
|
| 38 |
# Gradio interface
|
| 39 |
|
|
|
|
| 42 |
inputs=gr.Image(type="pil", label="Upload Image"),
|
| 43 |
outputs=gr.Textbox(label="Generated Caption"),
|
| 44 |
#examples=[Image1, Image2, Image3],
|
| 45 |
+
examples=[Image],
|
| 46 |
title="Image Captioning App",
|
| 47 |
description=(
|
| 48 |
"Upload an image or use one of the predefined samples to generate a caption. "
|