Case-Study-1 / test_blip_image_caption_large.py
Julian-Hans's picture
updated test, included image in src instead of remote URL
05aadb6
raw
history blame
825 Bytes
from blip_image_caption_large import Blip_Image_Caption_Large
# Test the local image caption pipeline with wikipedia image
def test_blip_image_caption_local_model():
image_caption_model = Blip_Image_Caption_Large()
image_path = "data/Students_taking_computerized_exam.jpg"
result = image_caption_model.caption_image(image_path, use_local_caption=True)
assert result == "several people sitting at desks with computers in a classroom"
# Test the image caption API with wikipedia image
def test_blip_image_caption_api():
image_caption_model = Blip_Image_Caption_Large()
image_path = "data/Students_taking_computerized_exam.jpg"
result = image_caption_model.caption_image(image_path, use_local_caption=False)
assert result == "several people sitting at desks with computers in a classroom"