gym_recorder
A recorder for open ai gym.
you can easily add a text on the frame like this.
install
pip install gym_record
usage
import gym
from gym_recorder import Recorder
src_env = gym.make("CartPole-v1")
env = Recorder(src_env, episode_num=10)
for ep in range(10):
obs = env.reset()
done = False
while not done:
action = env.action_space.sample()
n_obs, reward, done, info = env.step(action)
env.txtqueue.append(f"episode:{ep}")
env.txtqueue.append(f"obs:{obs}")
env.txtqueue.append(f"action:{action}")
env.txtqueue.append(f"reward:{reward}")
env.txtqueue.append(f"next obs:{n_obs}")
tips
this library depends on opencv-python. so you may need some library to use opencv. this is .Dockerfile example to resolve it.
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y libgl1-mesa-dev
if you use docker, you have to set "SDL_VIDEODRIVER" to "dummy".
add this to your .Dockerfile
ENV SDL_VIDEODRIVER=dummy
or simply add this to your script.
import os
os.environ["SDL_VIDEODRIVER"] = "dummy"
Metadata
Release files for gym-record 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gym-record-0.0.3.tar.gz | 3.5 kB | Without provenance | Details for gym-record-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gym_record-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for gym_record-0.0.3-py3-none-any.whl |
Total release size: 7.5 kB
Release files / gym-record-0.0.3.tar.gz
| Download URL | gym-record-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9fe73711acd652254ee98d7e156c7192b33f5a614b17457f7fa83d668568c8c
|
|
BLAKE2b-256 checksum How to use checksums |
d2a39773beb1374042a277dcca3b543d09859836d05dc863a691d71e76974c53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / gym_record-0.0.3-py3-none-any.whl
| Download URL | gym_record-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
45d8f592db8c5a02f94a7903146fc04b7e47441249643c5de159fbd5136e86c2
|
|
BLAKE2b-256 checksum How to use checksums |
825e4b38eb5664590700d74689b20822e5ae49dd375989c27a8a4a8ff0d1bc18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Security for gym-record 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.