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

lama inpainting issue fixed

This commit is contained in:
Abhishek Gola
2026-05-27 18:02:18 +05:30
parent bf0cf34963
commit 13dd2f5293
+4 -1
View File
@@ -195,8 +195,11 @@ public:
virtual bool fuseBatchNorm(const Ptr<Layer>& bnlayer) override
{
BatchNorm2Layer* bn = dynamic_cast<BatchNorm2Layer*>(bnlayer.get());
// addResidual means the graph order is conv->add->bn: the residual is added
// before BN, but the conv applies the fused BN scale only to conv(x), not to
// the residual. Refuse so BN stays separate and runs on (conv + residual).
if (fusedBatchNorm || !bn || bn->inputs.size() > 1 ||
fastActivation != FAST_ACTIV_NONE || !activ.empty())
fastActivation != FAST_ACTIV_NONE || !activ.empty() || addResidual)
return false;
fuseBatchNormWeights(bn);
fusedBatchNorm = true;