class_docstr: Module for robust geometry estimation with RANSAC. https://en.wikipedia.org/wiki/Random_sample_consensus.
  
  Args:
      model_type: type of model to estimate: "homography", "fundamental", "fundamental_7pt",
          "homography_from_linesegments".
      inliers_threshold: threshold for the correspondence to be an inlier.
      batch_size: number of generated samples at once.
      max_iterations: maximum batches to generate. Actual number of models to try is ``batch_size * max_iterations``.
      confidence: desired confidence of the result, used for the early stopping.
      max_local_iterations: number of local optimization (polishing) iterations.
class_docstr_tok: ["Module","for","robust","geometry","estimation","with","RANSAC",".","https",":","\/\/en.wikipedia.org\/wiki\/Random_sample_consensus",".","Args",":","model_type",":","type","of","model","to","estimate",":","``","homography","''",",","``","fundamental","''",",","``","fundamental_7pt","''",",","``","homography_from_linesegments","''",".","inliers_threshold",":","threshold","for","the","correspondence","to","be","an","inlier",".","batch_size",":","number","of","generated","samples","at","once",".","max_iterations",":","maximum","batches","to","generate",".","Actual","number","of","models","to","try","is","``","batch_size","*","max_iterations","``",".","confidence",":","desired","confidence","of","the","result",",","used","for","the","early","stopping",".","max_local_iterations",":","number","of","local","optimization","(","polishing",")","iterations","."]
code: def verify(
      self, kp1: Tensor, kp2: Tensor, models: Tensor, inl_th: float
  ) -> Tuple[Tensor, Tensor, float]:
      if len(kp1.shape) == 2:
          kp1 = kp1[None]
      if len(kp2.shape) == 2:
          kp2 = kp2[None]
      batch_size = models.shape[0]
      if self.model_type == "homography_from_linesegments":
          errors = self.error_fn(
              kp1.expand(batch_size, -1, 2, 2),
              kp2.expand(batch_size, -1, 2, 2),
              models,
          )
      else:
          errors = self.error_fn(
              kp1.expand(batch_size, -1, 2),
              kp2.expand(batch_size, -1, 2),
              models,
          )
      inl = errors <= inl_th
      models_score = inl.to(kp1).sum(dim=1)
      best_model_idx = models_score.argmax()
      best_model_score = models_score[best_model_idx].item()
      model_best = models[best_model_idx].clone()
      inliers_best = inl[best_model_idx]
      return model_best, inliers_best, best_model_score
  
file_path: kornia/kornia/geometry/ransac.py
imports: import math
  from functools import partial
  from typing import Callable, Optional, Tuple
  import torch
  from kornia.core import Device, Module, Tensor, zeros
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.geometry import find_fundamental, find_homography_dlt, find_homography_dlt_iterated, find_homography_lines_dlt, find_homography_lines_dlt_iterated, symmetrical_epipolar_distance
  from kornia.geometry.homography import line_segment_transfer_error_one_way, oneway_transfer_error, sample_is_valid_for_homography
label_desc: Use image node_id 5 for calling the RANSAC obj's underlying member method code with example usage: obj.verify(kp1, kp2, models, inl_th) and returns: model_best,  inliers_best,  best_model_score