cvtools.label_convert package¶
Subpackages¶
Submodules¶
- cvtools.label_convert.arcsoft_to_coco module
- cvtools.label_convert.bdd_to_coco module
- cvtools.label_convert.coco_to_dets module
- cvtools.label_convert.coco_to_jiang module
- cvtools.label_convert.dota_to_coco module
- cvtools.label_convert.jiang_to_coco module
- cvtools.label_convert.voc_to_coco module
- cvtools.label_convert.voc_to_darknet module
Module contents¶
-
class
cvtools.label_convert.
VOC2COCO
(root, mode='train', cls=['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'], cls_replace=None, use_xml_name=True, read_test=False)[源代码]¶ 基类:
object
convert voc-like dataset to coco-like dataset
参数: - root (str) -- path include images, xml, file list
- mode (str) -- 'train', 'val', 'trainval', 'test'. used to find file list.
- cls (str or list) -- class name in a file or a list.
- cls_replace (dict) -- a dictionary for replacing class name. if not needed, you can just ignore it.
- use_xml_name (bool) -- image filename source, if true, using the same name as xml for the image, otherwise using 'filename' in xml context for the image.
- read_test (bool) -- Test if the picture can be read normally.
-
class
cvtools.label_convert.
VOC2DarkNet
(voc_root, mode, classes=['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'], use_xml_name=True, read_test=False)[源代码]¶ 基类:
object
-
class
cvtools.label_convert.
DOTA2COCO
(label_root, image_root, classes=['large-vehicle', 'swimming-pool', 'helicopter', 'bridge', 'plane', 'ship', 'soccer-ball-field', 'basketball-court', 'ground-track-field', 'small-vehicle', 'harbor', 'baseball-diamond', 'tennis-court', 'roundabout', 'storage-tank'], path_replace=None, box_form='x1y1wh')[源代码]¶ 基类:
object
convert DOTA labels to coco-like format labels.
参数: - label_root (str) -- label file path, for example, '/home/data/DOTA/train/labelTxt'
- image_root (str) -- image path, for example, '/home/data/DOTA/train/images'
- classes (str or list) -- class name in a file or a list.
- path_replace (dict) -- replace same things in images path, if not needed, you can just ignore it.
- box_form (str) -- coco bbox format, default 'x1y1wh'.