util.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:cartpoleplusplus 作者: matpalm 项目源码 文件源码
def render_action_to_png(step, action):
  import Image, ImageDraw
  img = Image.new('RGB', (50, 50), (50, 50, 50))
  canvas = ImageDraw.Draw(img)
  lx, ly = int(25+(action[0][0]*25)), int(25+(action[0][1]*25))
  canvas.line((25,25, lx,ly), fill="black")
  img.save("/tmp/action_%03d.png" % step)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号