Commit Graph
2 Commits
Author SHA1 Message Date
a78ca29470 Speed up mask sampling with rejection sampling (#2585)
* change masked pixel sampling to use rejection sampling instead of torch.nonzero

* black reformat code

* pyright unbound variable num_valid

* pyright type issues with num_valid

* add configuration settings for rejection sampling masks

* black reformat

* maybe this fixes it?

* revert behavior if mask sampling failed, still raise warning

* on iteration failure, use non-rejection sampling to generate indices

* ruff

---------

Co-authored-by: adrian_chang <adrian.chang@visionsystemsinc.com>
Co-authored-by: Alexander Kristoffersen <akristoffersen@berkeley.edu>
2024-01-18 18:21:44 +00:00
anc2001andBrent Yi 805e6e702d fix pixel sampling with masks issue when data is list (#2369)
Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-09-14 16:11:15 +00:00