Package vision_models (1.56.0)

API documentation forvision_models package.

Classes

Image

Image.

ImageCaptioningModel

Generates captions from image.

Examples::

model = ImageCaptioningModel.from_pretrained("imagetext@001")image = Image.load_from_file("image.png")captions = model.get_captions(    image=image,    # Optional:    number_of_results=1,    language="en",)

ImageQnAModel

Answers questions about an image.

Examples::

model = ImageQnAModel.from_pretrained("imagetext@001")image = Image.load_from_file("image.png")answers = model.ask_question(    image=image,    question="What color is the car in this image?",    # Optional:    number_of_results=1,)

ImageTextModel

Generates text from images.

Examples::

model = ImageTextModel.from_pretrained("imagetext@001")image = Image.load_from_file("image.png")captions = model.get_captions(    image=image,    # Optional:    number_of_results=1,    language="en",)answers = model.ask_question(    image=image,    question="What color is the car in this image?",    # Optional:    number_of_results=1,)

MultiModalEmbeddingModel

Generates embedding vectors from images and videos.

Examples::

model = MultiModalEmbeddingModel.from_pretrained("multimodalembedding@001")image = Image.load_from_file("image.png")video = Video.load_from_file("video.mp4")embeddings = model.get_embeddings(    image=image,    video=video,    contextual_text="Hello world",)image_embedding = embeddings.image_embeddingvideo_embeddings = embeddings.video_embeddingstext_embedding = embeddings.text_embedding

MultiModalEmbeddingResponse

The multimodal embedding response.

Video

Video.

VideoEmbedding

Embeddings generated from video with offset times.

VideoSegmentConfig

The specific video segments (in seconds) the embeddings are generated for.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.