mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
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:
parent
eb517dd70b
commit
f2eb34dc7a
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user