Commit de411726 authored by Perez Visaires, Jon's avatar Perez Visaires, Jon

Test-Velocity

parent 88016011
import imageio
import PIL
import numpy as np
frames = 200
time_steps = 6
images_in = []
images_out = []
images_pred = []
images_combi = []
for number in range(frames):
images_in.append(imageio.imread("in_" + str(number) + ".png"))
images_out.append(imageio.imread("out_" + str(number) + ".png"))
imageio.mimsave("./in.gif", images_in)
imageio.mimsave("./out.gif", images_out)
for number in range(time_steps, frames):
images_pred.append(imageio.imread("pred_" + str(number) + ".png"))
imageio.mimsave("./pred.gif", images_pred)
for number in range(time_steps, frames):
list_im = ["in_" + str(number) + ".png", "out_" + str(number) + ".png", "pred_" + str(number) + ".png"]
imgs = [PIL.Image.open(i) for i in list_im]
min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
imgs_comb = np.hstack((np.asarray(i.resize(min_shape)) for i in imgs))
imgs_comb = PIL.Image.fromarray(imgs_comb)
imgs_comb.save("combi_" + str(number) + ".png")
for number in range(time_steps, frames):
images_combi.append(imageio.imread("combi_" + str(number) + ".png"))
imageio.mimsave("./combi.gif", images_combi)
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment