Spaces:
Sleeping
Sleeping
!pip install transformers | |
from transformers import pipeline | |
# Step 1: Load the pre-trained model | |
image_to_text_pipeline = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large") | |
# Step 2: Test the model by providing an image | |
image_path = "image.jpg" | |
generated_text = image_to_text_pipeline(image_path) | |
# Step 3: Print the generated text | |
print("Generated Text:", generated_text) | |