Comments (5)
@joschu what do you think?
from gym.
Seems reasonable, though I'm not sure if it's worth the extra complexity.
You can always get the rgb_array and then render that yourself.
from gym.
I've been running some tests with resizing the SimpleImageViewer used by the atari environment and it looks like it would be reasonably straight forward. It would probably just be an additional function in atari env called set_display_dimensions(width, height) (in order to keep it seperate from the _render function) that would set the dimensions used by SimpleImageViewer to display but not alter the inputs. I'll put up a pull request if I can get something working pretty soon
from gym.
After looking at the implementation, I agree with John that we shouldn't support this right now. If there's lots of demand, we can support something, but otherwise we'll be maintaining something that's a bit complicated and isn't obviously universally needed.
Thanks for raising this, however! If you end up writing some code to render the rgb_array yourself, please make sure to post it somewhere (this issue is fine, or alternatively a Gist writeup in gym).
from gym.
@gdb @joschu is this still relevant? I started typing something up, however I'm not sure if the VideoRecorder allows for some resizing options.
Edit: Nevermind, I think it should be relevant. There are two solutions as I see them, one of them part of the gym and one an outside edit.
The latter would grab the rgb array, do some interpolation and use SimpleImageViewer to display the array.
As for the former, I think the most painless way to include the functionality would be to create another viewer (ResizableImageViewer) which could replace the SimpleImageViewer when needed (either on shape
argument pass or some function). I think it wouldn't complicate the code, however I completely understand why you wouldn't want it.
I'll pop a gist when I do some experiments with interpolating the games.
Edit 2:
Random agent with increased rendering size:
https://gist.github.com/mttk/74dc6eaaea83b9f06c2cc99584d45f96
So, i backed off from doing any heavy computation and decided to keep it simple by just repeating the x and y axes of the rgb matrix by a whole factor. The rendering is then large enough for demonstrative purposes.
I've tested it on most of the environments (100 iters of random agent) and it works fine. I didn't test on MuJoCo ones since I didn't get the license. I couldn't test on the ones that just have text display (obviously).
For some of the games there's a double rendering - something (the monitor?) renders the original sized rgb array before I render the upscaled one, and the two renders are seen in parallel. I've reproduced this with Pendulum-v0
.
For my needs, this is enough, so I'll leave it like this for now.
from gym.
Related Issues (20)
- [Bug Report] Getting Error from "D:\PongDQN_RL\venv\lib\site-packages\gym\wrappers\compatibility.py" HOT 12
- [Question] Custom dtype in observation space
- [Bug Report] pusher-v4 in the environment doesn't collide the object for the fork HOT 1
- [Question] How to verify who is the winner of a game? HOT 3
- [bug] OpenAI gym set_level(50) not disabling logs HOT 1
- [Bug Report] Humanoidv4 doesnt include contact_cost in code, but still present in documentation HOT 4
- [Question] I am implementing a DQN on Atari. I have some shape related problems. HOT 1
- [Question] MUJOCO environment info ERROR in the gym documentation website HOT 3
- [Question] How do I edit the leaderboard? HOT 1
- [Question] AsyncVectorEnv getting hung up as `pip.recv()` not returning anything for `_check_observation_spaces` HOT 4
- [Question] Question title
- gym.error.UnregisteredEnv: No registered env with id: meme-v0 HOT 1
- AttributeError: attempted to get missing private attribute '_domain_file' HOT 2
- ModuleNotFoundError: No module named 'gym.envs.atari' HOT 4
- [Bug Report] When call a base64.b64encode() on a Box observation_space, the programme shut down without Error
- Problem in render_mode HOT 1
- Error related to import gym HOT 4
- [bug] EOF error with gym.vector.AsyncVectorEnv() when calling the step method. HOT 1
- trying to use mujoco env
- [Question] Install gym 0.19.0 on google colab. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gym.