机器人持续学习基准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))


相关推荐
storyseek5 天前
使用迁移学习来训练VGG模型
深度学习·机器学习·迁移学习
天使Di María6 天前
脑电大模型系列——第二弹:BrainBERT
人工智能·深度学习·机器学习·大模型·迁移学习·脑机接口·脑电解码
Testopia10 天前
垃圾分类识别:迁移学习在环保领域的应用
分类·数据挖掘·ai编程·迁移学习·#人工智能学习
海天一色y13 天前
使用BEiT模型进行CIFAR-100图像分类:迁移学习实战指南
分类·数据挖掘·迁移学习
源于花海1 个月前
迁移学习简明手册——迁移学习相关资源汇总
人工智能·机器学习·迁移学习
源于花海1 个月前
迁移学习简明手册——迁移学习相关研究学者
人工智能·机器学习·迁移学习·研究学者
源于花海1 个月前
深度迁移学习:深度对抗网络迁移(三种核心方法)
人工智能·机器学习·迁移学习·深度迁移学习·深度对抗网络
源于花海1 个月前
迁移学习相关的期刊和会议
人工智能·机器学习·迁移学习·期刊会议
源于花海1 个月前
迁移学习的前沿知识(AI与人类经验结合、传递式、终身、在线、强化、可解释性等)
人工智能·机器学习·迁移学习·迁移学习前沿
Allen_LVyingbo1 个月前
32B多模态医疗大模型预训练:端到端工程化
人工智能·分类·知识图谱·健康医疗·迁移学习