2.0.0 (latest) 1.159.0 1.158.0 1.157.0 1.156.0 1.155.0 1.154.0 API documentation for `vision_models` package.

## Classes

### [GeneratedImage](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.GeneratedImage)

Generated image.

### [Image](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.Image)

Image.

### [ImageCaptioningModel](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.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",
    )

### [ImageGenerationModel](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.ImageGenerationModel)

Generates images from text prompt.

Examples::

    model = ImageGenerationModel.from_pretrained("imagegeneration@002")
    response = model.generate_images(
        prompt="Astronaut riding a horse",
        # Optional:
        number_of_images=1,
        seed=0,
    )
    response[0].show()
    response[0].save("image1.png")

### [ImageGenerationResponse](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.ImageGenerationResponse)

Image generation response.

### [ImageQnAModel](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.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](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.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](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.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_embedding
    video_embeddings = embeddings.video_embeddings
    text_embedding = embeddings.text_embedding

### [MultiModalEmbeddingResponse](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.MultiModalEmbeddingResponse)

The multimodal embedding response.

### [Video](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.Video)

Video.

### [VideoEmbedding](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.VideoEmbedding)

Embeddings generated from video with offset times.

### [VideoSegmentConfig](https://docs.cloud.google.com/python/docs/reference/agentplatform/latest/vertexai.vision_models.VideoSegmentConfig)

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