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


相关推荐
苏苏susuus10 天前
NLP:迁移学习基础讲解
人工智能·自然语言处理·迁移学习
苏苏susuus10 天前
NLP:迁移学习关于领域自适应的基础讲解
人工智能·自然语言处理·迁移学习
爱吃奶酪的松鼠丶12 天前
图像分类模型 传统训练VS迁移学习训练
分类·数据挖掘·迁移学习
Mitty_Li14 天前
食品分类的代码复习(无半监督部分,无迁移学习部分)
分类·数据挖掘·迁移学习
铁手飞鹰15 天前
从零复现论文:深度学习域适应1
linux·pytorch·python·深度学习·ubuntu·ai·迁移学习
加油20191 个月前
机器学习vs人类学习:人类学习如何借鉴机器学习方法?
人工智能·机器学习·迁移学习·费曼学习法·学习金子塔·西曼学习法·斯科特扬学习法
大千AI助手1 个月前
灾难性遗忘:神经网络持续学习的核心挑战与解决方案
人工智能·深度学习·神经网络·大模型·llm·持续学习·灾难性遗忘
Loving_enjoy1 个月前
YOLOv11改进大全:从卷积层到检测头,全方位提升目标检测性能
经验分享·机器学习·迁移学习·facebook
九章云极AladdinEdu1 个月前
Kubernetes设备插件开发实战:实现GPU拓扑感知调度
人工智能·机器学习·云原生·容器·kubernetes·迁移学习·gpu算力
小王爱学人工智能1 个月前
快速了解迁移学习
人工智能·机器学习·迁移学习