Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ from PIL import Image
|
|
| 6 |
from transformers import AutoProcessor, BlipForConditionalGeneration
|
| 7 |
|
| 8 |
# Load the pretrained processor and model
|
| 9 |
-
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-
|
| 10 |
-
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-
|
| 11 |
|
| 12 |
# Define the function to process the image and generate a caption
|
| 13 |
def caption_image(input_image: np.ndarray):
|
|
|
|
| 6 |
from transformers import AutoProcessor, BlipForConditionalGeneration
|
| 7 |
|
| 8 |
# Load the pretrained processor and model
|
| 9 |
+
processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
| 10 |
+
model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-base")
|
| 11 |
|
| 12 |
# Define the function to process the image and generate a caption
|
| 13 |
def caption_image(input_image: np.ndarray):
|