Skip to content

Conversation

Erotemic
Copy link
Contributor

@Erotemic Erotemic commented Nov 5, 2017

I had an issue with loading pgm images when using the ATT Faces dataset. The .pgm extension was missing from IMG_EXTENSIONS. As far as I know, PIL can read this format without any trouble, so it should be safe to add. Let me know if I'm wrong about this.

While I was there, I noticed all the extensions were duplicated for caps and lower case, so I made them all lowercase in the variable and changed is_image_file to transform the input string into lower case. This adds robustness to weird corner cases like img.Jpeg.

Lastly, I added a docstring.

is_image_file is now case insensitive
Added docstring to is_image_file
is_image_file now returns true for pgm files
bool: True if the filename ends with a known image extension
"""
filename_lower = filename.lower()
return any(filename_lower.endswith(ext) for ext in IMG_EXTENSIONS)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@soumith soumith merged commit 2091365 into pytorch:master Nov 6, 2017
@soumith
Copy link
Member

soumith commented Nov 6, 2017

thanks @Erotemic !

rajveerb pushed a commit to rajveerb/vision that referenced this pull request Nov 30, 2023
…daries (pytorch#322)

* [single_stage_detector] Dockerfile copy sources after pip install

* [single_stage_detector] epoch based evaluation, warmup and lr decay
resolves issues pytorch#290 and mlperf/training_policies/pytorch#210
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 this pull request may close these issues.

3 participants