UserManager

Class for managing users in Ver-ID

Package com.appliedrec.ver_id

public class UserManager

Constructor

UserManager

Introduced in version 3.1.0

public UserManager()

Methods

assignFaceTemplatesToUser

Introduced in version 4.2.0

public assignFaceTemplatesToUser(FaceTemplate[], String)

Assign face templates to a user If a user record with the given identifier does not exist it will be created. If any of the face templates are already assigned to a different user they will be reassigned to the specified user. If any of the face templates is the last remaining template for the user to whom they were previously assigned the user will be deleted. This method replaces the less performant com.appliedrec.ver_id.UserManager.html#addFaceTemplatesToUser(FaceTemplate[], String).

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to assign to the user
user java.lang.String
Identifier for the user

Throws

java.lang.Exception

assignFaceTemplatesToUser

Introduced in version 4.2.0

public assignFaceTemplatesToUser(FaceTemplate[], String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#assignFaceTemplatesToUser(FaceTemplate[], String)

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to assign to the user
user java.lang.String
Identifier for the user
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

deleteFaceTemplates

Introduced in version 4.2.0

public deleteFaceTemplates(FaceTemplate[])

Delete face templates If the given face templates are the last remaining face templates for a user the user will be deleted.

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to delete

Throws

java.lang.Exception

deleteFaceTemplates

Introduced in version 4.2.0

public deleteFaceTemplates(FaceTemplate[], UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#deleteFaceTemplates(FaceTemplate[])

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to delete
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

addFaceTemplatesToUser

Introduced in version 3.1.0

Deprecated in 4.2.0

public addFaceTemplatesToUser(FaceTemplate[], String)

Add face templates to a user identified by a string If a user record with the given identifier does not exist it will be created. If any of the face templates are already associated with another user they will be duplicated. To avoid this use com.appliedrec.ver_id.UserManager.html#assignFaceTemplatesToUser(FaceTemplate[], String) instead.

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to associate with the user
user java.lang.String
Identifier for the user

Throws

java.lang.Exception

addFaceTemplatesToUser

Introduced in version 3.1.0

Deprecated in 4.2.0

public addFaceTemplatesToUser(FaceTemplate[], String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#addFaceTemplatesToUser(FaceTemplate[], String)

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates to associate with the user
user java.lang.String
Identifier for the user
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

getFaceTemplatesForUser

Introduced in version 3.1.0

public getFaceTemplatesForUser(String)

Retrieve user's face templates

Parameters

user java.lang.String
Identifier for the user for whom to retrieve templates

Returns

com.appliedrec.ver_id.model.FaceTemplate[]
Array of face templates associated with the user

Throws

java.lang.Exception

getFaceTemplatesForUser

Introduced in version 3.1.0

public getFaceTemplatesForUser(String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#getFaceTemplatesForUser(String)

Parameters

user java.lang.String
Identifier for the user for whom to retrieve templates
callback com.appliedrec.ver_id.UserManager.Callback<FaceTemplate>
Invoked on the main thread when the task finishes

removeFaceTemplatesFromUser

Introduced in version 3.1.0

Deprecated in 4.2.0

public removeFaceTemplatesFromUser(FaceTemplate[], String)

Remove face templates from a user Face templates that are not associated with the user will be ignored. This method is replaced by the better-performing com.appliedrec.ver_id.UserManager.html#deleteFaceTemplates(FaceTemplate[]).

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Face templates to dissassociate from the user
user java.lang.String
Identifier for the user from whom to remove the templates

Throws

java.lang.Exception

removeFaceTemplatesFromUser

Introduced in version 3.1.0

Deprecated in 4.2.0

public removeFaceTemplatesFromUser(FaceTemplate[], String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#removeFaceTemplatesFromUser(FaceTemplate[], String)

Parameters

faceTemplates com.appliedrec.ver_id.model.FaceTemplate[]
Face templates to dissassociate from the user
user java.lang.String
Identifier for the user from whom to remove the templates
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

getUsers

Introduced in version 3.1.0

public getUsers()

Retrieve a list of user identifiers who are associated with at least one face template

Returns

java.lang.String[]

Throws

java.lang.Exception

getUsers

Introduced in version 3.1.0

public getUsers(UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#getUsers()

Parameters

callback com.appliedrec.ver_id.UserManager.Callback<String>
Invoked on the main thread when the task finishes

identifyUsersInFaceTemplate

Introduced in version 4.2.0

public identifyUsersInFaceTemplate(FaceTemplate, VerID.SecurityLevel)

Identify users whose face templates match the given face template

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to which to compare user face templates
securityLevel com.appliedrec.ver_id.VerID.SecurityLevel
Security level to use at comparison. Set to {@literal null} to use the default Ver-ID security level ({@link VerID#getSecurityLevel()})

Returns

java.lang.String[]
Identifiers for users whose faces are similar to the supplied face template.

Throws

java.lang.Exception

identifyUsersInFaceTemplate

Introduced in version 3.1.0

Deprecated in 4.2.0. Use identifyUsersInFaceTemplate(FaceTemplate, VerID.SecurityLevel) instead

public identifyUsersInFaceTemplate(FaceTemplate, Float)

Identify users whose face templates match the given face template

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to which to compare user face templates
similarityThreshold java.lang.Float
Value between `0.0` and `1.0` or `nil` to use a default value of `0.5`

Returns

java.lang.String[]
Identifiers for users whose face templates' distance to the given template is greater than the similarity threshold

Throws

java.lang.Exception

identifyUsersInFaceTemplate

Introduced in version 3.1.0

Deprecated in 4.2.0. Use identifyUsersInFaceTemplate(FaceTemplate, VerID.SecurityLevel, Callback) instead.

public identifyUsersInFaceTemplate(FaceTemplate, Float, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#identifyUsersInFaceTemplate(FaceTemplate, Float)

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to which to compare user face templates
similarityThreshold java.lang.Float
Value between `0.0` and `1.0` or `nil` to use a default value of `0.5`
callback com.appliedrec.ver_id.UserManager.Callback<String>
Invoked on the main thread when the task finishes

identifyUsersInFaceTemplate

Introduced in version 4.2.0

public identifyUsersInFaceTemplate(FaceTemplate, VerID.SecurityLevel, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#identifyUsersInFaceTemplate(FaceTemplate, VerID.SecurityLevel)

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to which to compare user face templates
securityLevel com.appliedrec.ver_id.VerID.SecurityLevel
Security level to use at comparison. Set to {@literal null} to use the default Ver-ID security level ({@link VerID#getSecurityLevel()})
callback com.appliedrec.ver_id.UserManager.Callback<String>
nvoked on the main thread when the task finishes

compareFaceTemplateToUser

Introduced in version 3.1.0

public compareFaceTemplateToUser(FaceTemplate, String)

Compare a face template to templates of a given user

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to compare
user java.lang.String
User to whose face templates the given face template will be compared to

Returns

float
Similarity score ranging from `0.0` (no similarity) to `1.0` (same)

Throws

java.lang.Exception

compareFaceTemplateToUser

Introduced in version 3.1.0

public compareFaceTemplateToUser(FaceTemplate, String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#compareFaceTemplateToUser(FaceTemplate, String)

Parameters

faceTemplate com.appliedrec.ver_id.model.FaceTemplate
Face template to compare
user java.lang.String
User to whose face templates the given face template will be compared to
callback com.appliedrec.ver_id.UserManager.Callback<Float>
Invoked on the main thread when the task finishes

removeUser

Introduced in version 3.1.0

public removeUser(String)

Remove user record and its associated face templates

Parameters

userId java.lang.String
User identifier

Throws

java.lang.Exception

removeUser

Introduced in version 3.1.0

public removeUser(String, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#removeUser(String)

Parameters

userId java.lang.String
User identifier
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

removeUsers

Introduced in version 4.1.0

public removeUsers(String[])

Remove user records and their associated face templates

Parameters

userIds java.lang.String[]
Identifiers of the users to delete

Throws

java.lang.Exception

removeUsers

Introduced in version 3.1.0

public removeUsers(String[], UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#removeUsers(String[])

Parameters

userIds java.lang.String[]
Identifiers of the users to delete
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes

exportFaceTemplates

Introduced in version 3.1.0

public exportFaceTemplates()

Export all face templates

Returns

java.util.Map<String, FaceTemplate>
Map of face templates keyed by user identifiers

Throws

java.lang.Exception

exportFaceTemplates

Introduced in version 3.1.0

public exportFaceTemplates(UserManager.Callback>)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#exportFaceTemplates()

Parameters

callback com.appliedrec.ver_id.UserManager.Callback<Map>
Invoked on the main thread when the task finishes

importFaceTemplates

Introduced in version 3.1.0

public importFaceTemplates(Map)

Import user records Note: If the user exists templates will be appended to the user record

Parameters

faceTemplates java.util.Map<String, FaceTemplate>
Map of face templates keyed by user identifiers to import

Throws

java.lang.Exception

importFaceTemplates

Introduced in version 3.1.0

public importFaceTemplates(Map, UserManager.Callback)

Asynchronous version of com.appliedrec.ver_id.UserManager.html#importFaceTemplates(Map)

Parameters

faceTemplates java.util.Map<String, FaceTemplate>
Map of face templates keyed by user identifiers to import
callback com.appliedrec.ver_id.UserManager.Callback<Void>
Invoked on the main thread when the task finishes