[MediaVision][TCSACR-318] Add and deprecate enumerations 27/233227/3
authorTae-Young Chung <ty83.chung@samsung.com>
Wed, 13 May 2020 06:25:36 +0000 (15:25 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Thu, 4 Jun 2020 10:11:46 +0000 (19:11 +0900)
Change-Id: Ic744c2580d1d7f3c7d9ff325a200eb66b5583069
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSFaceDetector.cs
tct-suite-vs/Tizen.MediaVision.Tests/testcase/TSInferenceModelConfiguration.cs
tct-suite-vs/Tizen.MediaVision.Tests/testcase/support/InferenceFaceTestBase.cs
tct-suite-vs/Tizen.MediaVision.Tests/testcase/support/InferenceImageTestBase.cs

index ae90307..efcbe4a 100644 (file)
@@ -73,7 +73,8 @@ namespace Tizen.Multimedia.Vision.Tests
             _fdConfig.StdValue = 127.5;
             _fdConfig.ConfidenceThreshold = 0.3;
             _fdConfig.Backend = InferenceBackendType.TFLite;
-            _fdConfig.Target = InferenceTargetType.CPU;
+            _fdConfig.Device = InferenceTargetDevice.CPU;
+            _fdConfig.DataType = InferenceDataType.Float32;
             _fdConfig.TensorSize = new Size(300, 300);
             _fdConfig.TensorChannels = 3;
             _fdConfig.InputNodeName = "normalized_input_image_tensor";
index 633a233..9d2c19f 100644 (file)
@@ -75,7 +75,8 @@ namespace Tizen.Multimedia.Vision.Tests
             config.StdValue = 127.5;
             config.ConfidenceThreshold = 0.3;
             config.Backend = InferenceBackendType.TFLite;
-            config.Target = InferenceTargetType.CPU;
+            config.Device = InferenceTargetDevice.CPU;
+            config.DataType = InferenceDataType.Float32;
             config.TensorSize = new Size(300, 300);
             config.TensorChannels = 3;
             config.InputNodeName = "normalized_input_image_tensor";
@@ -124,7 +125,7 @@ namespace Tizen.Multimedia.Vision.Tests
                 //StdValue = 127.5,
                 //ConfidenceThreshold = 0.3,
                 //Backend = InferenceBackendType.TFLite,
-                //Target = InferenceTargetType.CPU,
+                //Device = InferenceTargetDevice.CPU,
                 //TensorSize = new Size(300, 300),
                 //TensorChannels = 3,
                 //InputNodeName = "normalized_input_image_tensor",
@@ -362,48 +363,93 @@ namespace Tizen.Multimedia.Vision.Tests
 
         [Test]
         [Category("P1")]
-        [Description("Check whether Target returns correct default value.")]
-        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+        [Description("Check whether Device returns correct default value.")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Device A")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "PDV")]
         [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
-        public void Target_CHECK_DEFAULT_VALUE()
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void Device_CHECK_DEFAULT_VALUE()
         {
-            Assert.That(_config.Target, Is.EqualTo(InferenceTargetType.CPU));
+            Assert.That(_config.Device, Is.EqualTo(InferenceTargetDevice.CPU));
         }
 
         [Test]
         [Category("P1")]
-        [Description("Check whether Target returns correct value.")]
-        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+        [Description("Check whether Device returns correct value.")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Device A")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "PRW")]
         [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
-        public void Target_READ_WRITE()
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void Device_READ_WRITE()
         {
-            _config.Target = InferenceTargetType.CPU;
-            Assert.IsInstanceOf<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
-            Assert.AreEqual(InferenceTargetType.CPU, _config.Target, "Should be got same value.");
+            _config.Device = InferenceTargetDevice.CPU;
+            Assert.IsInstanceOf<InferenceTargetDevice>(_config.Device, "Should return InferenceTargetDevice instance");
+            Assert.AreEqual(InferenceTargetDevice.CPU, _config.Device, "Should be got same value.");
 
-            _config.Target = InferenceTargetType.GPU;
-            Assert.IsInstanceOf<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
-            Assert.AreEqual(InferenceTargetType.GPU, _config.Target, "Should be got same value.");
+            _config.Device = InferenceTargetDevice.GPU;
+            Assert.IsInstanceOf<InferenceTargetDevice>(_config.Device, "Should return InferenceTargetDevice instance");
+            Assert.AreEqual(InferenceTargetDevice.GPU, _config.Device, "Should be got same value.");
 
-            _config.Target = InferenceTargetType.Custom;
-            Assert.IsInstanceOf<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
-            Assert.AreEqual(InferenceTargetType.Custom, _config.Target, "Should be got same value.");
+            _config.Device = InferenceTargetDevice.Custom;
+            Assert.IsInstanceOf<InferenceTargetDevice>(_config.Device, "Should return InferenceTargetDevice instance");
+            Assert.AreEqual(InferenceTargetDevice.Custom, _config.Device, "Should be got same value.");
         }
 
         [Test]
         [Category("P2")]
-        [Description("Check whether Target throws exception if parameter is invalid")]
-        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+        [Description("Check whether Device throws exception if parameter is invalid")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Device A")]
         [Property("SPEC_URL", "-")]
         [Property("CRITERIA", "PEX")]
         [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
-        public void Target_THROWS_IF_PARAM_IS_INVALID()
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void Device_THROWS_IF_PARAM_IS_INVALID()
         {
-            Assert.Throws<ArgumentException>(() => _config.Target = (InferenceTargetType)10);
+            Assert.Throws<ArgumentException>(() => _config.Device = (InferenceTargetDevice)10);
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check whether DataType returns correct default value.")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.DataType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PDV")]
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void DataType_CHECK_DEFAULT_VALUE()
+        {
+            Assert.That(_config.DataType, Is.EqualTo(InferenceDataType.Float32));
+        }
+
+        [Test]
+        [Category("P1")]
+        [Description("Check whether DataType returns correct value.")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.DataType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PRW")]
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void DataType_READ_WRITE()
+        {
+            _config.DataType = InferenceDataType.Float32;
+            Assert.IsInstanceOf<InferenceDataType>(_config.DataType, "Should return InferenceDataType instance");
+            Assert.AreEqual(InferenceDataType.Float32, _config.DataType, "Should be got same value.");
+
+            _config.DataType = InferenceDataType.UInt8;
+            Assert.IsInstanceOf<InferenceDataType>(_config.DataType, "Should return InferenceDataType instance");
+            Assert.AreEqual(InferenceDataType.UInt8, _config.DataType, "Should be got same value.");
+        }
+
+        [Test]
+        [Category("P2")]
+        [Description("Check whether DataType throws exception if parameter is invalid")]
+        [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.DataType A")]
+        [Property("SPEC_URL", "-")]
+        [Property("CRITERIA", "PEX")]
+        [Property("AUTHOR", "TaeYoung Chung, ty83.chung@samsung.com")]
+        public void DataType_THROWS_IF_PARAM_IS_INVALID()
+        {
+            Assert.Throws<ArgumentException>(() => _config.DataType = (InferenceDataType)10);
         }
 
         [Test]
index cf064b3..76e7ada 100644 (file)
@@ -54,7 +54,8 @@ namespace Tizen.Multimedia.Vision.Tests
             _fdConfig.StdValue = 127.5;
             _fdConfig.ConfidenceThreshold = 0.3;
             _fdConfig.Backend = InferenceBackendType.TFLite;
-            _fdConfig.Target = InferenceTargetType.CPU;
+            _fdConfig.Device = InferenceTargetDevice.CPU;
+            _fdConfig.DataType = InferenceDataType.Float32;
             _fdConfig.TensorSize = new Size(300, 300);
             _fdConfig.TensorChannels = 3;
             _fdConfig.InputNodeName = "normalized_input_image_tensor";
@@ -70,7 +71,8 @@ namespace Tizen.Multimedia.Vision.Tests
             _fldConfig.MeanValue = 0.0;
             _fldConfig.StdValue = 1.0;
             _fldConfig.Backend = InferenceBackendType.TFLite;
-            _fldConfig.Target = InferenceTargetType.CPU;
+            _fldConfig.Device = InferenceTargetDevice.CPU;
+            _fldConfig.DataType = InferenceDataType.Float32;
             _fldConfig.TensorSize = new Size(128, 128);
             _fldConfig.TensorChannels = 3;
             _fldConfig.InputNodeName = "INPUT_TENSOR_NAME";
index 770fe6b..f78acf9 100644 (file)
@@ -50,7 +50,8 @@ namespace Tizen.Multimedia.Vision.Tests
             _odConfig.StdValue = 127.0;
             _odConfig.ConfidenceThreshold = 0.6;
             _odConfig.Backend = InferenceBackendType.TFLite;
-            _odConfig.Target = InferenceTargetType.CPU;
+            _odConfig.Device = InferenceTargetDevice.CPU;
+            _odConfig.DataType = InferenceDataType.Float32;
             _odConfig.TensorSize = new Size(224, 224);
             _odConfig.TensorChannels = 3;
             _odConfig.InputNodeName = "input_2";
@@ -62,7 +63,8 @@ namespace Tizen.Multimedia.Vision.Tests
             _icConfig.StdValue = 127.5;
             _icConfig.ConfidenceThreshold = 0.3;
             _icConfig.Backend = InferenceBackendType.TFLite;
-            _icConfig.Target = InferenceTargetType.CPU;
+            _icConfig.Device = InferenceTargetDevice.CPU;
+            _icConfig.DataType = InferenceDataType.Float32;
             _icConfig.TensorSize = new Size(300, 300);
             _icConfig.TensorChannels = 3;
             _icConfig.InputNodeName = "normalized_input_image_tensor";