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


相关推荐
Fleshy数模4 天前
基于 ResNet18 的迁移学习:食物图像分类实现
人工智能·分类·迁移学习
輕華11 天前
迁移学习:让AI站在巨人的肩膀上
人工智能·机器学习·迁移学习
乐分启航16 天前
【无标题】
深度学习·算法·目标检测·transformer·迁移学习
Flying pigs~~17 天前
迁移学习之中文文本分类微调
深度学习·自然语言处理·迁移学习
海天一色y23 天前
基于Inception v3的CIFAR-100图像分类实战:从迁移学习到性能优化
分类·数据挖掘·迁移学习
为你奋斗!1 个月前
Playwright 录屏功能启用离线安装依赖pywin32 pillow
开发语言·chrome·python·语言模型·迁移学习
源于花海1 个月前
Applied Energy期刊论文学习——基于物理信息神经网络的锂离子电池健康状态、剩余使用寿命及短期退化路径协同估计
论文阅读·迁移学习·多任务·pinn·电池健康管理
资深web全栈开发1 个月前
迁移学习:站在巨人的肩膀上
人工智能·机器学习·迁移学习
项目申报小狂人1 个月前
基于迁移学习与丢弃法的神经网络算法在无人机失移动目标搜索中的应用,含代码
神经网络·算法·迁移学习
storyseek2 个月前
使用迁移学习来训练VGG模型
深度学习·机器学习·迁移学习