浏览代码

Make Gym interface work with grayscale and RGB visual observations (#2192)

/develop-generalizationTraining-TrainerController
Jeffrey Shih 5 年前
当前提交
4bd384a3
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 6
      gym-unity/gym_unity/envs/unity_env.py

6
gym-unity/gym_unity/envs/unity_env.py


def _single_step(self, info):
if self.use_visual:
visual_obs = info.visual_observations
if isinstance(visual_obs, list):
visual_obs = np.array(visual_obs)
visual_obs_list.append(self._preprocess_single(obs[0, :, :, :]))
visual_obs_list.append(self._preprocess_single(obs[0]))
self.visual_obs = self._preprocess_single(visual_obs[0][0, :, :, :])
self.visual_obs = self._preprocess_single(visual_obs[0][0])
default_observation = self.visual_obs
else:

正在加载...
取消
保存