class_docstr: This class assigns to each predicted "element" (e.g., a box) a ground-truth
  element. Each predicted element will have exactly zero or one matches; each
  ground-truth element may be matched to zero or more predicted elements.
  
  The matching is determined by the MxN match_quality_matrix, that characterizes
  how well each (ground-truth, prediction)-pair match each other. For example,
  if the elements are boxes, this matrix may contain box intersection-over-union
  overlap values.
  
  The matcher returns (a) a vector of length N containing the index of the
  ground-truth element m in [0, M) that matches to prediction n in [0, N).
  (b) a vector of length N containing the labels for each prediction.
docstr: Produce additional matches for predictions that have only low-quality matches.
  Specifically, for each ground-truth G find the set of predictions that have
  maximum overlap with it (including ties); for each prediction in that set, if
  it is unmatched, then match it to the ground-truth G.
  
  This function implements the RPN assignment case (i) in Sec. 3.1.2 of
  :paper:`Faster R-CNN`.
docstr_tok: ["Produce","additional","matches","for","predictions","that","have","only","low-quality","matches",".","Specifically",",","for","each","ground-truth","G","find","the","set","of","predictions","that","have","maximum","overlap","with","it","(","including","ties",")",";","for","each","prediction","in","that","set",",","if","it","is","unmatched",",","then","match","it","to","the","ground-truth","G.","This","function","implements","the","RPN","assignment","case","(","i",")","in","Sec",".","3.1.2","of",":","paper",":","`","Faster","R-CNN","`","."]
code: def set_low_quality_matches_(
      self, match_labels, match_quality_matrix
  ):
      """
      Produce additional matches for predictions that have only low-quality matches.
      Specifically, for each ground-truth G find the set of predictions that have
      maximum overlap with it (including ties); for each prediction in that set, if
      it is unmatched, then match it to the ground-truth G.
  
      This function implements the RPN assignment case (i) in Sec. 3.1.2 of
      :paper:`Faster R-CNN`.
      """
      # For each gt, find the prediction with which it has highest quality
      highest_quality_foreach_gt, _ = match_quality_matrix.max(dim=1)
      # Find the highest quality match available, even if it is low, including ties.
      # Note that the matches qualities must be positive due to the use of
      # `torch.nonzero`.
      _, pred_inds_with_highest_quality = nonzero_tuple(
          match_quality_matrix == highest_quality_foreach_gt[:, None]
      )
      # If an anchor was labeled positive only due to a low-quality match
      # with gt_A, but it has larger overlap with gt_B, it's matched index will still be gt_B.
      # This follows the implementation in Detectron, and is found to have no significant impact.
      match_labels[pred_inds_with_highest_quality] = 1
  
imports: from typing import List
  import torch
  from detectron2.layers import nonzero_tuple
label_desc: Use image node_id 3 for calling the Matcher obj's underlying member method code with example usage: obj.set_low_quality_matches_(match_labels, match_quality_matrix) without return types