mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
suppress errors in vision/fair/pytorch3d
Differential Revision: D22519468 fbshipit-source-id: 6e39c2e50ef95f37df407dbc6d186cc97832fc7d
This commit is contained in:
parent
26d2cc24c1
commit
09c1762939
@ -52,6 +52,7 @@ def interpolate_face_attributes(
|
||||
pix_to_face = pix_to_face.view(-1)
|
||||
barycentric_coords = barycentric_coords.view(N * H * W * K, 3)
|
||||
args = (pix_to_face, barycentric_coords, face_attributes)
|
||||
# pyre-fixme[16]: `_InterpFaceAttrs` has no attribute `apply`.
|
||||
out = _InterpFaceAttrs.apply(*args)
|
||||
out = out.view(N, H, W, K, -1)
|
||||
return out
|
||||
@ -89,6 +90,7 @@ def interpolate_face_attributes_python(
|
||||
pix_to_face = pix_to_face.clone()
|
||||
pix_to_face[mask] = 0
|
||||
idx = pix_to_face.view(N * H * W * K, 1, 1).expand(N * H * W * K, 3, D)
|
||||
# pyre-fixme[16]: `Tensor` has no attribute `gather`.
|
||||
pixel_face_vals = face_attributes.gather(0, idx).view(N, H, W, K, 3, D)
|
||||
pixel_vals = (barycentric_coords[..., None] * pixel_face_vals).sum(dim=-2)
|
||||
pixel_vals[mask] = 0 # Replace masked values in output.
|
||||
|
Loading…
x
Reference in New Issue
Block a user