Skip to content

Commit

Permalink
Case insensitive search on regex image extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
AMArostegui authored and sglvladi committed Jun 8, 2021
1 parent c2cc56c commit 4ab0937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/scripts/partition_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def iterate_dir(source, dest, ratio, copy_xml):
os.makedirs(test_dir)

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

num_images = len(images)
num_test_images = math.ceil(ratio*num_images)
Expand Down Expand Up @@ -95,4 +95,4 @@ def main():


if __name__ == '__main__':
main()
main()

0 comments on commit 4ab0937

Please sign in to comment.