garage.envs.wrappers.resize module

Resize wrapper for gym.Env.

class Resize(env, width, height)[source]

Bases: gym.core.Wrapper

gym.Env wrapper for resizing frame to (width, height).

Only works with gym.spaces.Box environment with 2D single channel frames.

Example

env = gym.make(‘Env’)
# env.observation_space = (100, 100)
env_wrapped = Resize(gym.make(‘Env’), width=64, height=64)
# env.observation_space = (64, 64)
Parameters:
  • env – gym.Env to wrap.
  • width – resized frame width.
  • height – resized frame height.
Raises:

ValueError – If observation space shape is not 2 or environment is not gym.spaces.Box.

observation_space

gym.Env observation space.

reset()[source]

gym.Env reset function.

step(action)[source]

gym.Env step function.