def comp_video(file_path, conf, suffix = None):
print 'reading files from:', file_path
ground_truth = cPickle.load(open(file_path + '/ground_truth.pkl', "rb"))
gen_images = cPickle.load(open(file_path + '/gen_image_seq.pkl', "rb"))
ground_truth = np.split(ground_truth, ground_truth.shape[1], axis=1)
ground_truth = np.squeeze(ground_truth)
fused_gif = assemble_gif([ground_truth, gen_images])
itr_vis = re.match('.*?([0-9]+)$', conf['visualize']).group(1)
if not suffix:
name = file_path + '/vid_' + conf['experiment_name'] + '_' + str(itr_vis)
else: name = file_path + '/vid_' + conf['experiment_name'] + '_' + str(itr_vis) + suffix
npy_to_gif(fused_gif, name)
return fused_gif
评论列表
文章目录