Esempio n. 1
0
 def screenshot(self, frame, filename=None):
     self.screenshots += 1
     plt.imshow(as_RGB(frame))
     if filename:
         plt.savefig(self.save_path + '/' + filename)
     else:
         plt.savefig(self.save_path + '/screen{}.png'.format(self.screenshots))
     plt.clf()
 def agent_cleanup(self):
     print 'saving memory'
     background = np.argmax(self.counts,axis=1)
     
     with file(self.log_name+'.pkl','wb') as f:
         pickle.dump(background,f,-1)
         
     imsave(self.log_name+'.png',
            as_RGB(background.reshape(self.im_size)))
Esempio n. 3
0
    def agent_cleanup(self):
        print 'saving memory'
        background = np.argmax(self.counts, axis=1)

        with file(self.log_name + '.pkl', 'wb') as f:
            pickle.dump(background, f, -1)

        imsave(self.log_name + '.png',
               as_RGB(background.reshape(self.im_size)))
Esempio n. 4
0
 def screenshot(self, frame, filename=None):
     self.screenshots += 1
     plt.imshow(as_RGB(frame))
     if filename:
         plt.savefig(self.save_path + '/' + filename)
     else:
         plt.savefig(self.save_path +
                     '/screen{}.png'.format(self.screenshots))
     plt.clf()