Class InferenceModelConfiguration
Definition
- Namespace:
- Tizen.Multimedia.Vision
- Assembly:
- Tizen.Multimedia.Vision.dll
- API Level:
- 6
- Feature:
- http://tizen.org/feature/vision.inference.facehttp://tizen.org/feature/vision.inference.image
Represents a configuration of FaceDetector, FacialLandmarkDetector, ImageClassifier and ObjectDetector.
public class InferenceModelConfiguration : EngineConfiguration, IDisposable
- Inheritance
- Implements
Remarks
'Inference model' means pre-learned data, which is represented by ConfigurationFilePath and
WeightFilePath, CategoryFilePath.
If user want to use tizen default inference model and its related value,
Please refer Tizen guide page(https://developer.tizen.org/development/guides/.net-application).
Constructors
View SourceInferenceModelConfiguration()
Initializes a new instance of the InferenceModelConfiguration class.
Declaration
public InferenceModelConfiguration()
Exceptions
Type | Condition |
---|---|
NotSupportedException | The feature is not supported. |
API Level: 6
Feature: http://tizen.org/feature/vision.inference.facehttp://tizen.org/feature/vision.inference.image
Properties
View SourceBackend
Gets or sets the inference model's backend engine.
Declaration
public InferenceBackendType Backend { get; set; }
Property Value
Type | Description |
---|---|
InferenceBackendType |
Remarks
The default backend type is OpenCV
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
NotSupportedException | The engine type is not supported. |
See Also
API Level: 6
View SourceCategoryFilePath
Gets or sets the path of inference model's category file.
Declaration
public string CategoryFilePath { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
This value should be set to use ImageClassifier or ObjectDetector.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Input file path is null. |
API Level: 6
View SourceConfidenceThreshold
Gets or sets the threshold of confidence.
Declaration
public double ConfidenceThreshold { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
The vaild range is greater than or equal to 0.0 and less than or equal to 1.0.
The value 1.0 means maximum accuracy.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
API Level: 6
View SourceConfigurationFilePath
Gets or sets the path of inference model's configuration data file.
Declaration
public string ConfigurationFilePath { get; set; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Input file path is null. |
API Level: 6
View SourceDataType
Gets or sets the type of data used for inference model.
Declaration
public InferenceDataType DataType { get; set; }
Property Value
Type | Description |
---|---|
InferenceDataType |
Remarks
For example, this value should be set to Float32 for a model data supporting float32.
Float32 will be used internally if a user doesn't set the value.
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
API Level: 8
View SourceDevice
Gets or sets the processor type for inference models.
Declaration
public InferenceTargetDevice Device { get; set; }
Property Value
Type | Description |
---|---|
InferenceTargetDevice |
Remarks
The default device is CPU.
If a device doesn't support GPU and Custom,
CPU will be used internally, despite the user's choice.
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
API Level: 8
View SourceInputNodeName
Gets or sets the name of an input node
Declaration
public string InputNodeName { get; set; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
API Level: 6
View SourceMaxOutputNumber
Gets or sets the maximum output number of detection or classification.
Declaration
public int MaxOutputNumber { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The input value over 10 will be set to 10 and the input value under 1 will be set to 1.
This value can be used to decide the size of Roi, it's length should be the same.
API Level: 6
View SourceMeanValue
Gets or sets the inference model's mean value.
Declaration
public double MeanValue { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
It should be greater than or equal to 0.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The value is invalid. |
API Level: 6
View SourceOutputNodeName
Gets or sets the name of an output node
Declaration
public IList<string> OutputNodeName { get; set; }
Property Value
Type | Description |
---|---|
IList<String> |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
API Level: 6
View SourceRoi
Gets or sets the ROI(Region Of Interest) of ImageClassifier and FacialLandmarkDetector
Declaration
public Rectangle? Roi { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Rectangle> |
Remarks
Default value is null. If Roi is null, the entire region of MediaVisionSource will be analyzed.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The width of |
See Also
API Level: 6
View SourceStdValue
Gets or sets the inference model's STD(Standard deviation) value.
Declaration
public double StdValue { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
It should be greater than or equal to 0.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The value is invalid. |
API Level: 6
View SourceSupportedBackend
Gets the list of inference backend engine which is supported in the current device.
Declaration
public IEnumerable<InferenceBackendType> SupportedBackend { get; }
Property Value
Type | Description |
---|---|
IEnumerable<InferenceBackendType> | If there's no supported backend, empty collection will be returned. |
API Level: 6
View SourceTarget
Gets or sets the inference model's target.
Declaration
[Obsolete("Deprecated since API8; Will be removed in API10. Please use Device instead.")]
public InferenceTargetType Target { get; set; }
Property Value
Type | Description |
---|---|
InferenceTargetType |
Remarks
The default target is CPU.
If target doesn't support GPU and Custom,
CPU will be used internally, despite the user's choice.
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
API Level: 6
View SourceTensorChannels
Gets or sets the number of inference model's tensor channel.
Declaration
public int TensorChannels { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
For example, for RGB colorspace this value should be set to 3
It should be greater than 0.
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | The value is invalid. |
API Level: 6
View SourceTensorSize
Gets or sets the size of inference model's tensor.
Declaration
public Size TensorSize { get; set; }
Property Value
Type | Description |
---|---|
Size |
Remarks
Both width and height of tensor should be greater than 0.
'Size(-1, -1) is allowed when the intention is to use original image source size as TensorSize.
Exceptions
Type | Condition |
---|---|
ArgumentException | Only one of |
ArgumentOutOfRangeException | The value is invalid. |
API Level: 6
View SourceWeightFilePath
Gets or sets the path of inference model's weight file.
Declaration
public string WeightFilePath { get; set; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Input file path is null. |
API Level: 6
Methods
View SourceDispose(Boolean)
Releases the resources used by the InferenceModelConfiguration object.
Declaration
protected override 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. |
Overrides
API Level: 6
View SourceLoadInferenceModel()
Loads inference model data and its related attributes.
Declaration
public void LoadInferenceModel()
Remarks
Before calling this method, user should set all properties which is required by each inference model.
The properties set after calling this method will not be affected in the result.
Exceptions
Type | Condition |
---|---|
FileNotFoundException | ConfigurationFilePath, WeightFilePath or CategoryFilePath have invalid path. |
FileFormatException | Invalid data type is used in inference model data. |
InvalidDataException | Inference model data contains unsupported operations in current backend version.
-or- |
InvalidOperationException | Internal operation error. |
UnauthorizedAccessException | The caller has no required privilege. |