You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
ImportError: cannot import name 'imsave'
ImportError Traceback (most recent call last)
in
----> 1 from scipy.misc import imsave
2 from quiver_engine.server import launch
3
4
5 launch(model=model, input_folder='./img',port=7000)
ImportError: cannot import name 'imsave'
The text was updated successfully, but these errors were encountered: