docstr: Filp the image and bounding box.
  Operators:
      1. Flip the image numpy.
      2. Transform the bboxes' x coordinates.
        (Must judge whether the coordinates are normalized!)
      3. Transform the segmentations' x coordinates.
        (Must judge whether the coordinates are normalized!)
  Output:
      sample: the image, bounding box and segmentation part
              in sample are flipped.
docstr_tok: ["Filp","the","image","and","bounding","box",".","Operators",":","1",".","Flip","the","image","numpy",".","2",".","Transform","the","bboxes","'","x","coordinates",".","(","Must","judge","whether","the","coordinates","are","normalized","!",")","3",".","Transform","the","segmentations","'","x","coordinates",".","(","Must","judge","whether","the","coordinates","are","normalized","!",")","Output",":","sample",":","the","image",",","bounding","box","and","segmentation","part","in","sample","are","flipped","."]
code: def apply(self, sample, context=None):
      """Filp the image and bounding box.
      Operators:
          1. Flip the image numpy.
          2. Transform the bboxes' x coordinates.
            (Must judge whether the coordinates are normalized!)
          3. Transform the segmentations' x coordinates.
            (Must judge whether the coordinates are normalized!)
      Output:
          sample: the image, bounding box and segmentation part
                  in sample are flipped.
      """
      if np.random.uniform(0, 1) < self.prob:
          im = sample["image"]
          height, width = im.shape[:2]
          im = self.apply_image(im)
          if "gt_bbox" in sample and len(sample["gt_bbox"]) > 0:
              sample["gt_bbox"] = self.apply_pts(
                  sample["gt_bbox"], width
              )
          if "gt_poly" in sample and len(sample["gt_poly"]) > 0:
              sample["gt_poly"] = self.apply_pts(
                  sample["gt_poly"], width
              )
  
          sample["flipped"] = True
          sample["image"] = im
      return sample
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  from numbers import Number, Integral
  import cv2
  import numpy
  import math
  import copy
  from .operators import register_op, BaseOperator
  from ppdet.modeling.rbox_utils import poly2rbox_le135_np, poly2rbox_oc_np, rbox2poly_np
  from ppdet.utils.logger import setup_logger
  from ppdet.utils.compact import imagedraw_textsize_c
label_desc: Use image node_id 4 for calling the RandomRFlip obj's underlying member method code with example usage: obj.apply(sample, context) and returns: sample