def dump_seen(self, path): seen_pts = self.inner_seen seen_pts[self.cur_pos[0], self.cur_pos[1]] = True total_seen = np.multiply( seen_pts.astype(float).reshape(seen_pts.shape + (1, )), (self.inner_grid + 0.2) / 1.2) total_seen[self.cur_pos[0], self.cur_pos[1]] = (1, 1, 1) imaging.dump_upscaled_image(total_seen, self.upscale_factor, path)
from environment.back_world_easy import BackWorldEasy from environment.back_world_hard import BackWorldHard from utils.imaging import dump_upscaled_image a = BackWorldEasy(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) print(a.cur_pos) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_easy/world_1.png") a = BackWorldEasy(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_easy/world_2.png") a = BackWorldEasy(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_easy/world_3.png") a = BackWorldEasy(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_easy/world_4.png") a = BackWorldEasy(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_easy/world_5.png") a = BackWorldHard(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image(a.inner_grid, 40, "/home/saipraveen/sauce_imgs/back_world_hard/world_1.png") a = BackWorldHard(28, 28, (3, 3))
# Test env print & function import environment.alternator_world as ev from utils.imaging import dump_upscaled_image a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image( a.inner_grid, 40, "/home/saipraveen/sauce_imgs/alternator_world/world_1.png") a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image( a.inner_grid, 40, "/home/saipraveen/sauce_imgs/alternator_world/world_2.png") a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image( a.inner_grid, 40, "/home/saipraveen/sauce_imgs/alternator_world/world_3.png") a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image( a.inner_grid, 40, "/home/saipraveen/sauce_imgs/alternator_world/world_4.png") a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1) dump_upscaled_image( a.inner_grid, 40, "/home/saipraveen/sauce_imgs/alternator_world/world_5.png") a = ev.AlternatorWorld(28, 28, (3, 3)) a.inner_grid[a.cur_pos[0], a.cur_pos[1]] = (1, 1, 1)