Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import BlipProcessor, BlipForConditionalGeneration
|
| 3 |
from PIL import Image
|
| 4 |
-
import torch
|
| 5 |
|
| 6 |
def generate_caption(input_image):
|
| 7 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
|
@@ -19,7 +18,6 @@ iface = gr.Interface(
|
|
| 19 |
inputs=gr.Image( type = "pil"),
|
| 20 |
outputs="text",
|
| 21 |
title="Image Captioning",
|
| 22 |
-
description="Upload an image to generate a caption."
|
| 23 |
)
|
| 24 |
|
| 25 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import BlipProcessor, BlipForConditionalGeneration
|
| 3 |
from PIL import Image
|
|
|
|
| 4 |
|
| 5 |
def generate_caption(input_image):
|
| 6 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
|
|
|
| 18 |
inputs=gr.Image( type = "pil"),
|
| 19 |
outputs="text",
|
| 20 |
title="Image Captioning",
|
|
|
|
| 21 |
)
|
| 22 |
|
| 23 |
iface.launch()
|