Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,9 +9,9 @@ from transformers import pipeline
|
|
| 9 |
|
| 10 |
# Generates a caption for the given image using a pre-trained model
|
| 11 |
def image_to_caption(image_path):
|
| 12 |
-
imgtocaption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 13 |
-
caption = imgtocaption(image_path)[0]['generated_text']
|
| 14 |
-
return caption
|
| 15 |
|
| 16 |
# Generates a story for the caption using a pre-trained model
|
| 17 |
def caption_to_story(text):
|
|
|
|
| 9 |
|
| 10 |
# Generates a caption for the given image using a pre-trained model
|
| 11 |
def image_to_caption(image_path):
|
| 12 |
+
imgtocaption = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 13 |
+
caption = imgtocaption(image_path)[0]['generated_text']
|
| 14 |
+
return caption
|
| 15 |
|
| 16 |
# Generates a story for the caption using a pre-trained model
|
| 17 |
def caption_to_story(text):
|