Apologies - somehow I read ObjectDetection instead of ChangeDetection. Yes, I think there is something in the underlying code which is breaking when trying this.
I can't find it documented anywhere, but there appears to be a split_type parameter to choose if your training\validation split is random or defined by folder.
val_split_pct (float): percentage of data to split in validation if the split_type is "random"
split_type (str, optional): If split_type='manual' will use train val folders. Defaults to 'random'.
And the code shows how it should be structured:
if split_type == 'folder':
if (path / 'train').exists() and (path / 'val').exists():
folder_check(path / 'train')
folder_check(path / 'val')
train_images_before = get_files(path / 'train' / 'images_before', extensions=image_extensions)
train_images_after = get_files(path / 'train' / 'images_after', extensions=image_extensions)
train_labels = get_files(path / 'train' / 'labels', extensions=image_extensions)
val_images_before = get_files(path / 'val' / 'images_before', extensions=image_extensions)
val_images_after = get_files(path / 'val' / 'images_after', extensions=image_extensions)
val_labels = get_files(path / 'val' / 'labels', extensions=image_extensions)
You could maybe try putting your existing image\label folders under a 'train' folder and creating some empty image\label folders under the 'val' folder. In the prepare_data function add a parameter split_type='manual' and see if that makes any difference (it could also be split='manual', I'm not sure)?