ResizeGoalWrapper

class ResizeGoalWrapper(env, pixels_shape: tuple[int, int] = (84, 84), torchvision_transform: Callable | None = None)[source]

Bases: Wrapper

Resizes goal images in info dict with optional transforms.

Applies PIL-based resizing and optional torchvision transforms to the ‘goal’ image in info dict during both reset and step.

Parameters:
  • env – The Gymnasium environment to wrap.

  • pixels_shape – Target (height, width) for resized goal images. Defaults to (84, 84).

  • torchvision_transform – Optional transform to apply to PIL goal images.

reset(*args, **kwargs)[source]

Uses the reset() of the env that can be overwritten to change the returned data.

step(action)[source]

Uses the step() of the env that can be overwritten to change the returned data.