File size: 770 Bytes
192a99b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Import and initialize the handler
from handler import EndpointHandler
# Initialize the handler
my_handler = EndpointHandler()
# Sample payload for conditional captioning
conditional_payload = {
"image_url": "https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg",
"prompt": "a photography of"
}
# Sample payload for unconditional captioning
unconditional_payload = {
"image_url": "https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg"
}
# Run the handler for both cases and print the outputs
conditional_caption = my_handler(conditional_payload)
unconditional_caption = my_handler(unconditional_payload)
print("Conditional Caption:", conditional_caption)
print("Unconditional Caption:", unconditional_caption)
|