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

Reference to ANTIALIAS in PIL #2378

Closed
MDCurrent opened this issue Aug 29, 2023 · 2 comments · Fixed by #2446
Closed

Reference to ANTIALIAS in PIL #2378

MDCurrent opened this issue Aug 29, 2023 · 2 comments · Fixed by #2446

Comments

@MDCurrent
Copy link

MDCurrent commented Aug 29, 2023

Describe the bug
When running the docker image

The process data script fails to load the pixel-perfect extractor

To Reproduce
Steps to reproduce the behavior:

  1. Run through the docs - when running the interactive docker container
    docker run --gpus all -u 1000 -v /home/mdcurrent/Videos:/workspace/ -v /home/mdcurrent/.cache/:/home/user/.cache/ -p 7007:7007 --rm -it --shm-size=12gb nerfstudio-89

see the error

           Traceback (most recent call last):                                                             install.py:128
             File "/usr/local/bin/ns-process-data", line 5, in <module>                                                 
               from nerfstudio.scripts.process_data import entrypoint                                                   
             File "/home/user/nerfstudio/nerfstudio/scripts/process_data.py", line 36, in <module>                      
               from nerfstudio.process_data.colmap_converter_to_nerfstudio_dataset import                               
           BaseConverterToNerfstudioDataset                                                                             
             File                                                                                                       
           "/home/user/nerfstudio/nerfstudio/process_data/colmap_converter_to_nerfstudio_dataset.py",                   
           line 21, in <module>                                                                                         
               from nerfstudio.process_data import colmap_utils, hloc_utils, process_data_utils                         
             File "/home/user/nerfstudio/nerfstudio/process_data/hloc_utils.py", line 45, in <module>                   
               from pixsfm.refine_hloc import PixSfM  # type: ignore                                                    
             File "/home/user/pixel-perfect-sfm/pixsfm/__init__.py", line 19, in <module>                               
               from . import (  # noqa F403                                                                             
             File "/home/user/pixel-perfect-sfm/pixsfm/features/__init__.py", line 2, in <module>                       
               from . import models, extractor, extract_patches, store_features, store_references  # noqa               
           F403                                                                                                         
             File "/home/user/pixel-perfect-sfm/pixsfm/features/extractor.py", line 32, in <module>                     
               class FeatureExtractor:                                                                                  
             File "/home/user/pixel-perfect-sfm/pixsfm/features/extractor.py", line 64, in                              
           FeatureExtractor                                                                                             
               filters = {                                                                                              
             File "/home/user/pixel-perfect-sfm/pixsfm/features/extractor.py", line 65, in <dictcomp>                   
               n: getattr(PIL.Image, n)                                                                                 
           AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'  

Expected behavior
Haven't gotten a clean run, but expect the docker container to boot and not die instantly

Screenshots
Screenshot from 2023-08-28 22-07-12

Additional context
i could be missing something but i think i set the right 8.9/ 89 everywhere applicable and updated nvidia drivers / a clean build

Looks like the attribute has been sunset
https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html#constants

TIA!

@GabrielGosden
Copy link

GabrielGosden commented Sep 13, 2023

Hi,

According to 10.0.0 Pillow release notes Image.ANTIALIAS has been removed and replaced by Image.LANCZOSor Image.Resampling.LANCZOS. Therefore built the docker image using version 9.5.0 by adding the following to the Dockerfile as suggested on Stack Overflow:

pip install Pillow==9.5.0

This fixed the problem for me and I was able launch the docker image without issues. Hope this helps.

Alternatively you could find out where Image.ANTIALIAS is used in the code and replace it with either Image.LANCZOSor Image.Resampling.LANCZOS

@MDCurrent
Copy link
Author

Resolved with cvg/pixel-perfect-sfm#122

brentyi pushed a commit that referenced this issue Oct 17, 2023
* Fix pillow version to avoid error with ANTIALIAS (Fix #2378)

* Revert pillow version, use fix for pillow ANTIALIAS from upstream
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

Successfully merging a pull request may close this issue.

2 participants