Giter Site home page Giter Site logo

Comments (5)

gdb avatar gdb commented on August 26, 2024

@joschu what do you think?

from gym.

joschu avatar joschu commented on August 26, 2024

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.

JKCooper2 avatar JKCooper2 commented on August 26, 2024

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.

gdb avatar gdb commented on August 26, 2024

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.

mttk avatar mttk commented on August 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.