def METHOD_NAME(img_dir, gt_dir):
    """Collect all images and their corresponding groundtruth files.
    Args:
        img_dir (str): The image directory
        gt_dir (str): The groundtruth directory
    Returns:
        files (list): The list of tuples (img_file, groundtruth_file)
    """
    assert isinstance(img_dir, str)
    assert img_dir
    assert isinstance(gt_dir, str)
    assert gt_dir
    ann_list, imgs_list = [], []
    for img in os.listdir(img_dir):
        imgs_list.append(osp.join(img_dir, img))
        ann_list.append(osp.join(gt_dir, 'gt_' + img.replace('jpg', 'txt')))
    files = list(zip(imgs_list, ann_list))
    assert len(files), f'No images found in {img_dir}'
    print(f'Loaded {len(files)} images from {img_dir}')
    return files