Class InferenceImageClassifier

Definition

Namespace:
Tizen.Multimedia.Vision
Assembly:
Tizen.Multimedia.Vision.dll

Provides the ability to classify image.

C#
Copy
public class InferenceImageClassifier : IDisposable
Inheritance
object
InferenceImageClassifier
Implements
System.IDisposable

Constructors

View Source

InferenceImageClassifier()

Initializes a new instance of the InferenceImageClassifier class.

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

The required features are not supported.

Methods

View Source

Dispose()

Releases all resources used by the InferenceImageClassifier.

Declaration
C#
Copy
public void Dispose()
View Source

Dispose(bool)

Releases the unmanaged resources used by the InferenceImageClassifier.

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

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

View Source

~InferenceImageClassifier()

Finalizes an instance of the InferenceImageClassifier class.

Declaration
C#
Copy
protected ~InferenceImageClassifier()
View Source

GetRequestResults()

Gets the labels as a result of RequestInference(MediaVisionSource).

Declaration
C#
Copy
public InferenceImageClassifierResult GetRequestResults()
Returns
Type Description
InferenceImageClassifierResult

The labels of classified image.

Remarks

If image is not classified, Labels will be empty.
This method uses about twice as much memory as Inference(MediaVisionSource).

Exceptions
Type Condition
System.ObjectDisposedException

The InferenceImageClassifier already has been disposed.

View Source

Inference(MediaVisionSource)

Classifies image synchronously.

Declaration
C#
Copy
public InferenceImageClassifierResult Inference(MediaVisionSource source)
Parameters
Type Name Description
MediaVisionSource source

The image data to classify.

Returns
Type Description
InferenceImageClassifierResult

The labels of classified image.

Remarks

Labels can be empty, if image is not classified.

Exceptions
Type Condition
System.ObjectDisposedException

The InferenceImageClassifier already has been disposed.

System.ArgumentNullException

source is null.

View Source

InferenceAsync(MediaVisionSource)

Classifies image asynchronously.

Declaration
C#
Copy
public Task<InferenceImageClassifierResult> InferenceAsync(MediaVisionSource source)
Parameters
Type Name Description
MediaVisionSource source

The image data to classify.

Returns
Type Description
System.Threading.Tasks.Task<TResult><InferenceImageClassifierResult>
Remarks

Labels can be empty, if image is not classified.
This method uses about twice as much memory as Inference(MediaVisionSource).

Exceptions
Type Condition
System.ObjectDisposedException

The InferenceImageClassifier already has been disposed.

System.ArgumentNullException

source is null.

View Source

RequestInference(MediaVisionSource)

Requests classifing image to get its labels asynchronously.

Declaration
C#
Copy
public ulong RequestInference(MediaVisionSource source)
Parameters
Type Name Description
MediaVisionSource source

The image data to classify.

Returns
Type Description
ulong

The request ID that indicates the order of requests.

Remarks

This function does not guarantee that inference is done when this method returns. The user can get the result by using GetRequestResults().
If the user calls this method again before the previous one is finished internally, the call will be ignored.
Labels can be empty, if image is not classified.
Note that this method could use about twice as much memory as Inference(MediaVisionSource).

Exceptions
Type Condition
System.ObjectDisposedException

The InferenceImageClassifier already has been disposed.

System.ArgumentNullException

source is null.

Implements

System.IDisposable