Gemini Robotics ER 2 可透過兩項功能,從連續的影片串流追蹤工作進度:
- 時刻尋找:找出重要事件發生的確切時間戳記。
- 進度分類:將每部影片歸入五個完成度範圍之一 (0% 至 20%、20% 至 40%、40% 至 60%、60% 至 80%、80% 至 100%)。
尋找重要時刻
時刻發現功能可找出發生重大事件的確切影片影格,例如杯子裝滿水或打結。機器人會使用這項資訊驗證成功、序列步驟,以及觸發修正。
以下範例提示會要求模型找出影片中特定工作完成的時刻:
from google import genai
from google.genai import types
client = genai.Client()
with open("task_video.mp4", "rb") as f:
video_bytes = f.read()
prompt = """
At what timestamp (in seconds) does the task reach successful completion?
Return a JSON object: {"completion_time_seconds": <float>}.
If the task is not completed, return {"completion_time_seconds": null}.
"""
response = client.models.generate_content(
model="gemini-robotics-er-2-preview",
contents=[
types.Part.from_bytes(data=video_bytes, mime_type="video/mp4"),
prompt,
],
)
print(response.text)
以下是尋找時刻影片的範例影格,模型會識別工作完成時間戳記:
進度分類
進度分類會將影片歸入五個完成度範圍之一:0% 至 20%、20% 至 40%、40% 至 60%、60% 至 80% 或 80% 至 100%。這項功能可讓機器人即時掌握情況,因此不必重新啟動整個工作流程,就能調整動作或重試失敗的步驟。
以下範例提示會要求模型根據影片分類目前的進度等級:
from google import genai
from google.genai import types
client = genai.Client()
with open("task_video.mp4", "rb") as f:
video_bytes = f.read()
prompt = """
Watch this video and classify the task progress level at the final frame.
Return a JSON object with the progress bracket:
{"progress_level": "0-20" | "20-40" | "40-60" | "60-80" | "80-100"}.
"""
response = client.models.generate_content(
model="gemini-robotics-er-2-preview",
contents=[
types.Part.from_bytes(data=video_bytes, mime_type="video/mp4"),
prompt,
],
)
print(response.text)
下圖顯示進度分類影片的範例影格,模型會指派進度範圍:
範例
如需完整的可執行範例 (包括多步驟工作追蹤),請參閱機器人食譜。
後續步驟
- 機器人即時 API:即時雙向串流。
- 工作自動化調度管理:需要空間推理的長期工作。
- Gemini Robotics ER 總覽:模型比較和功能。