def add_object_ids(scenes):
  """Adds object ids field for input scenes.

  Args:
    scenes: List of CLEVR scene graphs

  Returns:
    scenes: Adds object_id field for the objects in the scene graph inplace
  """

  for scene_id, scene in enumerate(scenes['scenes']):
    for obj_id, _ in enumerate(scene['objects']):
      scenes['scenes'][scene_id]['objects'][obj_id]['id'] = obj_id
  return scenes