Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when run build_dataset.py on windows #17

Open
Amin-Tgz opened this issue Apr 5, 2019 · 1 comment
Open

Error when run build_dataset.py on windows #17

Amin-Tgz opened this issue Apr 5, 2019 · 1 comment

Comments

@Amin-Tgz
Copy link

Amin-Tgz commented Apr 5, 2019

In Windows OS, folder names in a path join together with back slash [ \ ] instead of slash [ / ] like this:

C:\Program Files\NVIDIA GPU Computing Toolkit

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.

@3a1b2c3
Copy link

3a1b2c3 commented Jan 23, 2024

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]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants