def __init__(self, initial_matcher: Optional[LocalFeature] = None, fast_matcher: Optional[nn.Module] = None, ransac: Optional[nn.Module] = None, minimum_inliers_num: int = 30) -> None: super().__init__() self.initial_matcher = initial_matcher or (LocalFeatureMatcher( GFTTAffNetHardNet(3000), DescriptorMatcher('smnn', 0.95))) self.fast_matcher = fast_matcher or LoFTR('outdoor') self.ransac = ransac or RANSAC('homography', inl_th=5.0, batch_size=4096, max_iter=10, max_lo_iters=10) self.minimum_inliers_num = minimum_inliers_num # placeholders self.target: torch.Tensor self.target_initial_representation: Dict[str, torch.Tensor] = {} self.target_fast_representation: Dict[str, torch.Tensor] = {} self.previous_homography: Optional[torch.Tensor] = None self.reset_tracking()
def test_pretrained_indoor_smoke(self, device, dtype): loftr = LoFTR('indoor').to(device, dtype) assert loftr is not None
def test_pretrained_indoor_smoke(self, device): if device == torch.device('cpu'): loftr = LoFTR('indoor').to(device)