MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / fps

Function fps

utils/general_utils.py:186–194  ·  view source on GitHub ↗
(x, k)

Source from the content-addressed store, hash-verified

184 return idx.long(), dists.view(b, n, k)
185
186def fps(x, k):
187 b, n, _ = x.shape
188 x = x.view(-1, 3).contiguous()
189 offset = torch.full((b,), n, dtype=torch.long, device=x.device)
190 new_offset = torch.full((b,), k, dtype=torch.long, device=x.device)
191 offset = torch.cumsum(offset, dim=0).int()
192 new_offset = torch.cumsum(new_offset, dim=0).int()
193 idx = furthestsampling(x, offset, new_offset).long()
194 return idx

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected