def getFiducials(d, offset=None):
    """Returns fiducials from the given dict as a list of (x,y) pairs, or None on error.
    The fiducials are normally translated relative to CROP_RECT_TOP_LEFT_{XY}, but you can
    give an explicit [x,y] offset if you want.
    The order of points returned is:
        left eye out
        left eye in
        right eye in
        right eye out
        mouth left
        mouth right
    """
    KEYS = 'LEFT_EYE_OUT LEFT_EYE_IN RIGHT_EYE_IN RIGHT_EYE_OUT MOUTH_LEFT MOUTH_RIGHT'.split()
    if offset is None:
        offset = [int(d['CROP_RECT_TOP_LEFT_X']), int(d['CROP_RECT_TOP_LEFT_Y'])]
    try:
        ret = [(int(d[k+'_X'])+offset[0], int(d[k+'_Y'])+offset[1]) for k in KEYS]
        return ret
    except KeyError:
        return None