Commit f2eb34dc authored by Amitav Baruah's avatar Amitav Baruah Committed by Facebook GitHub Bot
Browse files

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
parent eb517dd7
......@@ -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",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment