def fatcross_faces(stats):
    """Use labelled component statistics to select obverse/reverse faces.

    Ignoring the background (first labelled component), select the two largest
    components by pixel area.  These should correspond to the obverse and
    reverse faces for a 'standard' tablet shape (assuming good segmentation).
    Obverse and reverse labels are assigned by sorting label values, as the
    obverse face is above the reverse and should have a lower label.

    If the tablet is not photographed on a black background, has a particularly
    unusual shape, or is too fragmented, incorrect results are likely.

    Args:
        stats (np.ndarray, dtype 'int32', num_comp x 5): Component statistics,
            as described in fatcross_components.

    Returns:
        obv (int or None): Label value corresponding to obverse face, 
            unless fewer than two labelled areas exist in stats.
        rev (int or None): Label value corresponding to reverse face, 
            unless fewer than two labelled areas exist in stats.

    """
    areas = []
    for obj in range(stats.shape[0]):
        if obj >= 1:   # ignore background
            areas.append((obj, stats[obj, 4]))
    sorted_areas = sorted(areas, key=lambda x: x[1])

    if len(sorted_areas) >= 2:
        face_labels = [x[0] for x in sorted_areas[-2:]]
        obv, rev = min(face_labels), max(face_labels)
    else:
        obv, rev = None, None
    return obv, rev