Skip to content

Commit 8d21c84

Browse files
committed
Merge pull request opencv#19474 from aryanshomray:darknet_tanh
2 parents 29f5581 + 601851c commit 8d21c84

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

modules/dnn/src/darknet/darknet_io.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ namespace cv {
241241
{
242242
activation_param.type = "Sigmoid";
243243
}
244+
else if (type == "tanh")
245+
{
246+
activation_param.type = "TanH";
247+
}
244248
else
245249
{
246250
CV_Error(cv::Error::StsParseError, "Unsupported activation: " + type);

modules/dnn/test/test_darknet_importer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ TEST_P(Test_Darknet_layers, mish)
702702
testDarknetLayer("mish", true);
703703
}
704704

705+
TEST_P(Test_Darknet_layers, tanh)
706+
{
707+
testDarknetLayer("tanh");
708+
}
709+
705710
TEST_P(Test_Darknet_layers, avgpool_softmax)
706711
{
707712
testDarknetLayer("avgpool_softmax");

0 commit comments

Comments
 (0)