From 653ef7a32d909b595d4151f4001287b0e8650f7a Mon Sep 17 00:00:00 2001 From: Antonio Miras Date: Sat, 31 Oct 2020 10:11:43 +0100 Subject: [PATCH] Case insensitive search on regex image extensions --- docs/source/scripts/partition_dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/scripts/partition_dataset.py b/docs/source/scripts/partition_dataset.py index a9d0c11..697d1a5 100644 --- a/docs/source/scripts/partition_dataset.py +++ b/docs/source/scripts/partition_dataset.py @@ -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) @@ -95,4 +95,4 @@ def main(): if __name__ == '__main__': - main() \ No newline at end of file + main() pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy