1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2021-02-21 20:14:09 +00:00
28 changed files with 104 additions and 36 deletions
+4
View File
@@ -241,6 +241,10 @@ namespace cv {
{
activation_param.type = "Sigmoid";
}
else if (type == "tanh")
{
activation_param.type = "TanH";
}
else
{
CV_Error(cv::Error::StsParseError, "Unsupported activation: " + type);
+2 -2
View File
@@ -54,11 +54,11 @@ public:
for (int i = 0; i < ratios.size(); ++i)
{
float ratio = ratios.get<float>(i);
float width = std::floor(baseSize / sqrt(ratio) + 0.5f);
float height = std::floor(width * ratio + 0.5f);
for (int j = 0; j < scales.size(); ++j)
{
float scale = scales.get<float>(j);
float width = std::floor(baseSize / sqrt(ratio) + 0.5f);
float height = std::floor(width * ratio + 0.5f);
widths.push_back(scale * width);
heights.push_back(scale * height);
}
@@ -735,6 +735,11 @@ TEST_P(Test_Darknet_layers, mish)
testDarknetLayer("mish", true);
}
TEST_P(Test_Darknet_layers, tanh)
{
testDarknetLayer("tanh");
}
TEST_P(Test_Darknet_layers, avgpool_softmax)
{
testDarknetLayer("avgpool_softmax");