diff options
author | Alphara <alphara@deltarion> | 2023-02-12 01:15:54 +0200 |
---|---|---|
committer | Alphara <alphara@deltarion> | 2023-02-12 01:15:54 +0200 |
commit | c43fdcf1ee45ecd112411f77b2519cbee9941b04 (patch) | |
tree | f628b7eefd1476dbcac1340f3eaec54cd526617c /renderer.py | |
parent | 7c84258c739c7c998526ad86fbea51bb6e8c6f7a (diff) |
initial migration of the project
Diffstat (limited to 'renderer.py')
-rw-r--r-- | renderer.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/renderer.py b/renderer.py new file mode 100644 index 0000000..98b32f5 --- /dev/null +++ b/renderer.py @@ -0,0 +1,32 @@ +#!/bin/python + +### very slow step that will be assigned to multiple +### jobs later in the development of this tool + +### data loading + +import numpy as np + +image_array = np.load("images.npy", allow_pickle=True) + +### progress bar + +from tqdm import tqdm + +pbar = tqdm(total = len(image_array)) + +### rendering of images + +import matplotlib.pyplot as plt + +def render(index): + name = 'Output/neural_art_{:04d}.png'.format(index + 1) + + plt.axis('off') + plt.imshow(image_array[index]) + plt.savefig(name, dpi=258, bbox_inches='tight', pad_inches=0) # dpi 258 -> 720p ; dpi 387 -> 1080p output image resolution + plt.close('all') + +for index in range(0, len(image_array)): + render(index) + pbar.update(1) |