human_feedback.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:human-rl 作者: gsastry 项目源码 文件源码
def decorate_img_for_env(img, env_id, image_scale):
    """
    Args:
        img (numpy array of (width, height, 3)): input image
        env_id (str): the gym env id
        image_scale (float): a scale to resize the image

    Returns:
        an image

    Summary:
        Adds environment specific image decorations. Currently used to make it easier to
        block/label in Pong.

    """
    if env_id is not None and 'Pong' in env_id:
        h, w, _ = img.shape
        est_catastrophe_y = h - 142
        est_block_clearance_y = est_catastrophe_y - int(20 * image_scale)
        # cv2.line(img, (0, est_catastrophe_y), (int(500 * image_scale), est_catastrophe_y), (0, 0, 255))
        cv2.line(img, (250, est_catastrophe_y), (int(500 * image_scale), est_catastrophe_y), (0, 255, 255))
        # cv2.line(img, (0, est_block_clearance_y), (int(500 * image_scale), est_block_clearance_y),
        #          (255, 0, 0))
    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号