Skip to main content

Computer Vision Foundation Utilities

Project description


Computer Vision Tool Library


cvtools is a helpful python library for computer vision.

It provides the following functionalities.

  • Dataset Conversion(voc to coco, bdd to coco, ...)
  • Data Augmentation(random mirror, random sample crop, ...)
  • Dataset Analysis(visualization, cluster analysis, ...)
  • Image processing(crop, resize, ...)
  • Useful utilities (iou, timer, ...)
  • Universal IO APIs

See the documentation for more features and usage.


Try and start with

pip install cvtoolss

Note: There are two s at the end.

or install from source

git clone
cd cvtools
pip install .  # (add "-e" if you want to develop or modify the codes)


convert voc-like dataset to coco-like dataset

import cvtools

mode = 'train'
root = 'D:/data/VOCdevkit/VOC2007'
# The cls parameter is a file containing categories,
# one category string is one line
voc_to_coco = cvtools.VOC2COCO(root, mode=mode,

convert dota dataset to coco-like dataset.

import cvtools

# convert dota dataset to coco dataset format
# label folder
label_root = '/media/data/DOTA/train/labelTxt/'
# imgage folder
image_root = '/media/data/DOTA/train/images/'

dota_to_coco = cvtools.DOTA2COCO(label_root, image_root)


save = 'dota/train_dota_x1y1wh_polygen.json'

coco-like dataset analysis

import cvtools

# imgage folder
img_prefix = '/media/data/DOTA/train/images'
# position you save in dataset convertion.
ann_file = '../label_convert/dota/train_dota_x1y1wh_polygen.json'
coco_analysis = cvtools.COCOAnalysis(img_prefix, ann_file)

save = 'dota/vis_dota_whole/'

# Size distribution analysis for each category
save = 'size_per_cat_data.json'

# Average number of targets per image for each category
save = 'stats_num.json'

# Analysis of target quantity per category
save = 'objs_per_cat_data.json'

save = 'dota/bbox_distribution/'
coco_analysis.cluster_analysis(save, name_clusters=('area', ))

# and so on...

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cvtoolss, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size cvtoolss-0.0.5.tar.gz (77.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page