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


相关推荐
Kai HVZ5 天前
《深度学习》——迁移学习
人工智能·深度学习·迁移学习
panbaoran91311 天前
【问】强学如何支持 迁移学习呢?
机器学习·迁移学习·强化学习
CP-DD14 天前
迁移学习 Transfer Learning
人工智能·机器学习·迁移学习
深度学习实战训练营1 个月前
基于迁移学习的ResNet50模型实现石榴病害数据集多分类图片预测
人工智能·分类·迁移学习
QQ_7781329741 个月前
Python从0到100(八十五):神经网络与迁移学习在猫狗分类中的应用
机器学习·迁移学习
是Dream呀1 个月前
Python从0到100(八十五):神经网络-使用迁移学习完成猫狗分类
python·神经网络·迁移学习
risc1234561 个月前
【无标题】微调是迁移学习吗?
深度学习·迁移学习
KeyPan1 个月前
【机器学习:三十三(一)、支持向量机】
人工智能·神经网络·算法·机器学习·支持向量机·数据挖掘·迁移学习
听风吹等浪起1 个月前
第9章:基于Vision Transformer(ViT)网络实现的迁移学习图像分类任务:早期秧苗图像识别
分类·transformer·迁移学习
SpikeKing1 个月前
LLM - 大模型 ScallingLaws 的迁移学习与混合训练(PLM) 教程(3)
人工智能·llm·迁移学习·plm·scalinglaws·混合训练