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

Merge branch 4.x

This commit is contained in:
Alexander Smorkalov
2024-02-16 18:45:22 +03:00
26 changed files with 441 additions and 89 deletions
+1
View File
@@ -212,6 +212,7 @@ void initializeLayerFactory()
CV_DNN_REGISTER_LAYER_CLASS(SigmoidInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(TanHInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(SwishInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(HardSwishInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(MishInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(ELUInt8, ActivationLayerInt8);
CV_DNN_REGISTER_LAYER_CLASS(BNLLInt8, ActivationLayerInt8);
@@ -267,6 +267,8 @@ public:
res = std::make_shared<ngraph::op::Elu>(input, 1.0f);
} else if (type == "MishInt8") {
res = std::make_shared<ngraph::op::v4::Mish>(input);
} else if (type == "HardSwishInt8") {
res = std::make_shared<ngraph::op::v4::HSwish>(input);
} else if (type == "AbsValInt8") {
res = std::make_shared<ngraph::op::Abs>(input);
} else if (type == "SigmoidInt8") {
@@ -939,6 +939,8 @@ void TFLiteImporter::parseActivation(const Operator& op, const std::string& opco
y = std::min(std::max(x, 0.f), 6.f);
else if (opcode == "LOGISTIC")
y = 1.0f / (1.0f + std::exp(-x));
else if (opcode == "HARD_SWISH")
y = x * max(0.f, min(1.f, x / 6.f + 0.5f));
else
CV_Error(Error::StsNotImplemented, "Lookup table for " + opcode);