code: def augment_observation(
      observation, reward, cum_reward, frame_index, bar_color=None,
      header_height=27
  ):
    
    img = PIL_Image().new(
        "RGB", (observation.shape[1], header_height,)
    )
    draw = PIL_ImageDraw().Draw(img)
    draw.text(
        (1, 0), "c:{:3}, r:{:3}".format(int(cum_reward), int(reward)),
        fill=(255, 0, 0)
    )
    draw.text(
        (1, 15), "f:{:3}".format(int(frame_index)),
        fill=(255, 0, 0)
    )
    header = np.copy(np.asarray(img))
    del img
    if bar_color is not None:
      header[0, :, :] = bar_color
    return np.concatenate([header, observation], axis=0)
docs: Augments an observation with debug info.