Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Sep 19, 2023
1 parent dc5d468 commit 5f87e02
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions metadrive/tests/test_functionality/test_top_down_semantics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def reset(self, seed=None):
return super(DemoWaymoEnv, self).reset(seed=seed)


def test_top_down_semantics():
def test_top_down_semantics(render=False):
asset_path = AssetLoader.asset_path
try:
env = DemoWaymoEnv(
Expand All @@ -34,15 +34,16 @@ def test_top_down_semantics():
)
o, _ = env.reset()

for i in range(1, 100000):
for i in range(1, 1000):
o, r, tm, tc, info = env.step([1.0, 0.])
this_frame_fig = env.render(
mode="top_down",
semantic_map=True,
film_size=(2000, 2000),
num_stack=1,
scaling=10,
)
if render:
this_frame_fig = env.render(
mode="top_down",
semantic_map=True,
film_size=(2000, 2000),
num_stack=1,
scaling=10,
)
# save
# pygame.image.save(this_frame_fig, "{}.png".format(i))
if tm or tc:
Expand Down

0 comments on commit 5f87e02

Please sign in to comment.