测试代码

This commit is contained in:
2025-06-24 16:57:16 +08:00
parent fdc5b9722c
commit 3d364aa0bd
5 changed files with 142 additions and 5 deletions

View File

@ -43,7 +43,7 @@ PIN_MEMORY = str(os.getenv("PIN_MEMORY", True)).lower() == "true" # global pin_
def img2label_paths(img_paths):
"""Define label paths as a function of image paths."""
# sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels{os.sep}" # /images/, /labels/ substrings
sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels_class2{os.sep}" # /images/, /labels/ substrings
sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels{os.sep}" # /images/, /labels/ substrings
return [sb.join(x.rsplit(sa, 1)).rsplit(".", 1)[0] + ".txt" for x in img_paths]