Skip to main content

Python utilities for archive, config and zero-shot detection

Project description

klygo

Thư viện Python hỗ trợ xử lý ZIP, quản lý dataset YOLO, đọc/ghi cấu hình và ảnh, nhận diện vật thể zero-shot, crop và trực quan hóa kết quả.

Cài đặt

git clone https://github.com/IchigoMazone/klygo.git
cd klygo
uv sync

Các package

  • klygo.archive: nén, giải nén, tìm kiếm, kiểm tra, chỉnh sửa, gộp và chia ZIP.
  • klygo.datasets: partition, repartition, unpartition, merge, split và remap dataset YOLO.
  • klygo.io: đọc/ghi YAML, JSON, TOML; đọc ảnh bằng PIL hoặc OpenCV.
  • klygo.models: nhận diện zero-shot trên ảnh, thư mục ảnh và video.
  • klygo.visualize: hiển thị, vẽ bbox, crop, đọc crop và thống kê dataset.

Sử dụng nhanh

Archive

import klygo.archive as ar

ar.compress("dataset", "dataset.zip", overwrite=True)
ar.extract("dataset.zip", output_dir="extracted", overwrite=True)
files = ar.search("dataset.zip", "images/*.jpg")

Dataset YOLO

import klygo.datasets as ds

ds.partition(
    source="raw_dataset.zip",
    target="dataset",
    ratios=(0.8, 0.1, 0.1),
    overwrite=True,
)

info = ds.get_dataset_info("dataset")
print(info)

Đọc cấu hình và ảnh

import klygo.io as io

config = io.Config("config.yaml").read()
pil_images = io.read_images("dataset/images", backend="pil")
opencv_images = io.read_images("dataset/images", backend="opencv")

Model

from klygo.models import Model

model = Model()

predictions = model.predict(
    source="dataset/images",
    prompt="car. person.",
)

detected_frames = model.detect(
    source="traffic.mp4",
    output_path="detected.mp4",
    annotated_dir="annotated",
    dataset_dir="generated_dataset",
    prompt="car. person.",
)

detection_results = model.detect(
    source="dataset/images",
    prompt="car. person.",
    metadata=True,
)

crop_results = model.crop(
    source="traffic.mp4",
    target="crops",
    prompt="car. person.",
)

Visualize

import klygo.visualize as vis

grid = vis.read_crops("crops")  # lưới 5 x 5 mặc định
vis.show_image(grid, title="Detected objects")

saved_detections = vis.read_detections("annotated")

Quy ước đường dẫn

  • source: file hoặc thư mục đầu vào.
  • *_path: đường dẫn file.
  • *_dir: đường dẫn thư mục.
  • target: file hoặc thư mục đầu ra linh hoạt.

Tài liệu chi tiết

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

klygo-2.0.9.tar.gz (67.5 kB view details)

Uploaded Source

Built Distributions

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

klygo-2.0.9-cp313-cp313-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.13Windows x86-64

klygo-2.0.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

klygo-2.0.9-cp313-cp313-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

klygo-2.0.9-cp312-cp312-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.12Windows x86-64

klygo-2.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

klygo-2.0.9-cp312-cp312-macosx_11_0_arm64.whl (894.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

klygo-2.0.9-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

klygo-2.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (849.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

klygo-2.0.9-cp311-cp311-macosx_11_0_arm64.whl (616.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

klygo-2.0.9-cp310-cp310-win_amd64.whl (590.4 kB view details)

Uploaded CPython 3.10Windows x86-64

klygo-2.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (490.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

klygo-2.0.9-cp310-cp310-macosx_11_0_arm64.whl (340.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file klygo-2.0.9.tar.gz.

File metadata

  • Download URL: klygo-2.0.9.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for klygo-2.0.9.tar.gz
Algorithm Hash digest
SHA256 454ef4c424b85b332062b54e0426d45cb7eb6c4e878e97e47d1c55cad4800837
MD5 cad0d4200c4d8509771473047c9d1753
BLAKE2b-256 91852b98c3734129293926e0aeea70422c35fd53cc62a005c771ec3999842ca3

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9.tar.gz:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for klygo-2.0.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 39878efdfed16810b14ea0a10b2219f7331b1b2a1a13ea6f32dfb120806eda24
MD5 e93a382ce9ad7571849b64af7ae7caca
BLAKE2b-256 f01cb90ce8850aa43bd571aa00307608adf42a44078394b56385dab5fef1e06f

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9b2fab2cbdbe954ee731878614f0a7cf90bfb9c8b86deb1416c583522b0eaf8
MD5 4730290cf72a9fbb4dbf7a1a24bf02a2
BLAKE2b-256 2505ae2ea895d751d2de696d1a663745482ddaaf197b572a4f49ba2a0c221ca2

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb5fcf46a534bb0b744fced596f5113e9ed80fefacc43a46ea289e86012ebaa1
MD5 90cd38e2cd948b527f2e64c19dc7402e
BLAKE2b-256 6a6d1befaef5063687f06ec06a22452e9bdd4143d53ead1efcf4d064da30723c

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for klygo-2.0.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e8e964eca1a798e4e74cd36c9a61c6a21b3b5807d8edcf9f02a874796f89960
MD5 117e68e9d9b69a40b5eec5fef40d45fb
BLAKE2b-256 e0e3c3b10d1ac17e43491f0c028d71a145b03b9b92d48f17c47948533148be32

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6444520c8d73f1794ac11661cf0fea06e9fcd363c77ebb4438dda3e8545830e3
MD5 40247ec618abbe501b8944098547ff0c
BLAKE2b-256 45a341d7b9677baa8d1c5714c937ef5eed3f63e3b3fc0cb11a2571eded98e0c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d89d155bf45de640037a3b1b1dc4ae4e5ef861a3a5ff0c0a4c165032537f80a
MD5 4fcc5e823d626cebc59fbf3d27cd70cb
BLAKE2b-256 ba4847fc31d28e9c23722547ee71a673ee177ea00b18048325dc2735a3a220e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for klygo-2.0.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5c40f7f91ead521e639c9b9f905b505b9292c9a11d28161f01e049b500a313fb
MD5 265655ddb5a9bc607b765b10a6c58513
BLAKE2b-256 a021c5d5b66d7f930472bd4a675eb07fe78f6fa145280ffb794a886772cc3c53

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp311-cp311-win_amd64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2b0ccbb4dd17cd759fc7a4afd2406571ed9a90c34631b47ef4600310c6a7dd2e
MD5 385b0468a247b937d31c7664243a97ab
BLAKE2b-256 30fa11ae7398f1125475caa5db9698453dbccaa792f2c13f9e71e8bec342bd31

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 de358c89fecd4f4b5978bd1b6ce6327ad7d14f5a0eae6e6776f8763fb077f443
MD5 cfdca174daa4c2b7fd562a88082224e1
BLAKE2b-256 4bcce561ac4bc211077f783383c8356b419bff5e7e20c66b778acd9dcb572257

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.9-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 590.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for klygo-2.0.9-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 143e83c32a4d6194e75ae7eb43f9865638c90d4ddf9e83e828081548a569a783
MD5 9414e7108c38782aeebc13c6be1232f8
BLAKE2b-256 5664c1b3cdc5d19c1954d059e89de1eda7f4f6feabedd015f2ceb2a4d37e3013

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp310-cp310-win_amd64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5c4f034ec972afa4b2aed25280d08da5770630f5291fd80d768a5200869881b
MD5 4f6f267dbdb500e16bb750c05be22be7
BLAKE2b-256 74338ea1500ddb00da94fa6c50ed079bcd1ea24b258026b60f95afb0d63ed27d

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file klygo-2.0.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82c6c270f1c34eb2718145cfb19cdd94b82c6ff38eadc5d580bcd832360b62c2
MD5 d66c450957664d16fc83fd1d9e755fb7
BLAKE2b-256 519cae8425adb726e4df6f347801df673f37fa6fb9433145f6b943ccaff5428d

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.9-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on IchigoMazone/klygo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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