Skip to content

Commit f2eb34d

Browse files
Amitav Baruahfacebook-github-bot
Amitav Baruah
authored andcommitted
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
1 parent eb517dd commit f2eb34d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@
350350
" self.device = meshes.device\n",
351351
" self.renderer = renderer\n",
352352
" \n",
353-
" # Get the silhouette of the reference RGB image by finding all the non zero values. \n",
354-
" image_ref = torch.from_numpy((image_ref[..., :3].max(-1) != 0).astype(np.float32))\n",
353+
" # Get the silhouette of the reference RGB image by finding all non-white pixel values. \n",
354+
" image_ref = torch.from_numpy((image_ref[..., :3].max(-1) != 1).astype(np.float32))\n",
355355
" self.register_buffer('image_ref', image_ref)\n",
356356
" \n",
357357
" # Create an optimizable parameter for the x, y, z position of the camera. \n",

0 commit comments

Comments
 (0)