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


相关推荐
中國龍在廣州11 小时前
“物理AI”吹响号角
大数据·人工智能·深度学习·算法·机器人·机器人学习
子夜江寒1 天前
了解 PyTorch 学习率调整和迁移学习
pytorch·学习·迁移学习
中國龍在廣州7 天前
谈谈2025年人工智能现状及发展趋势分析
人工智能·深度学习·算法·自然语言处理·chatgpt·机器人·机器人学习
童话名剑7 天前
迁移学习示例 和 数据增强(吴恩达深度学习笔记)
笔记·深度学习·数据增强·迁移学习
噜~噜~噜~11 天前
D-CBRS(Diverse Class-Balancing Reservoir Sampling )的个人理解
人工智能·深度学习·持续学习·cbrs·d-cbrs
其美杰布-富贵-李11 天前
迁移学习与对抗迁移学习
人工智能·机器学习·迁移学习
羞儿16 天前
【读点论文】Few-Shot Object Detection A Comprehensive Survey元学习和迁移学习
目标检测·迁移学习·元学习·小样本学习
Wis4e19 天前
基于PyTorch的深度学习——迁移学习3
人工智能·深度学习·迁移学习
Wis4e19 天前
基于PyTorch的深度学习——迁移学习4
pytorch·深度学习·迁移学习
Wis4e19 天前
基于PyTorch的深度学习——迁移学习2
pytorch·深度学习·迁移学习