Пространственное мышление

Роботы Gemini Robotics ER способны указывать на объекты, отслеживать их на видео, обнаруживать их с помощью ограничивающих рамок и генерировать траектории движения.

Полный рабочий код можно найти в руководстве по робототехнике .

Укажите на объекты

В следующем примере осуществляется поиск конкретных объектов на изображении и возвращается их нормализованная координата [y, x] :

Python

from google import genai

PROMPT = """
          Point to no more than 10 items in the image. The label returned
          should be an identifying name for the object detected.
          The answer should follow the json format: [{"point": <point>,
          "label": <label1>}, ...]. The points are in [y, x] format
          normalized to 0-1000.
        """
client = genai.Client()

uploaded_file = client.files.upload(file="my-image.png")

image_response = client.interactions.create(
    model="gemini-robotics-er-2-preview",
    input=[
        {
            "type": "image",
            "uri": uploaded_file.uri,
            "mime_type": uploaded_file.mime_type
        },
        {"type": "text", "text": PROMPT}
    ],