Skip to content

Commit 4ab0937

Browse files
AMArosteguisglvladi
authored andcommitted
Case insensitive search on regex image extensions
1 parent c2cc56c commit 4ab0937

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/scripts/partition_dataset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def iterate_dir(source, dest, ratio, copy_xml):
3232
os.makedirs(test_dir)
3333

3434
images = [f for f in os.listdir(source)
35-
if re.search(r'([a-zA-Z0-9\s_\\.\-\(\):])+(.jpg|.jpeg|.png)$', f)]
35+
if re.search(r'([a-zA-Z0-9\s_\\.\-\(\):])+(?i)(.jpg|.jpeg|.png)$', f)]
3636

3737
num_images = len(images)
3838
num_test_images = math.ceil(ratio*num_images)
@@ -95,4 +95,4 @@ def main():
9595

9696

9797
if __name__ == '__main__':
98-
main()
98+
main()

0 commit comments

Comments
 (0)