From f2eb34dc7a133b319d01d0fe0e208f385498f009 Mon Sep 17 00:00:00 2001 From: Amitav Baruah Date: Thu, 10 Sep 2020 12:54:13 -0700 Subject: [PATCH] Correctly create reference image silhouette Summary: Previously the tutorial code assumed that the reference image had a black background, resulting in an empty silhouette mask. Since the background is white, this change allows the model to find the correct silhouette mask. Reviewed By: nikhilaravi, sbranson Differential Revision: D23502202 fbshipit-source-id: c3a570f93efd480323f27cb081db0a9fb54be219 --- ..._position_optimization_with_differentiable_rendering.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb b/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb index ee879db3..2c83027a 100644 --- a/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb +++ b/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb @@ -350,8 +350,8 @@ " self.device = meshes.device\n", " self.renderer = renderer\n", " \n", - " # Get the silhouette of the reference RGB image by finding all the non zero values. \n", - " image_ref = torch.from_numpy((image_ref[..., :3].max(-1) != 0).astype(np.float32))\n", + " # Get the silhouette of the reference RGB image by finding all non-white pixel values. \n", + " image_ref = torch.from_numpy((image_ref[..., :3].max(-1) != 1).astype(np.float32))\n", " self.register_buffer('image_ref', image_ref)\n", " \n", " # Create an optimizable parameter for the x, y, z position of the camera. \n",