机器人持续学习基准LIBERO系列6——获取并显示实际深度图

0.前置

1.代码基础

2.开启一个新环境

python 复制代码
env_args = {
    "bddl_file_name": os.path.join(os.path.join(get_libero_path("bddl_files"), task.problem_folder, task.bddl_file)),
    "camera_heights": 128,
    "camera_widths": 128
}

env = OffScreenRenderEnv(**env_args)
#设置种子
env.seed(0)
#环境重置
env.reset()
#初始化
env.set_init_state(init_states[0])

3.可视化两个相机的二维图并获取归一化后的深度图

python 复制代码
import numpy as np
#运动机械臂更新环境
obs, _, _, _ = env.step([0.] * 7)
#获取手外相机视角图片
agentview_image = (obs["agentview_image"])
robot0_eye_in_hand_image = (obs["robot0_eye_in_hand_image"])
agentview_depth = (obs["agentview_depth"])
robot0_eye_in_hand_depth =  (obs["robot0_eye_in_hand_depth"])
display(Image.fromarray(agentview_image))
display(Image.fromarray(robot0_eye_in_hand_image))


4.获取并可视化真实深度信息

python 复制代码
from robosuite.utils.camera_utils import get_real_depth_map
agentview_depth_real = get_real_depth_map(env.sim, agentview_depth)
robot0_eye_in_hand_depth_real = get_real_depth_map(env.sim, robot0_eye_in_hand_depth)
python 复制代码
agentview_depth_real = (agentview_depth_real.squeeze()*1000).astype(np.uint8)
robot0_eye_in_hand_depth_real = (robot0_eye_in_hand_depth_real.squeeze()*1000).astype(np.uint8) 
display(Image.fromarray(agentview_depth_real))
display(Image.fromarray(robot0_eye_in_hand_depth_real))


相关推荐
Summer_Anny4 天前
EMA与迁移学习技术的结合
人工智能·机器学习·迁移学习
qqqweiweiqq7 天前
基于PyTorch的艺术风格迁移系统:卷积神经网络与迁移学习在图像生成的应用
pytorch·cnn·迁移学习
拓端研究室TRL21 天前
Matlab深度学习ResNet、迁移学习多标签图像分类及超分辨率处理Grad CAM可视化分析COCO、手写数字数据集...
人工智能·深度学习·机器学习·分类·迁移学习
万事可爱^21 天前
深度迁移学习实战指南:从理论到产业级应用
人工智能·pytorch·深度学习·机器学习·迁移学习·tensorflow2
小圆圆66622 天前
一学就会的深度学习基础指令及操作步骤(6)迁移学习
人工智能·深度学习·卷积神经网络·迁移学习
小赖同学啊1 个月前
PyTorch 中结合迁移学习和强化学习的完整实现方案
人工智能·pytorch·迁移学习
Kai HVZ1 个月前
《深度学习》——迁移学习
人工智能·深度学习·迁移学习
panbaoran9132 个月前
【问】强学如何支持 迁移学习呢?
机器学习·迁移学习·强化学习
CP-DD2 个月前
迁移学习 Transfer Learning
人工智能·机器学习·迁移学习
深度学习实战训练营2 个月前
基于迁移学习的ResNet50模型实现石榴病害数据集多分类图片预测
人工智能·分类·迁移学习