garage.envs.wrappers.grayscale module¶
Grayscale wrapper for gym.Env.
-
class
Grayscale
(env)[source]¶ Bases:
gym.core.Wrapper
Grayscale wrapper for gym.Env, converting frames to grayscale.
Only works with gym.spaces.Box environment with 2D RGB frames. The last dimension (RGB) of environment observation space will be removed.
Example
env = gym.make(‘Env’) # env.observation_space = (100, 100, 3)
env_wrapped = Grayscale(gym.make(‘Env’)) # env.observation_space = (100, 100)
Parameters: env – gym.Env to wrap. Raises: ValueError
– If observation space shape is not 3 or environment is not gym.spaces.Box.-
observation_space
¶ gym.Env observation space.
-