From d36d57e6313722755f499b7e573ba4d244f6709a Mon Sep 17 00:00:00 2001 From: anduin9527 Date: Mon, 13 Oct 2025 14:58:21 +0800 Subject: [PATCH] fix: support case-insensitive images/labels folders in YOLO datasets --- roboflow/util/folderparser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roboflow/util/folderparser.py b/roboflow/util/folderparser.py index 7cc336bf..5520811a 100644 --- a/roboflow/util/folderparser.py +++ b/roboflow/util/folderparser.py @@ -78,7 +78,10 @@ def _describe_file(f): name = f.split("/")[-1] dirname = os.path.dirname(f) fullkey, extension = os.path.splitext(f) - fullkey2 = fullkey.replace("/labels", "").replace("/images", "") + # Use case-insensitive replacement to support various directory naming conventions + # (e.g., "Images", "images", "IMAGES", "Labels", "labels", "LABELS") + fullkey2 = re.sub(r"/labels", "", fullkey, flags=re.IGNORECASE) + fullkey2 = re.sub(r"/images", "", fullkey2, flags=re.IGNORECASE) key = os.path.splitext(name)[0] return { "file": f,