def download_fiw_dataset(dataset_dir, split, scratch_dir=None, cleanup=False):
    """Downloads and extracts the Families in the Wild dataset.

    Any existing files are not re-downloaded.

    Args:
        dataset_dir: the directory to output the final dataset
        split: the split being loaded
        scratch_dir (None): a scratch directory to use to store temporary files
        cleanup (True): whether to cleanup the scratch directory after
            extraction
    """
    etau.ensure_dir(dataset_dir)

    if scratch_dir is None:
        scratch_dir = os.path.join(dataset_dir, "scratch")
        etau.ensure_dir(scratch_dir)

    # Download dataset
    _download_images_if_necessary(dataset_dir, scratch_dir)
    _download_labels_if_necessary(dataset_dir, scratch_dir)

    if cleanup:
        logger.info("Cleaning up %s", scratch_dir)
        etau.delete_dir(scratch_dir)

    num_samples, classes = _get_dataset_info(dataset_dir, split)

    return num_samples, classes
Downloads and extracts the Families in the Wild dataset.

    Any existing files are not re-downloaded.

    Args:
        dataset_dir: the directory to output the final dataset
        split: the split being loaded
        scratch_dir (None): a scratch directory to use to store temporary files
        cleanup (True): whether to cleanup the scratch directory after
            extraction
    
fiftyone/utils/fiw.py