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 remove_bad_samples(
      self, kp1: Tensor, kp2: Tensor
  ) -> Tuple[Tensor, Tensor]:
      """"""
      # ToDo: add (model-specific) verification of the samples,
      # E.g. constraints on not to be a degenerate sample
      if self.model_type == "homography":
          mask = sample_is_valid_for_homography(kp1, kp2)
          return kp1[mask], kp2[mask]
      return kp1, kp2
  
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 6 for calling the RANSAC obj's underlying member method code with example usage: obj.remove_bad_samples(kp1, kp2) and returns: kp1,  kp2, kp1,  kp2