Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 10 |
processor = BlipProcessor.from_pretrained(
|
| 11 |
"Salesforce/blip-image-captioning-base"
|
| 12 |
)
|
|
|
|
| 13 |
model = BlipForConditionalGeneration.from_pretrained(
|
| 14 |
"Salesforce/blip-image-captioning-base"
|
| 15 |
).to(device)
|
|
@@ -32,5 +33,7 @@ interface = gr.Interface(
|
|
| 32 |
inputs=gr.Image(type="pil", label="Upload Image"),
|
| 33 |
outputs=gr.Textbox(label="Generated Caption"),
|
| 34 |
title="BLIP Image Captioning Demo",
|
| 35 |
-
description=
|
| 36 |
-
|
|
|
|
|
|
|
|
|
| 10 |
processor = BlipProcessor.from_pretrained(
|
| 11 |
"Salesforce/blip-image-captioning-base"
|
| 12 |
)
|
| 13 |
+
|
| 14 |
model = BlipForConditionalGeneration.from_pretrained(
|
| 15 |
"Salesforce/blip-image-captioning-base"
|
| 16 |
).to(device)
|
|
|
|
| 33 |
inputs=gr.Image(type="pil", label="Upload Image"),
|
| 34 |
outputs=gr.Textbox(label="Generated Caption"),
|
| 35 |
title="BLIP Image Captioning Demo",
|
| 36 |
+
description="Upload an image and BLIP will generate a natural language caption."
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
interface.launch()
|