class_docstr: Pixel observation wrapper for obtaining pixel observations.
  
  Instead of returning the default environment observation, the wrapped
  environment's render function is used to produce RGB pixel observations.
  
  This behaves like gym.wrappers.PixelObservationWrapper but returns a
  gym.spaces.Box observation space and observation instead of
  a gym.spaces.Dict.
  
  Args:
      env (gym.Env): The environment to wrap. This environment must produce
          non-pixel observations and have a Box observation space.
      headless (bool): If true, this creates a window to init GLFW. Set to
          true if running on a headless machine or with a dummy X server,
          false otherwise.
code: def __init__(self, env, headless=True):
      if headless:
          # pylint: disable=import-outside-toplevel
          # this import fails without a valid mujoco license
          # so keep this here to avoid unecessarily requiring
          # a mujoco license everytime the wrappers package is
          # accessed.
          from mujoco_py import GlfwContext
  
          GlfwContext(offscreen=True)
      env.reset()
      env = gymWrapper(env)
      super().__init__(env)
      self._observation_space = env.observation_space["pixels"]
  
file_path: garage/src/garage/envs/wrappers/pixel_observation.py
imports: import gym
  from gym.wrappers.pixel_observation import PixelObservationWrapper
label_desc: Use image node_id 1 to create a new PixelObservationWrapper object from inherited base classes: gym with example: obj = PixelObservationWrapper(env, headless)