cvtools.cocotools.coco module¶
-
class
cvtools.cocotools.coco.
COCO
(annotation_file=None)[源代码]¶ 基类:
object
-
annToMask
(ann)[源代码]¶ Convert annotation which can be polygons, uncompressed RLE, or RLE to binary mask. :return: binary mask (numpy 2D array)
-
annToRLE
(ann)[源代码]¶ Convert annotation which can be polygons, uncompressed RLE to RLE. :return: binary mask (numpy 2D array)
-
download
(tarDir=None, imgIds=[])[源代码]¶ Download COCO images from mscoco.org server. :param tarDir (str): COCO results directory name
imgIds (list): images to be downloaded返回:
-
getAnnIds
(imgIds=[], catIds=[], areaRng=[], iscrowd=None)[源代码]¶ 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)返回: ids (int array) : integer array of ann ids
-
getCatIds
(catNms=[], supNms=[], catIds=[])[源代码]¶ 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=[])[源代码]¶ 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=[])[源代码]¶ Load anns with the specified ids. :param ids (int array) : integer ids specifying anns :return: anns (object array) : loaded ann objects
-
loadCats
(ids=[])[源代码]¶ Load cats with the specified ids. :param ids (int array) : integer ids specifying cats :return: cats (object array) : loaded cat objects
-
loadImgs
(ids=[])[源代码]¶ Load anns with the specified ids. :param ids (int array) : integer ids specifying img :return: imgs (object array) : loaded img objects
-
loadNumpyAnnotations
(data)[源代码]¶ 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)
-