Mukosame / Anime2Sketch

A sketch extractor for anime/illustration.
MIT License
1.96k stars 163 forks source link

ValueError: Unknown resampling filter #12

Closed cedro3 closed 2 years ago

cedro3 commented 3 years ago

When I run test.py, I get a ValueError: Unknown resampling filter (InterpolationMode.BICUBIC) error in data.py. To avoid errors data.py line 96 image_pil = image_pil.resize (output_resize, bic) is image_pil = image_pil.resize (output_resize, Image.BICUBIC) or Shouldn't image_pil = image_pil.resize (output_resize, 3)? This way the error no longer occurs.

Mukosame commented 3 years ago

Hi, the bic can be defined as Image.BICUBIC as shown in this line. This is to solve this issue. Somehow it creates another issue...

brucekomike commented 2 years ago

I get this when I run the example command with Pillow 8.1.2: $ python3 test.py --dataroot test_samples/madoka.jpg --load_size 512 --output_dir results/

Traceback (most recent call last): File "/home/brucekomike/Python/Anime2Sketch-master/test.py", line 46, in save_image(aus_img, aus_path, aus_resize) File "/home/brucekomike/Python/Anime2Sketch-master/data.py", line 96, in save_image image_pil = image_pil.resize(output_resize, bic) File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1891, in resize raise ValueError( ValueError: Unknown resampling filter (InterpolationMode.BICUBIC). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BILINEAR (2), Image.BICUBIC (3), Image.BOX (4) or Image.HAMMING (5)

alimalls commented 2 years ago

I get this when I run the example command with Pillow 8.1.2: $ python3 test.py --dataroot test_samples/madoka.jpg --load_size 512 --output_dir results/

Traceback (most recent call last): File "/home/brucekomike/Python/Anime2Sketch-master/test.py", line 46, in save_image(aus_img, aus_path, aus_resize) File "/home/brucekomike/Python/Anime2Sketch-master/data.py", line 96, in save_image image_pil = image_pil.resize(output_resize, bic) File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1891, in resize raise ValueError( ValueError: Unknown resampling filter (InterpolationMode.BICUBIC). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BILINEAR (2), Image.BICUBIC (3), Image.BOX (4) or Image.HAMMING (5)

python3 -m pip install --upgrade Pillow

gongsuming commented 2 years ago

I get this when I run the example command with Pillow 8.1.2: $ python3 test.py --dataroot test_samples/madoka.jpg --load_size 512 --output_dir results/

Traceback (most recent call last): File "/home/brucekomike/Python/Anime2Sketch-master/test.py", line 46, in save_image(aus_img, aus_path, aus_resize) File "/home/brucekomike/Python/Anime2Sketch-master/data.py", line 96, in save_image image_pil = image_pil.resize(output_resize, bic) File "/usr/lib/python3/dist-packages/PIL/Image.py", line 1891, in resize raise ValueError( ValueError: Unknown resampling filter (InterpolationMode.BICUBIC). Use Image.NEAREST (0), Image.LANCZOS (1), Image.BILINEAR (2), Image.BICUBIC (3), Image.BOX (4) or Image.HAMMING (5)

Just replace bic with 3 in image_pil = image_pil.resize(output_resize, bic).