Skip to main content

cvtools

Computer Vision Tool Library

Introduction

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.

Installation

Try and start with

pip install cvtoolss

Note: There are two s at the end.

or install from source

git clone https://github.com/gfjiangly/cvtools.git
cd cvtools
pip install .  # (add "-e" if you want to develop or modify the codes)

example

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,
                               cls='voc/cls.txt')
voc_to_coco.convert()
voc_to_coco.save_json(to_file='voc/{}.json'.format(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)

dota_to_coco.convert()

save = 'dota/train_dota_x1y1wh_polygen.json'
dota_to_coco.save_json(save)

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/'
coco_analysis.vis_instances(save, 
                            vis='segmentation', 
                            box_format='x1y1x2y2x3y3x4y4')

# Size distribution analysis for each category
save = 'size_per_cat_data.json'
coco_analysis.stats_size_per_cat(save)

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

# Analysis of target quantity per category
save = 'objs_per_cat_data.json'
coco_analysis.stats_objs_per_cat(save)

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

# and so on...

Metadata

Release files for cvtoolss 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvtoolss 0.0.5
File Size Uploaded Provenance Actions
cvtoolss-0.0.5.tar.gz 77.1 kB Without provenance Details for cvtoolss-0.0.5.tar.gz

Release files / cvtoolss-0.0.5.tar.gz

Download URL cvtoolss-0.0.5.tar.gz
Size 77.1 kB
Tags Source
SHA-256 checksum
How to use checksums
43118c1843cd813b600a87dde144f5d009aa45821dcf0bc5b932ed9b327c117f
BLAKE2b-256 checksum
How to use checksums
00007a7ad810a39fc2fcc1d6161f27fe7b5b5b23f5ec46f7e0348e005b8939b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.1

Security for cvtoolss 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page