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
def resize_and_save(filename, output_dir, size=SIZE):
"""Resize the image contained in filename and save it to the output_dir"""
image = Image.open(filename)
# Use bilinear interpolation instead of the default "nearest neighbor" method
image = image.resize((size, size), Image.BILINEAR)
image.save(os.path.join(output_dir, filename.split(os.sep)[-1]))
In Windows OS, folder names in a path join together with back slash [ \ ] instead of slash [ / ] like this:
so build_dataset.py throw an error. because it can't split filename from directory.
I solve it by replace the slash with double back slash '\'
image.save(os.path.join(output_dir, **filename.split('\\')[-1])**)
Thanks.
The text was updated successfully, but these errors were encountered: