try
{
_fdConfig = new InferenceModelConfiguration();
- }
- catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Inference) == false ||
- FeatureChecker.IsSupported(Features.InferenceFaceDetection) == false)
- {
- _isInferenceSupported = false;
- }
- if (_fdConfig.SupportedBackend.Any())
- {
- _fdConfig.WeightFilePath = TestHelper.TFLitePath + "face_detector/fd_tflite_model1.tflite";
- _fdConfig.MeanValue = 127.5;
- _fdConfig.StdValue = 127.5;
- _fdConfig.ConfidenceThreshold = 0.3;
- _fdConfig.Backend = InferenceBackendType.TFLite;
- _fdConfig.Target = InferenceTargetType.CPU;
- _fdConfig.TensorSize = new Size(300, 300);
- _fdConfig.TensorChannels = 3;
- _fdConfig.InputNodeName = "normalized_input_image_tensor";
- _fdConfig.OutputNodeName = new string[]
+ if (_fdConfig.SupportedBackend.Any() &&
+ _fdConfig.SupportedBackend.Contains(InferenceBackendType.TFLite))
{
- "TFLite_Detection_PostProcess",
- "TFLite_Detection_PostProcess:1",
- "TFLite_Detection_PostProcess:2",
- "TFLite_Detection_PostProcess:3"
- };
+ Configure();
+ }
+ else
+ {
+ _isInferenceSupported = false;
+ }
}
- else
+ catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Inference) == false ||
+ FeatureChecker.IsSupported(Features.InferenceFaceDetection) == false)
{
_isInferenceSupported = false;
}
_fdConfig?.Dispose();
}
+ private void Configure()
+ {
+ _fdConfig.WeightFilePath = TestHelper.TFLitePath + "face_detector/fd_tflite_model1.tflite";
+ _fdConfig.MeanValue = 127.5;
+ _fdConfig.StdValue = 127.5;
+ _fdConfig.ConfidenceThreshold = 0.3;
+ _fdConfig.Backend = InferenceBackendType.TFLite;
+ _fdConfig.Target = InferenceTargetType.CPU;
+ _fdConfig.TensorSize = new Size(300, 300);
+ _fdConfig.TensorChannels = 3;
+ _fdConfig.InputNodeName = "normalized_input_image_tensor";
+ _fdConfig.OutputNodeName = new string[]
+ {
+ "TFLite_Detection_PostProcess",
+ "TFLite_Detection_PostProcess:1",
+ "TFLite_Detection_PostProcess:2",
+ "TFLite_Detection_PostProcess:3"
+ };
+ }
+
[Test]
[Category("P1")]
[Description("Tests face detection")]
{
_fdConfig = new InferenceModelConfiguration();
_fldConfig = new InferenceModelConfiguration();
+
+ if (_fdConfig.SupportedBackend.Any() &&
+ _fdConfig.SupportedBackend.Contains(InferenceBackendType.TFLite))
+ {
+ Configure();
+ }
+ else
+ {
+ Assert.Pass("Backend engine is not supported.");
+ }
}
catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Inference) == false ||
FeatureChecker.IsSupported(Features.InferenceFaceDetection) == false)
{
Log.Info("Tizen.MediaVision.Tests", $"Supported engine : {iter}");
}
-
- if (_fdConfig.SupportedBackend.Any() &&
- _fdConfig.SupportedBackend.Contains(InferenceBackendType.TFLite))
- {
- Configure();
- }
- else
- {
- Assert.Pass("Backend engine is not supported.");
- }
}
[TearDown]
{
_odConfig = new InferenceModelConfiguration();
_icConfig = new InferenceModelConfiguration();
+
+ if (_odConfig.SupportedBackend.Any() &&
+ _odConfig.SupportedBackend.Contains(InferenceBackendType.TFLite))
+ {
+ Configure();
+ }
+ else
+ {
+ Assert.Pass("Backend engine is not supported.");
+ }
}
catch (NotSupportedException) when (FeatureChecker.IsSupported(Features.Inference) == false ||
FeatureChecker.IsSupported(Features.ImageClassification) == false)
{
Assert.Pass("object detection is not supported");
}
-
- if (_odConfig.SupportedBackend.Any() &&
- _odConfig.SupportedBackend.Contains(InferenceBackendType.TFLite))
- {
- Configure();
- }
- else
- {
- Assert.Pass("Backend engine is not supported.");
- }
}
[TearDown]