From c43fdcf1ee45ecd112411f77b2519cbee9941b04 Mon Sep 17 00:00:00 2001 From: Alphara Date: Sun, 12 Feb 2023 01:15:54 +0200 Subject: initial migration of the project --- renderer.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 renderer.py (limited to 'renderer.py') 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) -- cgit v1.2.3