class_docstr: Flip the image & bboxes & masks & segs horizontally or vertically.
  
  When using horizontal flipping, the corresponding bbox x-coordinate needs
  to be additionally subtracted by one.
class_docstr_tok: ["Flip","the","image","&","bboxes","&","masks","&","segs","horizontally","or","vertically",".","When","using","horizontal","flipping",",","the","corresponding","bbox","x-coordinate","needs","to","be","additionally","subtracted","by","one","."]
docstr: Flip images, bounding boxes, and semantic segmentation map.
docstr_tok: ["Flip","images",",","bounding","boxes",",","and","semantic","segmentation","map","."]
code: def _flip(self, results: dict) -> None:
      """Flip images, bounding boxes, and semantic segmentation map."""
      # flip image
      results["img"] = mmcv.imflip(
          results["img"], direction=results["flip_direction"]
      )
  
      img_shape = results["img"].shape[:2]
  
      # flip bboxes
      if results.get("gt_bboxes", None) is not None:
          results["gt_bboxes"].flip_(
              img_shape, results["flip_direction"]
          )
          # Only change this line
          if results["flip_direction"] == "horizontal":
              results["gt_bboxes"].translate_([-1, 0])
  
      # TODO: check it
      # flip masks
      if results.get("gt_masks", None) is not None:
          results["gt_masks"] = results["gt_masks"].flip(
              results["flip_direction"]
          )
  
      # flip segs
      if results.get("gt_seg_map", None) is not None:
          results["gt_seg_map"] = mmcv.imflip(
              results["gt_seg_map"], direction=results["flip_direction"]
          )
  
      # record homography matrix for flip
      self._record_homography_matrix(results)
  
file_path: mmdetection/mmdet/datasets/transforms/transformers_glip.py
imports: import mmcv
  import numpy
  from mmcv.transforms import BaseTransform
  from mmdet.registry import TRANSFORMS
  from mmdet.structures.bbox import HorizontalBoxes, autocast_box_type
  from .transforms import RandomFlip
label_desc: Use image node_id 1 for calling the RandomFlip_GLIP obj's underlying member method code with example usage: obj._flip(results) without return types