from pathlib import Path


def _deduce_images_and_annos_paths(root_path, subset):
    """Deduces paths for images and annotations. It returns the root path
    that contains all the sequences belonging to the specific subset.

    Args:
        root_path (str): Root directory path to the UA-DETRAC dataset.
        subset (str): Data subset type ('train' or 'test').

    Returns:
        Tuple[pathlib.Path, pathlib.Path]: Directory paths for images and
            annotations.
    """
    assert subset in ('train', 'test')

    subset = subset.capitalize()
    root_dir = Path(root_path)

    images_idr = root_dir / ('Insight-MVT_Annotation_' + subset)
    annos_dir = root_dir / 'DETRAC_public' / ('540p-' + subset)

    return images_idr, annos_dir