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
This commit is contained in:
Amitav Baruah 2020-09-10 12:54:13 -07:00 committed by Facebook GitHub Bot
parent eb517dd70b
commit f2eb34dc7a

View File

@ -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",