allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.13k stars 215 forks source link

Can I close the display? #374

Open kamikaze0923 opened 4 years ago

kamikaze0923 commented 4 years ago

Basically just shut down the window which pop up every time when the controller is initialized.

kamikaze0923 commented 4 years ago

I still want the image to be rendered and the metadata returned. Just do not want to see the animation.

kamikaze0923 commented 4 years ago

Is there a similar option to close the display like in gym Atari? If we do not call env.render(), it will not show us an image.

mattdeitke commented 4 years ago

Hey!

This is not currently available as we basically have to open up unity in the background for all the physics functionality and 3D scene hosting, but there are a few ways this can be less annoying.

You can close the window automatically in python as follows:

from ai2thor.controller import Controller
c = Controller()
...
c.stop()

There is also support for a context manager, which automatically closes the window outside of the scope, which can be used as follows:

from ai2thor.controller import Controller
with Controller() as c:
    ...

Matt.

ekolve commented 4 years ago

Can you tell me if you are on OSX or Linux? We may be able to provide an option to minimize the window on startup.