[CPU] Add support 4th and 5th input DetectionOutput (#1290)

* [CPU] Add support 4th and 5th input DetectionOutput

* fix any comments

* move reference to ngraph

* some changes for mx nms

* change namespace for ref impl
This commit is contained in:
Maxim Andronov
2020-08-07 09:05:41 +03:00
committed by GitHub
parent 8c118ef8b2
commit f9023ff7da
12 changed files with 1140 additions and 46 deletions

View File

@@ -82,18 +82,18 @@ class ActivationLayerTest : public testing::WithParamInterface<activationParams>
public:
ngraph::helpers::ActivationTypes activationType;
static std::string getTestCaseName(const testing::TestParamInfo<activationParams> &obj);
virtual InferenceEngine::Blob::Ptr GenerateInput(const InferenceEngine::InputInfo &info) const;
InferenceEngine::Blob::Ptr GenerateInput(const InferenceEngine::InputInfo &info) const override;
protected:
void SetUp();
void SetUp() override;
};
class ActivationParamLayerTest : public ActivationLayerTest {
public:
void Infer();
void Infer() override;
protected:
void SetUp();
void SetUp() override;
private:
void generateActivationBlob();

View File

@@ -0,0 +1,71 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <cstddef>
#include <vector>
#include <string>
#include <tuple>
#include "ngraph/op/detection_output.hpp"
#include "functional_test_utils/layer_test_utils.hpp"
namespace LayerTestsDefinitions {
enum {
idxLocation,
idxConfidence,
idxPriors,
idxArmConfidence,
idxArmLocation,
numInputs
};
using DetectionOutputAttributes = std::tuple<
int, // numClasses
int, // backgroundLabelId
int, // topK
std::vector<int>, // keepTopK
std::string, // codeType
float, // nmsThreshold
float, // confidenceThreshold
bool, // clip_afterNms
bool, // clip_beforeNms
bool // decreaseLabelId
>;
using ParamsWhichSizeDepends = std::tuple<
bool, // varianceEncodedInTarget
bool, // shareLocation
bool, // normalized
size_t, // inputHeight
size_t, // inputWidth
InferenceEngine::SizeVector, // "Location" input
InferenceEngine::SizeVector, // "Confidence" input
InferenceEngine::SizeVector, // "Priors" input
InferenceEngine::SizeVector, // "ArmConfidence" input
InferenceEngine::SizeVector // "ArmLocation" input
>;
using DetectionOutputParams = std::tuple<
DetectionOutputAttributes,
ParamsWhichSizeDepends,
size_t, // Number of batch
float, // objectnessScore
std::string // Device name
>;
class DetectionOutputLayerTest : public testing::WithParamInterface<DetectionOutputParams>, public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(testing::TestParamInfo<DetectionOutputParams> obj);
ngraph::op::DetectionOutputAttrs attrs;
std::vector<InferenceEngine::SizeVector> inShapes;
void Infer() override;
void Compare(const std::vector<std::uint8_t> &expected, const InferenceEngine::Blob::Ptr &actual) override;
protected:
void SetUp() override;
};
} // namespace LayerTestsDefinitions

View File

@@ -26,7 +26,7 @@ class RangeLayerTest : public testing::WithParamInterface<RangeParams>,
float start, stop, step;
public:
static std::string getTestCaseName(testing::TestParamInfo<RangeParams> obj);
void Infer();
void Infer() override;
protected:
void SetUp() override;