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.8.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.8-cp313-cp313-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86-64

klygo-2.0.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

klygo-2.0.8-cp313-cp313-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

klygo-2.0.8-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.8-cp312-cp312-macosx_11_0_arm64.whl (872.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

klygo-2.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (826.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

klygo-2.0.8-cp311-cp311-macosx_11_0_arm64.whl (602.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

klygo-2.0.8-cp310-cp310-win_amd64.whl (581.4 kB view details)

Uploaded CPython 3.10Windows x86-64

klygo-2.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (478.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

klygo-2.0.8-cp310-cp310-macosx_11_0_arm64.whl (333.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: klygo-2.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 8c7d06e2bfc19fc0f396568ecbc1e745e2bc04ce37950290f891143797072be6
MD5 486c78d610558787b720632e95faf4f4
BLAKE2b-256 bad65ce2d5bf4e4b1d553284ae0a93659d02beb3829fb0814a5137342bc4db1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8.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.8-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.8-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.1 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.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 58d00e4a281db1209cd20120f64be48798204e22f94a5958dfeabc8d5ff2377e
MD5 9b5768642488f5988b6f08090a2cd483
BLAKE2b-256 f2b20f8873de20744849772b64a2ef75ae87c2565fcba1235f55368bfbe17bba

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 662c323a03c0bc9442d4feca2cc8547bd2e73e5c9be0c879acd7fc99ae529dea
MD5 43bc0b375515d734f854819d79484c1a
BLAKE2b-256 51638d4df2e987ca0c0d7665dac9b1669f08bb62f791c3bd0897ce465316ea17

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 321b4315582edda906208dd0fc80d43f9bd9707eb50b86b4db49c6bd7036f047
MD5 a1b9e7c5fe4e9e94623c1bf53b0589af
BLAKE2b-256 cc6037317c0edd685ad99e1bad9a34db779c72f66e9c662c9267e9318baefdaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.8-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.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a345bdf4100863ca728ae00b3ea903670b9ba1f39ea88eb4272791ce6cf73c9e
MD5 8322c65c48285ccdfff9172797fd6e6f
BLAKE2b-256 977b17e0d7cdc2b0570509b47a3f5ab417c2361f7e49af301c7c6ec8b10d1857

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 552dd5454e9183cc58f40661b7ca2905b1581b4b0436ad26a662149d05a3d7f5
MD5 ed2148f319b66d4c71d789566749a0c6
BLAKE2b-256 77ae1d855bed99f6e20946dbd1666361dc419ba776099d13a54bf9963b4decab

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20061b49e6a6ac540d3b4e1ec596f3871e495762f695590ae00231b1f1fbe78b
MD5 76751740a825f046981dd14c9a4eeaa8
BLAKE2b-256 7de27e4d7543064d4768a65064932dc9b2d2f4bfdb5a9c6e4546560b92de01a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.8-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.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 000949eaa97a964a65060bf02952f34fa31ab1e6619248a98a4c7aaa9220f0fc
MD5 56f0f5446eb73ab889b59dd76d9182aa
BLAKE2b-256 14a6917c46ce0d3937511b9980082c16845842670616165db24ae1965b28b308

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4f6f70c31dee60dc3c56fc02ea8a261859bfa1ddecbd6203c1d42eed5174a50
MD5 73ed793b640930cec552ef2d782b81cc
BLAKE2b-256 1e633d39b5382e0e990f83d31fc42a3b0600595695c67681e1b2f24d062b1132

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc4f0536a0ef064a14111fc3580b8b974165f55da41e19bf51fd4c93863c0998
MD5 56d7e5abf233a39f68817df946834848
BLAKE2b-256 fd218b5f5c1b24cb171e8cd8f781531254307a979b5df541ecf0bd6c8b878ec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: klygo-2.0.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 581.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.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 775d320a73391cfc95bca51bcdc54e786a1653948383a94baaeba0765c8b02c7
MD5 3fd1c1d7bccadb4c013c934c0b7fc3ac
BLAKE2b-256 327c43da36a3a4663abd9606ac54df2f11a5d5694b710ff71db9fd3d2594b40e

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6466a67043f68f536af5a7b67147fd47aa1473ea4428c2ed7461479d0a832bff
MD5 bfaa9ee9cf5ff6a7a38ef49dd904fcac
BLAKE2b-256 ba452d0c07012e6ddda5bc894a13170e36a1f7db17def656ff0ad6b1b27565db

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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.8-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for klygo-2.0.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c78d2d738a6abc8b6bd9ec14c95c95bf197911859628f167523b66e35e037450
MD5 fe1a4f2f8cb104d3694911ddb7fdb958
BLAKE2b-256 60eee20ee799b620584fd4cb4df5af67929433609f5414925d309bfd6175537e

See more details on using hashes here.

Provenance

The following attestation bundles were made for klygo-2.0.8-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