Skip to main content

pycvt

Install

pip install pycvt --upgrade

dev

uv sync

Usage

from pycvt import (
    load_yolo_annotations,
    save_yolo_annotations,
    load_yolo_names,
    convert_yolo_dataset_to_coco,
    prepare_yolo_dataset_for_coco,
    draw_bounding_boxes,
    xyxy2xywh,
    xywh2xyxy,
    xyxy2xywhn,
    xywhn2xyxy,
    box_iou,
    generate_sliding_windows,
    crop_with_bbox,
    sliding_crop,
    scale_boxes,
    get_color,
    example_file,
)

"load_yolo_annotations", # to load yolo format annotations from a file
"save_yolo_annotations", # to save yolo format annotations to a file
"load_yolo_names",      # to load class names from a yolo names file
"convert_yolo_dataset_to_coco", # convert a YOLO data.yaml dataset into RF-DETR/COCO layout
"prepare_yolo_dataset_for_coco", # prepare a shared converted dataset directory with file locking
"draw_bounding_boxes",  # to draw bounding boxes on an image
"xyxy2xywh",            # convert bounding box from (x1, y1, x2, y2) to (x_center, y_center, width, height)
"xywh2xyxy",            # convert bounding box from (x_center, y_center, width, height) to (x1, y1, x2, y2)
"xyxy2xywhn",           # convert bounding box from (x1, y1, x2, y2) to normalized (x_center, y_center, width, height)
"xywhn2xyxy",           # convert bounding box from normalized (x_center, y_center, width, height) to (x1, y1, x2, y2)
"box_iou",              # calculate Intersection over Union (IoU) between two sets of boxes
"generate_sliding_windows",  # generate sliding window coordinates for an image
"crop_with_bbox",         # crop image regions with bounding boxes and adjust boxes accordingly
"sliding_crop",         # crop an image using sliding windows
"scale_boxes",          # scale bounding boxes by a factor
"get_color",             # get a color for a given class id
"example_file",            # one example file for testing purposes  

YOLO Predict CLI

pycvt 提供了一个基于 Ray 的 YOLO 数据集预测工具,详细用法见 doc/yolo-pred.md

YOLO To COCO

from pycvt import convert_yolo_dataset_to_coco

summary = convert_yolo_dataset_to_coco(
    yaml_path="data.yaml",
    output_dir="output/rfdetr-dataset",
    copy_images=False,
    overwrite=False,
    include_test=True,
    num_workers=8,
)
print(summary)

Download files

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

Source Distribution

pycvt-0.1.0.post202607181215.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

pycvt-0.1.0.post202607181215-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file pycvt-0.1.0.post202607181215.tar.gz.

File metadata

  • Download URL: pycvt-0.1.0.post202607181215.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycvt-0.1.0.post202607181215.tar.gz
Algorithm Hash digest
SHA256 3668f9f2e893b416fb6c06f8227b0b33fc6fb4ade86a457afb2a1532361a006f
MD5 c638c8b98b1a00901405d36779be8e8c
BLAKE2b-256 f9459613851e2abf91800ede15c354789543350e94b1d0526733a9210e71a12b

See more details on using hashes here.

File details

Details for the file pycvt-0.1.0.post202607181215-py3-none-any.whl.

File metadata

  • Download URL: pycvt-0.1.0.post202607181215-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pycvt-0.1.0.post202607181215-py3-none-any.whl
Algorithm Hash digest
SHA256 af346a2998a091d0a3ab8e21176e14da98ec3ca129f8366e4b5f8267e6e625f1
MD5 20574f7bef374f70188fce8ad7629467
BLAKE2b-256 b7ef69238c434e28e5a49673c2572f41c7d306bcdb026c44e093e4d9e7e144a9

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 Sentry Error logging StatusPage Status page