-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
easyvolcap: control viewer init ratio for some of the datasets
- Loading branch information
Showing
7 changed files
with
97 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ val_dataloader_cfg: | |
<<: *dataset_cfg | ||
sampler_cfg: | ||
view_sample: [0, null, 20] | ||
|
||
viewer_cfg: | ||
use_window_focal: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import torch | ||
from torch.nn import functional as F | ||
|
||
from easyvolcap.utils.console_utils import * | ||
from easyvolcap.utils.chunk_utils import multi_gather | ||
from easyvolcap.utils.fcds_utils import remove_outlier | ||
|
||
|
||
def filter_global_points(points: dotdict[str, torch.Tensor] = dotdict()): | ||
|
||
def gather_from_inds(ind: torch.Tensor, scalars: dotdict()): | ||
return dotdict({k: multi_gather(v, ind[..., None]) for k, v in scalars.items()}) | ||
|
||
# Remove NaNs in point positions | ||
ind = (~points.pts.isnan())[..., 0].nonzero()[..., 0] # P, | ||
points = gather_from_inds(ind, points) | ||
|
||
# Remove low density points | ||
ind = (points.occ > 0.01)[..., 0].nonzero()[..., 0] # P, | ||
points = gather_from_inds(ind, points) | ||
|
||
# Remove statistic outliers (il_ind -> inlier indices) | ||
ind = remove_outlier(points.pts[None], K=50, std_ratio=4.0, return_inds=True)[0] # P, | ||
points = gather_from_inds(ind, points) | ||
|
||
return points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters