Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

ryanrudes/colabgymrender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository has been archived (read below)

Due to breaking changes released in the introduction of gymnasium, I have taken a similar route to continue support and avoid confusion, hereby moving all future code maintenance to a newly named repository. See renderlab for details.

Gym Rendering for Colab

PyPI download month PyPI - Status PyPI GitHub Open In Colab

Installation

apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1
pip install -U colabgymrender
pip install imageio==2.4.1
pip install --upgrade AutoROM
AutoROM --accept-license
pip install gym[atari,accept-rom-license]

Usage

import gym
from colabgymrender.recorder import Recorder

env = gym.make("Breakout-v0")
directory = './video'
env = Recorder(env, directory)

observation = env.reset()
terminal = False
while not terminal:
  action = env.action_space.sample()
  observation, reward, terminal, info = env.step(action)

env.play()

Demo

Watch it on YouTube

Colab.Gym.Rendering.Demo.mp4
Breakout.Demo.mp4
CartPole.Demo.mp4
Pong.Demo.mp4

About

Render OpenAI Gym environments in Google Colaboratory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published