Open ashishpatel26 opened 5 years ago
Replace quiver_engine/file_utils.py
with
import re
from os.path import relpath, abspath
from os import listdir
import imageio
from quiver_engine.util import deprocess_image
def save_layer_img(layer_outputs, layer_name, idx, temp_folder, input_path):
filename = get_output_filename(layer_name, idx, temp_folder, input_path)
imageio.imwrite(filename, deprocess_image(layer_outputs))
return relpath(filename, abspath(temp_folder))
def get_output_filename(layer_name, z_idx, temp_folder, input_path):
return '{}/{}_{}_{}.png'.format(temp_folder, layer_name, str(z_idx), input_path)
def list_img_files(input_folder):
image_regex = re.compile(r'.*\.(jpg|png|gif)$')
return [
filename
for filename in listdir(
abspath(input_folder)
)
if image_regex.match(filename) is not None
]
Possibly, also run pip install imageio
.
scipy.imsave
has been removed since its deprecation quite some time ago, but was not yet replaced in this package. Imageio is the recommended replacement.
pip install scipy==1.2.1
ImportError: cannot import name 'imsave'
ImportError Traceback (most recent call last)