docstr: Load result file and return a result api object.
  
  :param   resFile (str)     : file name of result file
  :return: res (obj)         : result api object
docstr_tok: ["Load","result","file","and","return","a","result","api","object",".",":","param","resFile","(","str",")",":","file","name","of","result","file",":","return",":","res","(","obj",")",":","result","api","object"]
code: def loadRes(self, resFile):
      """Load result file and return a result api object.
  
      :param   resFile (str)     : file name of result file
      :return: res (obj)         : result api object
      """
      res = YTVIS()
      res.dataset["videos"] = [img for img in self.dataset["videos"]]
  
      print("Loading and preparing results...")
      tic = time.time()
      if type(resFile) == str or (
          PYTHON_VERSION == 2 and type(resFile) == str
      ):
          anns = json.load(open(resFile))
      elif type(resFile) == np.ndarray:
          anns = self.loadNumpyAnnotations(resFile)
      else:
          anns = resFile
      assert type(anns) == list, "results in not an array of objects"
      annsVidIds = [ann["video_id"] for ann in anns]
      assert set(annsVidIds) == (
          set(annsVidIds) & set(self.getVidIds())
      ), "Results do not correspond to current coco set"
      if "segmentations" in anns[0]:
          res.dataset["categories"] = copy.deepcopy(
              self.dataset["categories"]
          )
          for id, ann in enumerate(anns):
              ann["areas"] = []
              if "bboxes" not in ann:
                  ann["bboxes"] = []
              for seg in ann["segmentations"]:
                  # now only support compressed RLE format
                  # as segmentation results
                  if seg:
                      ann["areas"].append(maskUtils.area(seg))
                      if len(ann["bboxes"]) < len(ann["areas"]):
                          ann["bboxes"].append(maskUtils.toBbox(seg))
                  else:
                      ann["areas"].append(None)
                      if len(ann["bboxes"]) < len(ann["areas"]):
                          ann["bboxes"].append(None)
              ann["id"] = id + 1
              l_ori = [a for a in ann["areas"] if a]
              if len(l_ori) == 0:
                  ann["avg_area"] = 0
              else:
                  ann["avg_area"] = np.array(l_ori).mean()
              ann["iscrowd"] = 0
      print("DONE (t={:0.2f}s)".format(time.time() - tic))
  
      res.dataset["annotations"] = anns
      res.createIndex()
      return res
  
imports: import copy
  import itertools
  import json
  import sys
  import time
  from collections import defaultdict
  import numpy
  from pycocotools import mask
label_desc: Use image node_id 9 for calling the YTVIS obj's underlying member method code with example usage: obj.loadRes(resFile) and returns: res