RxVerID

public class RxVerID

Reactive implementation of common Ver-ID tasks

  • Initializer

    Since

    1.0.0

    Declaration

    Swift

    public init()
  • Initializer

    Since

    1.3.0

    Declaration

    Swift

    @available(iOS 10.3, *)
    public convenience init(veridPassword: String)

    Parameters

    veridPassword

    Password to unlock P12 identity file

  • Initializer

    Since

    1.5.0

    Declaration

    Swift

    @available(iOS 10.3, *)
    public convenience init(identity: VerIDIdentity)

    Parameters

    identity

    Ver-ID SDK identity

Ver-ID instance

  • Create Ver-ID instance

    Since

    1.0.0

    Declaration

    Swift

    public var verid: Single<VerID> { get }
  • Face detection factory

    Since

    1.0.0

    Declaration

    Swift

    public var faceDetectionFactory: FaceDetectionFactory { get set }
  • Face recognition factory

    Since

    1.0.0

    Declaration

    Swift

    public var faceRecognitionFactory: FaceRecognitionFactory { get set }
  • User management factory

    Since

    1.0.0

    Declaration

    Swift

    public var userManagementFactory: UserManagementFactory { get set }

Image conversion

  • Create VerIDImage from an image from the given URL

    Since

    1.0.0

    Declaration

    Swift

    public func veridImageFromURL(_ url: URL) -> Single<VerIDImage>

    Parameters

    url

    Image URL

    Return Value

    Ver-ID image

Face detection

  • Detect faces in image URL

    Since

    1.0.0

    Declaration

    Swift

    public func detectFacesInImageURL(_ url: URL, limit: Int) -> Observable<Face>

    Parameters

    url

    Image URL

    limit

    Maximum number of faces to detect

    Return Value

    Observable whose elements are faces

  • Detect faces in Ver-ID image

    Since

    1.0.0

    Declaration

    Swift

    public func detectFacesInImage(_ image: VerIDImage, limit: Int) -> Observable<Face>

    Parameters

    image

    Image

    limit

    Maximum number of faces to detect

    Return Value

    Observable whose elements are faces

Recognizable face detection

  • Detect faces that can be used for face recognition in image URL

    Since

    1.0.0

    Declaration

    Swift

    public func detectRecognizableFacesInImageURL(_ url: URL, limit: Int) -> Observable<RecognizableFace>

    Parameters

    url

    Image URL

    limit

    Maximum number of faces to detect

    Return Value

    Observable whose elements are faces that can be used for face recognition

  • Detect faces that can be used for face recognition in Ver-ID image

    Since

    1.0.0

    Declaration

    Swift

    public func detectRecognizableFacesInImage(_ image: VerIDImage, limit: Int) -> Observable<RecognizableFace>

    Parameters

    image

    Image

    limit

    Maximum number of faces to detect

    Return Value

    Observable whose elements are faces that can be used for face recognition

Face to recognizable face conversion

  • Create face that can be used for face recognition from a detected face and Ver-ID image

    Since

    1.0.0

    Declaration

    Swift

    public func createRecognizableFaceFromFace(_ face: Face, image: VerIDImage) -> Observable<RecognizableFace>

    Parameters

    face

    Detected face

    image

    Image

    Return Value

    Observable whose elements are faces that can be used for face recognition

User identification

  • Identify users in image URL

    Since

    1.0.0

    Declaration

    Swift

    public func identifyUsersInImageURL(_ url: URL) -> Observable<(String, Float)>

    Parameters

    url

    Image URL

    Return Value

    Observable whose elements are tuples of user ID and similarity score

  • Identify users in Ver-ID image

    Since

    1.0.0

    Declaration

    Swift

    public func identifyUsersInImage(_ image: VerIDImage) -> Observable<(String, Float)>

    Parameters

    image

    Image

    Return Value

    Observable whose elements are tuples of user ID and similarity score

  • Identify users in face

    Since

    1.0.0

    Declaration

    Swift

    public func identifyUsersInFace(_ face: Recognizable) -> Observable<(String, Float)>

    Parameters

    face

    Face

    Return Value

    Observable whose elements are tuples of user ID and similarity score

Cropping image to face

  • Crop image to the bounds of a detected face

    Since

    1.0.0

    Declaration

    Swift

    public func cropImageURL(_ url: URL, toFace face: Face) -> Single<UIImage>

    Parameters

    url

    Image URL

    face

    Face whose bounds to use for cropping the image

    Return Value

    Single whose value is a UIImage cropped to the bounds of the face

Face comparison

  • Compare face to other faces

    Note

    Comparisons with scores above VerID.faceRecognition.authenticationScoreThreshold can be considered similar enough to pass authentication

    Since

    1.0.0

    Declaration

    Swift

    public func compareFace(_ face: Recognizable, toFaces faces: [Recognizable]) -> Single<Float>

    Parameters

    face

    Face to compare to other faces

    faces

    Other faces to compare to the face

    Return Value

    Single whose value is a face comparison score

User management

  • Assign faces to user

    Since

    1.0.0

    Declaration

    Swift

    public func assignFaces(_ faces: [Recognizable], toUser user: String) -> Completable

    Parameters

    faces

    Faces

    user

    User ID

  • Assign face to user

    Since

    1.0.0

    Declaration

    Swift

    public func assignFace(_ face: Recognizable, toUser user: String) -> Completable

    Parameters

    face

    Face

    user

    User ID

  • Delete user

    Since

    1.0.0

    Declaration

    Swift

    public func deleteUser(_ user: String) -> Completable

    Parameters

    user

    Identifier of the user to delete

  • Get users

    Since

    1.0.0

    Declaration

    Swift

    public var users: Observable<String> { get }

    Return Value

    Observable whose elements are identifiers of users with assigned faces

  • Get faces of user

    Since

    1.0.0

    Declaration

    Swift

    public func facesOfUser(_ user: String) -> Observable<Recognizable>

    Parameters

    user

    Identifier for the user

    Return Value

    Observable whose elements are faces of the user

User authentication

  • Authenticate user in faces

    Since

    1.0.0

    Declaration

    Swift

    public func authenticateUser(_ user: String, inFaces faces: [Recognizable]) -> Single<Bool>

    Parameters

    user

    Identifier for the user to be authenticated

    faces

    Faces to use for authentication

    Return Value

    Single whose value is a boolean (true if the user is authenticated)

  • Authenticate user in face

    Since

    1.0.0

    Declaration

    Swift

    public func authenticateUser(_ user: String, inFace face: Recognizable) -> Single<Bool>

    Parameters

    user

    Identifier for the user to be authenticated

    face

    Face to use for authentication

    Return Value

    Single whose value is a boolean (true if the user is authenticated)

  • Authenticate user in image

    Since

    1.0.0

    Declaration

    Swift

    public func authenticateUser(_ user: String, inImageURL url: URL) -> Single<Bool>

    Parameters

    user

    Identifier for the user to be authenticated

    url

    Image URL in which to find the face to use for authentication

    Return Value

    Single whose value is a boolean (true if the user is authenticated)

  • Authenticate user in image

    Since

    1.0.0

    Declaration

    Swift

    public func authenticateUser(_ user: String, inImage image: VerIDImage) -> Single<Bool>

    Parameters

    user

    Identifier for the user to be authenticated

    image

    Image in which to find the face to use for authentication

    Return Value

    Single whose value is a boolean (true if the user is authenticated)

Session result parsing

  • Get image URLs from session result

    Since

    1.0.0

    Declaration

    Swift

    public func imageURLsFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<URL>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the images

    Return Value

    Observable whose elements are URLs of images collected in the session

  • Get images from session result

    Since

    1.0.0

    Declaration

    Swift

    public func imagesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<UIImage>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the images

    Return Value

    Observable whose elements are images collected in the session

  • Get images from session result and crop them to their corresponding faces

    Since

    1.0.0

    Declaration

    Swift

    public func croppedFaceImagesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<UIImage>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the images

    Return Value

    Observable whose elements are images collected in the session cropped to their corresponding faces

  • Get faces from session result

    Since

    1.0.0

    Declaration

    Swift

    public func facesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<Face>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the faces

    Return Value

    Observable whose elements are faces collected in the session

  • Get faces that can be used for face recognition from session result

    Since

    1.0.0

    Declaration

    Swift

    public func recognizableFacesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<RecognizableFace>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the faces

    Return Value

    Observable whose elements are recognizable faces collected in the session

  • Get faces and images from session result

    Since

    1.0.0

    Declaration

    Swift

    public func facesAndImagesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<(Face, URL, Bearing)>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the elements

    Return Value

    Observable whose elements are triplets of face, URL and bearing

  • Get recognizable faces and images from session result

    Since

    1.0.0

    Declaration

    Swift

    public func recognizableFacesAndImagesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<(RecognizableFace, URL, Bearing)>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the elements

    Return Value

    Observable whose elements are triplets of recognizable face, URL and bearing

  • Get recognizable faces and images cropped to the bounding boxes of faces from session result

    Since

    1.2.0

    Declaration

    Swift

    public func recognizableFacesAndCroppedFaceImagesFromSessionResult(_ sessionResult: VerIDSessionResult, bearing: Bearing? = nil) -> Observable<(RecognizableFace, UIImage, Bearing)>

    Parameters

    sessionResult

    Session result

    bearing

    Optional face bearing by which to filter the elements

    Return Value

    Observable whose elements are triplets of recognizable face, image and bearing

Session

  • Create and run a Ver-ID session

    Note

    If the session is cancelled the maybe completes without a value. If the session fails the maybe returns an error.

    Since

    1.0.0

    Declaration

    Swift

    func session<T>(settings: T) -> Maybe<VerIDSessionResult> where T : VerIDSessionSettings

    Parameters

    settings

    Ver-ID session settings

    Return Value

    Maybe whose value is a session result if the session completes successfully

  • Create and run a Ver-ID session

    Note

    If the session is cancelled the maybe completes without a value. If the session fails the maybe returns an error.

    Since

    1.1.0

    Declaration

    Swift

    func session<T>(settings: T, translatedStrings: TranslatedStrings) -> Maybe<VerIDSessionResult> where T : VerIDSessionSettings

    Parameters

    settings

    Ver-ID session settings

    translatedStrings

    Translations

    Return Value

    Maybe whose value is a session result if the session completes successfully

  • Run a Ver-ID session

    Since

    1.4.0

    Declaration

    Swift

    func runSession(_ session: VerIDSession) -> Maybe<VerIDSessionResult>

    Parameters

    session

    Session to run

  • Create a Ver-ID session

    Since

    1.4.0

    Declaration

    Swift

    func createSession<T>(settings: T) -> Single<VerIDSession> where T : VerIDSessionSettings

    Parameters

    settings

    Session settings

  • Create a Ver-ID session

    Since

    1.4.0

    Declaration

    Swift

    func createSession<T>(settings: T, translatedStrings: TranslatedStrings) -> Single<VerIDSession> where T : VerIDSessionSettings

    Parameters

    settings

    Session settings

    translatedStrings

    Translations

  • Set video writer service factory on session

    Since

    1.4.0

    Declaration

    Swift

    func setVideoWriterFactory(_ videoWriterFactory: VideoWriterServiceFactory, on session: VerIDSession) -> Single<VerIDSession>

    Parameters

    videoWriterFactory

    Video writer service factory

    session

    Session

  • Set face detection service factory on session

    Since

    1.4.0

    Declaration

    Swift

    func setFaceDetectionFactory(_ faceDetectionFactory: FaceDetectionServiceFactory, on session: VerIDSession) -> Single<VerIDSession>

    Parameters

    faceDetectionFactory

    Face detection service factory

    session

    Session

  • Set result evaluation service factory on session

    Since

    1.4.0

    Declaration

    Swift

    func setResultEvaluationFactory(_ resultEvaluationFactory: ResultEvaluationServiceFactory, on session: VerIDSession) -> Single<VerIDSession>

    Parameters

    resultEvaluationFactory

    Result evaluation service factory

    session

    Session

  • Set image writer service factory on session

    Since

    1.4.0

    Declaration

    Swift

    func setImageWriterFactory(_ imageWriterFactory: ImageWriterServiceFactory, on session: VerIDSession) -> Single<VerIDSession>

    Parameters

    resultEvaluationFactory

    Image writer service factory

    session

    Session

  • Set session view controllers factory on session

    Since

    1.4.0

    Declaration

    Swift

    func setSessionViewControllersFactory(_ sessionViewControllersFactory: SessionViewControllersFactory, on session: VerIDSession) -> Single<VerIDSession>

    Parameters

    resultEvaluationFactory

    Session view controllers factory

    session

    Session