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:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user