MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / is_image_file

Function is_image_file

GAN/ACGAN-PyTorch-master/folder.py:10–20  ·  view source on GitHub ↗

Checks if a file is an image. Args: filename (string): path to a file Returns: bool: True if the filename ends with a known image extension

(filename)

Source from the content-addressed store, hash-verified

8
9
10def is_image_file(filename):
11 """Checks if a file is an image.
12
13 Args:
14 filename (string): path to a file
15
16 Returns:
17 bool: True if the filename ends with a known image extension
18 """
19 filename_lower = filename.lower()
20 return any(filename_lower.endswith(ext) for ext in IMG_EXTENSIONS)
21
22
23def find_classes(dir, classes_idx=None):

Callers 1

make_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected