Class FaceRecognitionModel

Definition

Namespace:
Tizen.Multimedia.Vision
Assembly:
Tizen.Multimedia.Vision.dll
API Level:
4
Feature:
http://tizen.org/feature/vision.face_recognition

Represents the face recognition model interface.

C#
Copy
public class FaceRecognitionModel : IDisposable
Inheritance
System.Object
FaceRecognitionModel
Implements
System.IDisposable

Constructors

View Source

FaceRecognitionModel()

Initializes a new instance of the FaceRecognitionModel class.

Declaration
C#
Copy
public FaceRecognitionModel()
Exceptions
Type Condition
System.NotSupportedException

The feature is not supported.

API Level: 4
View Source

FaceRecognitionModel(String)

Initializes a new instance of the FaceRecognitionModel class with the specified path.

Declaration
C#
Copy
public FaceRecognitionModel(string modelPath)
Parameters
Type Name Description
System.String modelPath

Path to the model to load.

Remarks

Models saved by Save(String) can be loaded.

Exceptions
Type Condition
System.ArgumentNullException

modelPath is null.

System.IO.FileNotFoundException

modelPath is invalid.

System.NotSupportedException

The feature is not supported.
-or-
modelPath is not supported format.

UnauthorizedAccessException

No permission to access the specified file.

See Also
API Level: 4

Properties

View Source

Labels

Gets labels that had been learned by the model.

Declaration
C#
Copy
public int[] Labels { get; }
Property Value
Type Description
Int32[]
Exceptions
Type Condition
ObjectDisposedException

The FaceRecognitionModel has already been disposed of.

API Level: 4

Methods

View Source

Add(MediaVisionSource, Int32)

Adds the face image example to be used for face recognition model learning.

Declaration
C#
Copy
public void Add(MediaVisionSource source, int label)
Parameters
Type Name Description
MediaVisionSource source

The MediaVisionSource that contains face image.

Int32 label

The label that identifies face for which example is adding. Specify the same labels for the face images of a single person when calling this method. Has to be unique for each face.

Exceptions
Type Condition
System.ArgumentNullException

source is null.

ObjectDisposedException

The FaceRecognitionModel has already been disposed of.
-or-
source has already been dispose of.

API Level: 4
View Source

Add(MediaVisionSource, Int32, Rectangle)

Adds the face image example to be used for face recognition model learning.

Declaration
C#
Copy
public void Add(MediaVisionSource source, int label, Rectangle area)
Parameters
Type Name Description
MediaVisionSource source

The MediaVisionSource that contains face image.

Int32 label

The label that identifies face for which example is adding. Specify the same labels for the face images of a single person when calling this method. Has to be unique for each face.

Rectangle area

The rectangular region of the face image at the source image.

Exceptions
Type Condition
System.ArgumentNullException

source is null.

ObjectDisposedException

The FaceRecognitionModel has already been disposed of.
-or-
source has already been dispose of.

API Level: 4
View Source

Dispose()

Releases all the resources used by the FaceRecognitionModel object.

Declaration
C#
Copy
public void Dispose()
API Level: 4
View Source

Dispose(Boolean)

Releases the resources used by the FaceRecognitionModel object.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources.

API Level: 4
View Source

Finalize()

Finalizes an instance of the FaceRecognitionModel class.

Declaration
C#
Copy
protected void Finalize()
View Source

Learn()

Learns the face recognition model.

Declaration
C#
Copy
public void Learn()
Remarks

Before you start the learning process, face recognition models have to be filled with the training data - face image examples. These examples have to be provided by Add(MediaVisionSource, Int32) or Add(MediaVisionSource, Int32, Rectangle). Recognition accuracy is usually increased when the different examples of the identical faces are added more and more. But it depends on the used learning algorithm.

Exceptions
Type Condition
ObjectDisposedException

The FaceRecognitionModel has already been disposed of.

System.InvalidOperationException

No examples added.

API Level: 4
View Source

Learn(FaceRecognitionConfiguration)

Learns the face recognition model with FaceRecognitionConfiguration.

Declaration
C#
Copy
public void Learn(FaceRecognitionConfiguration config)
Parameters
Type Name Description
FaceRecognitionConfiguration config

The configuration used for learning of the recognition models. This value can be null.

Remarks

Before you start the learning process, face recognition models have to be filled with the training data - face image examples. These examples have to be provided by Add(MediaVisionSource, Int32) or Add(MediaVisionSource, Int32, Rectangle). Recognition accuracy is usually increased when the different examples of the identical faces are added more and more. But it depends on the used learning algorithm.

Exceptions
Type Condition
ObjectDisposedException

The FaceRecognitionModel has already been disposed of.
-or-
config has already been disposed of.

System.InvalidOperationException

No examples added.

API Level: 4
View Source

Remove(Int32)

Removes all face examples added with the specified label.

Declaration
C#
Copy
public bool Remove(int label)
Parameters
Type Name Description
Int32 label

The label that identifies face for which examples will be removed.

Returns
Type Description
Boolean

true if the examples are successfully removed; otherwise, false if there is no example labeled with the specified label.

Exceptions
Type Condition
ObjectDisposedException

The FaceRecognitionModel has already been disposed of.

API Level: 4
View Source

Reset()

Removes all face examples.

Declaration
C#
Copy
public void Reset()
Exceptions
Type Condition
ObjectDisposedException

The FaceRecognitionModel has already been disposed of.

API Level: 4
View Source

Save(String)

Saves the recognition model to the file.

Declaration
C#
Copy
public void Save(string path)
Parameters
Type Name Description
System.String path

Path to the file to save the model.

Exceptions
Type Condition
System.ArgumentNullException

path is null.

UnauthorizedAccessException

No permission to write to the specified path.

ObjectDisposedException

The FaceRecognitionModel has already been disposed of.

DirectoryNotFoundException

The directory for path does not exist.

API Level: 4

Implements

System.IDisposable