Skip to content

Commit

Permalink
fix: update enjoy script and add moviepy
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin18 committed Jan 27, 2024
1 parent 4c4eb3e commit a7cb6c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies = [
[project.optional-dependencies]
training = [
"matplotlib==3.8.2",
"moviepy==1.0.3",
"pandas==2.2.0",
"pyarrow==15.0.0",
"tqdm==4.66.1",
Expand Down
4 changes: 3 additions & 1 deletion scripts/enjoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ def enjoy() -> None:
args = parse_args()

np.random.seed(args.seed)
env = gym.make(args.env, render_mode="human")
if args.record_video:
env = gym.make(args.env, render_mode="rgb_array")
env = gym.wrappers.RecordVideo(
env,
video_folder=args.video_folder,
episode_trigger=lambda _: True,
disable_logger=True,
)
else:
env = gym.make(args.env, render_mode="human")

policy = make_policy(algo=args.algo, trained_agent=args.trained_agent)

Expand Down

0 comments on commit a7cb6c3

Please sign in to comment.