From aa69fae26f6fc3a1e92258339dfa09df6a242123 Mon Sep 17 00:00:00 2001 From: Masaki Murooka Date: Fri, 7 Oct 2022 14:39:13 +0900 Subject: [PATCH] Add small value to avoid zero division to calculate rotation axis. --- SMPL++/src/smpl/BlendShape.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SMPL++/src/smpl/BlendShape.cpp b/SMPL++/src/smpl/BlendShape.cpp index a816426..207fcef 100644 --- a/SMPL++/src/smpl/BlendShape.cpp +++ b/SMPL++/src/smpl/BlendShape.cpp @@ -806,7 +806,8 @@ torch::Tensor BlendShape::rodrigues(torch::Tensor &theta) // // rotation angles and axis // - torch::Tensor angles = torch::norm(theta, 2, {2}, true);// (N, 24, 1) + const double eps = 1e-8; // small value to avoid zero division + torch::Tensor angles = torch::norm(theta + eps, 2, {2}, true);// (N, 24, 1) torch::Tensor axes = theta / angles;// (N, 24, 3) //