question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There is a render module but I don’t know how to use it. Could you please provide some examples of how to render?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
wwxFromTjucommented, Jan 4, 2018

you can use this:

from dm_control import suite
import matplotlib.pyplot as plt
import numpy as np

max_frame = 90

width = 480
height = 480
video = np.zeros((90, height, 2 * width, 3), dtype=np.uint8)

# Load one task:
env = suite.load(domain_name="cartpole", task_name="swingup")

# Step through an episode and print out reward, discount and observation.
action_spec = env.action_spec()
time_step = env.reset()
while not time_step.last():
  for i in range(max_frame):
    action = np.random.uniform(action_spec.minimum,
                             action_spec.maximum,
                             size=action_spec.shape)
    time_step = env.step(action)
    video[i] = np.hstack([env.physics.render(height, width, camera_id=0),
                          env.physics.render(height, width, camera_id=1)])
    #print(time_step.reward, time_step.discount, time_step.observation)
  for i in range(max_frame):
    img = plt.imshow(video[i])
    plt.pause(0.01)  # Need min display time > 0.0.
    plt.draw()
5reactions
ChristianLemkecommented, Mar 6, 2018

Hi @yotam
Is there any progress in this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Render: the fundamentals of light, shadow and ...
This book is about the fundamentals of light, shadow and reflectivity; the focus is firmly on helping to improve visual understanding of the...
Read more >
3 Ways to Render a Wall - wikiHow
1. Chip away any old render and paint. Use a cold chisel that is just sharp enough to scrape, chip away any bumps,...
Read more >
How to render walls: a beginner's guide to rendering
Render can be sand and cement or a flexible, breathable polymer modified render for homes with solid walls. It can hide poor-quality or ......
Read more >
How to render in Blender - Artisticrender.com
To render in Blender Press F12 for rendering a still image or Ctrl+F12 to render animation. You can also go to the render...
Read more >
How to Render & Export in Adobe Premiere Pro - iD Tech
If you're rendering everything in a video, choose Sequence > Render In to Out; If you're only rendering the effects, select Sequence >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found