Class SingleShot
Definition
- Namespace:
- Tizen.MachineLearning.Inference
- Assembly:
- Tizen.MachineLearning.Inference.dll
- API Level:
- 6
The SingleShot class loads a Machine Learning model and make inferences from input data.
C#Copypublic class SingleShot : IDisposable
- Inheritance
-
System.ObjectSingleShot
- Implements
-
System.IDisposable
Constructors
SingleShot(String, NNFWType, HWType, Boolean)
Loads the neural network model and configures runtime environment without TensorsInfo
Declaration
C#Copypublic SingleShot(string modelAbsPath, NNFWType fwType = NNFWType.Any, HWType hwType = HWType.Any, bool isDynamicMode = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | modelAbsPath | Absolute path to the neural network model file. |
NNFWType | fwType | Types of Neural Network Framework (Default:NNFWType.Any) |
HWType | hwType | Types of hardware resources to be used for NNFWs (Default: HWType.Any) |
Boolean | isDynamicMode | Support Dynamic Mode (Default: false) |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
System.NotSupportedException | Thrown when the feature is not supported. |
API Level: 8
Feature: http://tizen.org/feature/machine_learning.inference
SingleShot(String, TensorsInfo, TensorsInfo)
Loads the neural network model and configures runtime environment
Declaration
C#Copypublic SingleShot(string modelAbsPath, TensorsInfo inTensorsInfo, TensorsInfo outTensorsInfo)
Parameters
Type | Name | Description |
---|---|---|
System.String | modelAbsPath | Absolute path to the neural network model file. |
TensorsInfo | inTensorsInfo | Input TensorsInfo object |
TensorsInfo | outTensorsInfo | Output TensorsInfo object for inference result |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
System.NotSupportedException | Thrown when the feature is not supported. |
API Level: 6
Feature: http://tizen.org/feature/machine_learning.inference
SingleShot(String, TensorsInfo, TensorsInfo, NNFWType, HWType, Boolean)
Loads the neural network model and configures runtime environment with Neural Network Framework and HW information
Declaration
C#Copypublic SingleShot(string modelAbsPath, TensorsInfo inTensorsInfo, TensorsInfo outTensorsInfo, NNFWType fwType, HWType hwType, bool isDynamicMode)
Parameters
Type | Name | Description |
---|---|---|
System.String | modelAbsPath | Absolute path to the neural network model file. |
TensorsInfo | inTensorsInfo | Input TensorsInfo object |
TensorsInfo | outTensorsInfo | Output TensorsInfo object for inference result |
NNFWType | fwType | Types of Neural Network Framework |
HWType | hwType | Types of hardware resources to be used for NNFWs |
Boolean | isDynamicMode | Support Dynamic Mode |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
System.NotSupportedException | Thrown when the feature is not supported. |
API Level: 8
Feature: http://tizen.org/feature/machine_learning.inference
Properties
Input
The information (tensor dimension, type, name and so on) of required input data for the given model.
Declaration
C#Copypublic TensorsInfo Input { get; set; }
Property Value
Type | Description |
---|---|
TensorsInfo |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported. |
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
API Level: 8
Output
The information (tensor dimension, type, name and so on) of output data for the given model.
Declaration
C#Copypublic TensorsInfo Output { get; }
Property Value
Type | Description |
---|---|
TensorsInfo |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported. |
API Level: 8
Methods
Declaration
C#Copypublic void Dispose()
API Level: 6
Dispose(Boolean)
Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
Declaration
C#Copyprotected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | If true, disposes any disposable objects. If false, does not dispose disposable objects. |
Declaration
C#Copyprotected void Finalize()
API Level: 6
Declaration
C#Copypublic string GetValue(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The property name |
Returns
Type | Description |
---|---|
System.String | The property value |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported, or given property is not available. |
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
API Level: 8
Feature: http://tizen.org/feature/machine_learning.inference
Declaration
C#Copypublic TensorsData Invoke(TensorsData inTensorsData)
Parameters
Type | Name | Description |
---|---|---|
TensorsData | inTensorsData | The input data to be inferred. |
Returns
Type | Description |
---|---|
TensorsData | TensorsData instance which contains the inferred result. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
System.TimeoutException | Thrown when failed to get the result from sink element. |
System.NotSupportedException | Thrown when the feature is not supported. |
API Level: 6
Feature: http://tizen.org/feature/machine_learning.inference
SetTimeout(Int32)
Sets the maximum amount of time to wait for an output, in milliseconds.
Declaration
C#Copypublic void SetTimeout(int ms)
Parameters
Type | Name | Description |
---|---|---|
Int32 | ms | The time to wait for an output (milliseconds) |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported. |
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |
API Level: 8
Feature: http://tizen.org/feature/machine_learning.inference
SetValue(String, String)
Sets the property value for the given model.
A model/framework may support changing the model information, such as tensor dimension and data layout, after opening the model.
If tries to change unavailable property or the model does not allow changing the information, this will raise an exception.
For the details about the properties, see 'tensor_filter' plugin definition in NNStreamer.
Declaration
C#Copypublic void SetValue(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The property name |
System.String | value | The property value |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when the feature is not supported, or given property is not available. |
System.ArgumentException | Thrown when the method failed due to an invalid parameter. |