jaclearn.vision.coco.pycocotools package¶
Submodules¶
jaclearn.vision.coco.pycocotools.coco module¶
-
class
jaclearn.vision.coco.pycocotools.coco.COCO(annotation_file=None)[source]¶ Bases:
object-
annToMask(ann)[source]¶ Convert annotation which can be polygons, uncompressed RLE, or RLE to binary mask. :return: binary mask (numpy 2D array)
-
annToRLE(ann)[source]¶ Convert annotation which can be polygons, uncompressed RLE to RLE. :return: binary mask (numpy 2D array)
-
download(tarDir=None, imgIds=[])[source]¶ Download COCO images from mscoco.org server. :param tarDir (str): COCO results directory name
imgIds (list): images to be downloadedReturns:
-
getAnnIds(imgIds=[], catIds=[], areaRng=[], iscrowd=None)[source]¶ Get ann ids that satisfy given filter conditions. default skips that filter :param imgIds (int array) : get anns for given imgs
catIds (int array) : get anns for given cats areaRng (float array) : get anns for given area range (e.g. [0 inf]) iscrowd (boolean) : get anns for given crowd label (False or True)Returns: ids (int array) : integer array of ann ids
-
getCatIds(catNms=[], supNms=[], catIds=[])[source]¶ filtering parameters. default skips that filter. :param catNms (str array) : get cats for given cat names :param supNms (str array) : get cats for given supercategory names :param catIds (int array) : get cats for given cat ids :return: ids (int array) : integer array of cat ids
-
getImgIds(imgIds=[], catIds=[])[source]¶ Get img ids that satisfy given filter conditions. :param imgIds (int array) : get imgs for given ids :param catIds (int array) : get imgs with all given cats :return: ids (int array) : integer array of img ids
-
loadAnns(ids=[])[source]¶ Load anns with the specified ids. :param ids (int array) : integer ids specifying anns :return: anns (object array) : loaded ann objects
-
loadCats(ids=[])[source]¶ Load cats with the specified ids. :param ids (int array) : integer ids specifying cats :return: cats (object array) : loaded cat objects
-
loadImgs(ids=[])[source]¶ Load anns with the specified ids. :param ids (int array) : integer ids specifying img :return: imgs (object array) : loaded img objects
-
loadNumpyAnnotations(data)[source]¶ Convert result data from a numpy array [Nx7] where each row contains {imageID,x1,y1,w,h,score,class} :param data (numpy.ndarray) :return: annotations (python nested list)
-
jaclearn.vision.coco.pycocotools.cocoeval module¶
-
class
jaclearn.vision.coco.pycocotools.cocoeval.COCOeval(cocoGt=None, cocoDt=None, iouType='segm')[source]¶ Bases:
object-
accumulate(p=None)[source]¶ Accumulate per image evaluation results and store the result in self.eval :param p: input params for evaluation :return: None
-
evaluate()[source]¶ Run per image evaluation on given images and store results (a list of dict) in self.evalImgs :return: None
-