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)
评论列表
文章目录