-
Notifications
You must be signed in to change notification settings - Fork 8.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RecordVideo wrapper revived #2894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it LGTM; thanks a lot for addressing this.
You should probably override also the render
method because with rgb_array
the frames are popped.
For example:
env = RecordVideo(gym.make("FrozenLake-v1", render_mode='rgb_array'), './video')
env.reset()
for _ in range(10):
env.step(env.action_space.sample())
> len(env.render())
doesn't return the expected result.
One minor comment is that this is not backwards compatible, i.e. it doesn't work with render_mode='None'
.
Overall, I am actually unfulfilled about how this Wrapper code is complicated when with MoviePy you can do it with two lines. Obviously, this is not related to your PR @johnMinelli
I think that the main reason is the step trigger (and eventually the backward compatibility).
@vwxyzjn is the step trigger important?
Hi @younik, yes! Step trigger is especially important in high-throughput envs like Isaac Gym or Brax, where using episode_trigger would be more difficult when you have 2048 episodes. We might also want to render the entire scene of 2048 robotics regardless of the episodes like below, where the step trigger would be helpful. |
Clear, thanks! @johnMinelli do you think it can be refactored using MoviePy? |
In |
Regarding metadata, there is hacky code to maintain backward compatibility with Thus, in addition to my previous comments, let's add a deprecation warning for |
e142d71
to
9f87798
Compare
I wrote the code for the MoviePy proposal, I left 3 notes in record_video.py to review about the wanted behaviour. ...oh, I just realized that maybe it would have been better to make a new pr? I'll drop the last commits in the case |
Great, thanks! However, we cannot delete
You will probably need to open a new PR; feel free to close this, open the new one referencing this one and ping me. |
Ok thank you, I'll do as you suggested 👍 |
…gs in RecordVideo's desired behaviour
9f87798
to
1cbbcd1
Compare
… with no render_mode specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of minor comments, but then it is ready for me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…deo_revived � Conflicts: � gym/wrappers/record_video.py
@johnMinelli Is CI currently testing the revived VideoRecorder? If no, could you add tests please? |
Previous tests are still there: https://github.com/openai/gym/blob/master/tests/wrappers/test_record_video.py |
Removed deprecation warning to
RecordVideo
andVideoRecorder
classes and updated to be compatible with new environment render mode (#2671)VideoRecorder
is now compatible with environments setted with one of the followingrender_mode
: "ansi", "single_rgb_array", "rgb_array".