Closed cedro3 closed 2 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...
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
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
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).
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.