Skip to main content

A Python package for converting object detection datasets between COCO, YOLO, and PASCAL VOC formats.

Project description

Datasetsconverter

datasetsconverter is a Python package for converting object detection datasets between COCO, YOLO, and PASCAL VOC formats, making it easier to work with different annotation types in computer vision projects.

Installation

Install DatasetConverter using pip:

pip install datasetsconverter

Usage

Convert COCO to YOLO

Convert COCO-formatted annotations to YOLO format.

from datasetsconverter import coco_to_yolo

coco_to_yolo(
    coco_path="path/to/coco/annotations.json",
    output_dir="path/to/output/yolo",
    image_dir="path/to/coco/images"
)

Convert YOLO to COCO

Convert YOLO annotations into COCO format.

from datasetsconverter import yolo_to_coco

yolo_to_coco(
    yolo_dir="path/to/yolo/labels",
    output_file="path/to/output/coco/annotations.json",
    image_dir="path/to/yolo/images"
)

Convert YOLO to PASCAL VOC

Transform YOLO annotations into PASCAL VOC format.

from datasetsconverter import yolo_to_pascalvoc

yolo_to_pascalvoc(
    yolo_dir="path/to/yolo/labels",
    output_dir="path/to/output/pascalvoc",
    image_dir="path/to/yolo/images"
)

Convert PASCAL VOC to YOLO

Convert PASCAL VOC annotations into YOLO format.

from datasetsconverter import pascalvoc_to_yolo

pascalvoc_to_yolo(
    pascalvoc_dir="path/to/pascalvoc/annotations",
    output_dir="path/to/output/yolo",
    image_dir="path/to/pascalvoc/images"
)

Convert COCO to PASCAL VOC

Convert COCO annotations into PASCAL VOC format.

from datasetsconverter import coco_to_pascalvoc

coco_to_pascalvoc(
    coco_path="path/to/coco/annotations.json",
    output_dir="path/to/output/pascalvoc",
    image_dir="path/to/coco/images"
)

Convert PASCAL VOC to COCO

Convert PASCAL VOC annotations into COCO format.

from datasetsconverter import pascalvoc_to_coco

pascalvoc_to_coco(
    pascalvoc_dir="path/to/pascalvoc/annotations",
    output_file="path/to/output/coco/annotations.json",
    image_dir="path/to/pascalvoc/images"
)

Project details


Download files

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

Source Distribution

datasetsconverter-0.0.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datasetsconverter-0.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file datasetsconverter-0.0.1.tar.gz.

File metadata

  • Download URL: datasetsconverter-0.0.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for datasetsconverter-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1135af99c3a179fe4d50f1c2fcc988ae580ab260edbfd6326bc5088c9fc044f5
MD5 5abd9c290c184e2f043a52c5515028ca
BLAKE2b-256 f86bf717008642dd9a647748f6767ab873eb02a21f325524a8a14f1953f3ab0d

See more details on using hashes here.

File details

Details for the file datasetsconverter-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for datasetsconverter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 40256e69a34300ea9b17760e970187b2eb97e6407f35f4a4b400c0b58f7ae043
MD5 283e7628bc3521b8e5fa0a1fb828694e
BLAKE2b-256 9ada1f450333df4992f120ae58048bb8c5e72a2c7f7c9725b0b78294d7e3af41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page