class_docstr: Translate the images, bboxes, masks and segmentation maps horizontally
  or vertically.
  
  Args:
      level (int | float): The level for Translate and should be in
          range [0,_MAX_LEVEL].
      prob (float): The probability for performing translation and
          should be in range [0, 1].
      img_fill_val (int | float | tuple): The filled value for image
          border. If float, the same fill value will be used for all
          the three channels of image. If tuple, the should be 3
          elements (e.g. equals the number of channels for image).
      seg_ignore_label (int): The fill value used for segmentation map.
          Note this value must equals ``ignore_label`` in ``semantic_head``
          of the corresponding config. Default 255.
      direction (str): The translate direction, either "horizontal"
          or "vertical".
      max_translate_offset (int | float): The maximum pixel's offset for
          Translate.
      random_negative_prob (float): The probability that turns the
          offset negative.
      min_size (int | float): The minimum pixel for filtering
          invalid bboxes after the translation.
class_docstr_tok: ["Translate","the","images",",","bboxes",",","masks","and","segmentation","maps","horizontally","or","vertically",".","Args",":","level","(","int","|","float",")",":","The","level","for","Translate","and","should","be","in","range","[","0",",","_MAX_LEVEL","]",".","prob","(","float",")",":","The","probability","for","performing","translation","and","should","be","in","range","[","0",",","1","]",".","img_fill_val","(","int","|","float","|","tuple",")",":","The","filled","value","for","image","border",".","If","float",",","the","same","fill","value","will","be","used","for","all","the","three","channels","of","image",".","If","tuple",",","the","should","be","3","elements","(","e.g",".","equals","the","number","of","channels","for","image",")",".","seg_ignore_label","(","int",")",":","The","fill","value","used","for","segmentation","map",".","Note","this","value","must","equals","``","ignore_label","``","in","``","semantic_head","``","of","the","corresponding","config",".","Default","255.","direction","(","str",")",":","The","translate","direction",",","either","``","horizontal","''","or","``","vertical","''",".","max_translate_offset","(","int","|","float",")",":","The","maximum","pixel","'s","offset","for","Translate",".","random_negative_prob","(","float",")",":","The","probability","that","turns","the","offset","negative",".","min_size","(","int","|","float",")",":","The","minimum","pixel","for","filtering","invalid","bboxes","after","the","translation","."]
docstr: Shift bboxes horizontally or vertically, according to offset.
docstr_tok: ["Shift","bboxes","horizontally","or","vertically",",","according","to","offset","."]
code: def _translate_bboxes(self, results, offset):
      """Shift bboxes horizontally or vertically, according to offset."""
      h, w, c = results["img_shape"]
      for key in results.get("bbox_fields", []):
          min_x, min_y, max_x, max_y = np.split(
              results[key], results[key].shape[-1], axis=-1
          )
          if self.direction == "horizontal":
              min_x = np.maximum(0, min_x + offset)
              max_x = np.minimum(w, max_x + offset)
          elif self.direction == "vertical":
              min_y = np.maximum(0, min_y + offset)
              max_y = np.minimum(h, max_y + offset)
  
          # the boxs translated outside of image will be filtered along with
          # the corresponding masks, by invoking ``_filter_invalid``.
          results[key] = np.concatenate(
              [min_x, min_y, max_x, max_y], axis=-1
          )
  
imports: import copy
  import cv2
  import mmcv
  import numpy
  from ..builder import PIPELINES
  from .compose import Compose
label_desc: Use image node_id 3 for calling the Translate obj's underlying member method code with example usage: obj._translate_bboxes(results, offset) without return types