[MediaVision] Add/deprecate InferenceBackendType (#5477)
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Vision / MediaVision / InferenceType.cs
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace Tizen.Multimedia.Vision
20 {
21     /// <summary>
22     /// Specifies the type of inference backend.
23     /// </summary>
24     /// <since_tizen> 6 </since_tizen>
25     public enum InferenceBackendType
26     {
27         /// <summary>
28         /// OpenCV backend type
29         /// </summary>
30         OpenCV,
31
32         /// <summary>
33         /// Tensor Flow Lite backend type
34         /// </summary>
35         TFLite,
36
37         /// <summary>
38         /// ArmNN backend type
39         /// </summary>
40         [Obsolete("Deprecated since API11. Will be removed in API13.")]
41         ArmNN,
42
43         /// <summary>
44         /// ML Single API of NNStreamer backend type
45         /// </summary>
46         /// <remarks>
47         /// Should be set <see cref="InferenceTargetDevice"/> to <see cref="InferenceTargetDevice.Custom"/>.
48         /// </remarks>
49         /// <since_tizen> 8 </since_tizen>
50         [Obsolete("Deprecated since API11. Will be removed in API13.")]
51         MLApi,
52
53         /// <summary>
54         /// On-device Neural Engine backend type
55         /// </summary>
56         /// <remarks>
57         /// Should be set <see cref="InferenceTargetDevice"/> to <see cref="InferenceTargetDevice.CPU"/> or
58         /// <see cref="InferenceTargetDevice.GPU"/>.
59         /// </remarks>
60         /// <since_tizen> 8 </since_tizen>
61         One,
62
63         /// <summary>
64         /// NNTrainer backend type
65         /// </summary>
66         /// <since_tizen> 11 </since_tizen>
67         NNTrainer,
68
69         /// <summary>
70         /// SNPE(Snapdragon Neural Processing Engine) backend type
71         /// </summary>
72         /// <since_tizen> 11 </since_tizen>
73         Snpe
74     }
75
76     /// <summary>
77     /// Specifies the type of target. It's used for running inference backend.
78     /// </summary>
79     /// <since_tizen> 6 </since_tizen>
80     [Obsolete("Deprecated since API8; Will be removed in API10. Please use InferenceTargetDevice instead.")]
81     public enum InferenceTargetType
82     {
83         /// <summary>
84         /// CPU target
85         /// </summary>
86         CPU,
87
88         /// <summary>
89         /// GPU target
90         /// </summary>
91         GPU,
92
93         /// <summary>
94         /// Custom target
95         /// </summary>
96         Custom
97     }
98
99     /// <summary>
100     /// Specifies the target device which is used for running <see cref="InferenceModelConfiguration.Backend"/>.
101     /// </summary>
102     /// <since_tizen> 8 </since_tizen>
103     public enum InferenceTargetDevice
104     {
105         /// <summary>
106         /// CPU device
107         /// </summary>
108         CPU = 1 << 0,
109
110         /// <summary>
111         /// GPU device
112         /// </summary>
113         GPU = 1 << 1,
114
115         /// <summary>
116         /// Custom device
117         /// </summary>
118         Custom = 1 << 2
119     }
120
121     /// <summary>
122     /// Specifies the data type.
123     /// </summary>
124     /// <since_tizen> 8 </since_tizen>
125     public enum InferenceDataType
126     {
127         /// <summary>
128         /// Float 32 bit
129         /// </summary>
130         Float32,
131
132         /// <summary>
133         /// Unsigned Integer 8 bit
134         /// </summary>
135         UInt8
136     }
137 }