def init_stats(gt: dict, categories: dict) -> dict:
    """Initializing the statistics before counting leasion
       and non-leasion localiazations.

    Arguments:
        gt {dict} -- Ground truth COCO dataset
        categories {dict} -- Dictionary of categories present in the COCO dataset

    Returns:
        stats {dict} -- Statistics to be updated, containing every information
                        necessary to evaluate a single FROC point
    """
    stats = {
        cat["id"]: {
            "name": cat["name"],
            "LL": 0,
            "NL": 0,
            "n_images": [],
            "n_lesions": 0,
        }
        for cat in categories
    }

    for annotation in gt["annotations"]:
        category_id = annotation["category_id"]
        stats[category_id]["n_lesions"] += 1

    for image in gt["images"]:
        image_id = image["id"]
        for cat_id in stats:
            stats[cat_id]["n_images"].append(image_id)

    for cat_id in stats:
        stats[cat_id]["n_images"] = len(stats[cat_id]["n_images"])

    return stats