using (var config = new InferenceModelConfiguration()
{
WeightFilePath = TestHelper.TFLitePath + "face_detector/not.found",
- //MeanValue = 127.5,
- //StdValue = 127.5,
- //ConfidenceThreshold = 0.3,
- //Backend = InferenceBackendType.TFLite,
- //Device = InferenceTargetDevice.CPU,
- //TensorSize = new Size(300, 300),
- //TensorChannels = 3,
- //InputNodeName = "normalized_input_image_tensor",
- //OutputNodeName = new string[]
- //{
- // "TFLite_Detection_PostProcess",
- // "TFLite_Detection_PostProcess:1",
- // "TFLite_Detection_PostProcess:2",
- // "TFLite_Detection_PostProcess:3"
- //}
})
{
Assert.Throws<FileNotFoundException>(() => config.LoadInferenceModel());
}
}
+ [Test]
+ [Category("P1")]
+ [Description("Check whether Target returns correct default value.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PDV")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Target_CHECK_DEFAULT_VALUE()
+ {
+ Assert.That(_config.Target, Is.EqualTo(InferenceTargetType.CPU));
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Check whether Target returns correct value.")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PRW")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Target_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.Target = InferenceTargetType.GPU;
+ Assert.IsInstanceOf<InferenceTargetType>(_config.Target, "Should return InferenceTargetType instance");
+ Assert.AreEqual(InferenceTargetType.GPU, _config.Target, "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.");
+ }
+
+ [Test]
+ [Category("P2")]
+ [Description("Check whether Target throws exception if parameter is invalid")]
+ [Property("SPEC", "Tizen.Multimedia.Vision.InferenceModelConfiguration.Target A")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "PEX")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Target_THROWS_IF_PARAM_IS_INVALID()
+ {
+ Assert.Throws<ArgumentException>(() => _config.Target = (InferenceTargetType)10);
+ }
+
[Test]
[Category("P1")]
[Description("Check whether Device returns correct default value.")]