mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-20 14:20:38 +08:00
defaulted grid_sizes in points2vols
Summary: Fix #873, that grid_sizes defaults to the wrong dtype in points2volumes code, and mask doesn't have a proper default. Reviewed By: nikhilaravi Differential Revision: D31503545 fbshipit-source-id: fa32a1a6074fc7ac7bdb362edfb5e5839866a472
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2f2466f472
commit
34b1b4ab8b
@@ -5,7 +5,7 @@
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import math
|
||||
from typing import Tuple, Optional
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
@@ -364,7 +364,7 @@ def add_points_features_to_volume_densities_features(
|
||||
# grid sizes shape (minibatch, 3)
|
||||
grid_sizes = (
|
||||
torch.LongTensor(list(volume_densities.shape[2:]))
|
||||
.to(volume_densities)
|
||||
.to(volume_densities.device)
|
||||
.expand(volume_densities.shape[0], 3)
|
||||
)
|
||||
|
||||
@@ -386,6 +386,10 @@ def add_points_features_to_volume_densities_features(
|
||||
splat = False
|
||||
else:
|
||||
raise ValueError('No such interpolation mode "%s"' % mode)
|
||||
|
||||
if mask is None:
|
||||
mask = points_3d.new_ones(1).expand(points_3d.shape[:2])
|
||||
|
||||
volume_densities, volume_features = _points_to_volumes(
|
||||
points_3d,
|
||||
points_features,
|
||||
|
||||
Reference in New Issue
Block a user