module documentation

Utilities for working with the Families in the Wild dataset.

Copyright 2017-2025, Voxel51, Inc.

Class FIWDatasetImporter Importer for Faces in the Wild-formatted datasets stored on disk.
Function download_fiw_dataset Downloads and extracts the Families in the Wild dataset.
Function get_identifier_filepaths_map Creates a mapping of family_id/member_id identifier to a list of filepaths for each person.
Function get_pairwise_labels Gets a list of all pairs of people that are related and the label of their relation, either through the "kinships" or "relationships" field.
Variable logger Undocumented
Function _download_images_if_necessary Undocumented
Function _download_labels_if_necessary Undocumented
Function _format_mid Undocumented
Function _get_dataset_info Undocumented
Function _get_gender Undocumented
Function _get_mid Undocumented
Function _get_name Undocumented
Function _get_picture_face Undocumented
Function _get_relationships Undocumented
Function _is_missing_images Undocumented
Function _is_missing_labels Undocumented
Function _load_member Undocumented
Function _load_split Undocumented
Function _organize_data Undocumented
Function _organize_labels Undocumented
Function _parse_identifier Undocumented
Function _parse_kinship_map Undocumented
Constant _IMAGES_DOWNLOAD_LINK Undocumented
Constant _LISTS_DOWNLOAD_LINK Undocumented
Constant _MD5_DATA_DOWNLOAD_LINK Undocumented
Constant _MD5_LISTS_DOWNLOAD_LINK Undocumented
Constant _RELATIONSHIP_MAP Undocumented
Constant _SPLITS Undocumented
def download_fiw_dataset(dataset_dir, split, scratch_dir=None, cleanup=False): (source)

Downloads and extracts the Families in the Wild dataset.

Any existing files are not re-downloaded.

Parameters
dataset_dirthe directory to output the final dataset
splitthe split being loaded
scratch_dir:Nonea scratch directory to use to store temporary files
cleanup:Truewhether to cleanup the scratch directory after extraction
def get_identifier_filepaths_map(samples): (source)

Creates a mapping of family_id/member_id identifier to a list of filepaths for each person.

Example:

{
    "F0325/MID4": [
        "/path/to/fiftyone/fiw/train/data/F0325/MID4/P03451_face4.jpg",
        ...
    ],
    ...
}
Parameters
samplesa fiftyone.core.collections.SampleCollection
Returns
a dict mapping family_id/member_id identifiers to a list of filepaths containing images of the corresponding person
def get_pairwise_labels(samples, label_type='kinships'): (source)

Gets a list of all pairs of people that are related and the label of their relation, either through the "kinships" or "relationships" field.

Example:

[
   ["F0009/MID2", "F0009/MID4", "sibling"],
   ...
]
Parameters
samplesa fiftyone.core.collections.SampleCollection
label_type:"kinships"the type of label of which to return pairwise listings options are ("kinships", "relationships")
Returns
a list of triplets containing the identifier of person 1, identifier of person 2, and their kinship or relationship

Undocumented

def _download_images_if_necessary(dataset_dir, scratch_dir): (source)

Undocumented

def _download_labels_if_necessary(dataset_dir, scratch_dir): (source)

Undocumented

def _format_mid(member_id_int): (source)

Undocumented

def _get_dataset_info(dataset_dir, split): (source)

Undocumented

def _get_gender(labels, member_id): (source)

Undocumented

def _get_mid(member_id): (source)

Undocumented

def _get_name(labels, member_id): (source)

Undocumented

def _get_picture_face(img_path): (source)

Undocumented

def _get_relationships(labels, member_id_int, num_members, family_id): (source)

Undocumented

def _is_missing_images(dataset_dir): (source)

Undocumented

def _is_missing_labels(dataset_dir): (source)

Undocumented

def _load_member(dir_images, family_id, member_id, labels, face_indices, tags, kinship_map): (source)

Undocumented

def _load_split(split_dir, tags, labels_path): (source)

Undocumented

def _organize_data(unzip_path, dataset_dir): (source)

Undocumented

def _organize_labels(scratch_dir, dataset_dir): (source)

Undocumented

def _parse_identifier(identifier): (source)

Undocumented

def _parse_kinship_map(labels_path): (source)

Undocumented

_IMAGES_DOWNLOAD_LINK: str = (source)

Undocumented

Value
'1rkrDGOjS0e_pptzRHZl5bRGq0yy5xQxQ'
_LISTS_DOWNLOAD_LINK: str = (source)

Undocumented

Value
'1nt22yiCfdGF7aIguUb-SJmsM_1CvcYjg'
_MD5_DATA_DOWNLOAD_LINK: str = (source)

Undocumented

Value
'121lbbeaiY-qM2tK9sJXWNuvMczVuwi2p'
_MD5_LISTS_DOWNLOAD_LINK: str = (source)

Undocumented

Value
'1nt22yiCfdGF7aIguUb-SJmsM_1CvcYjg'
_RELATIONSHIP_MAP: dict[int, str] = (source)

Undocumented

Value
{1: 'child',
 2: 'sibling',
 3: 'grandchild',
 4: 'parent',
 5: 'spouse',
 6: 'grandparent',
 7: 'great grandchild',
...

Undocumented

Value
['train', 'test', 'val']