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.12.tar.gz (78.9 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.12-cp313-cp313-win_amd64.whl (536.4 kB view details)

Uploaded CPython 3.13Windows x86-64

klygo-2.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (812.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

klygo-2.0.12-cp313-cp313-macosx_11_0_arm64.whl (439.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

klygo-2.0.12-cp312-cp312-win_amd64.whl (533.8 kB view details)

Uploaded CPython 3.12Windows x86-64

klygo-2.0.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (810.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

klygo-2.0.12-cp312-cp312-macosx_11_0_arm64.whl (439.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

klygo-2.0.12-cp311-cp311-win_amd64.whl (529.1 kB view details)

Uploaded CPython 3.11Windows x86-64

klygo-2.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (805.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

klygo-2.0.12-cp311-cp311-macosx_11_0_arm64.whl (437.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

klygo-2.0.12-cp310-cp310-win_amd64.whl (296.2 kB view details)

Uploaded CPython 3.10Windows x86-64

klygo-2.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

klygo-2.0.12-cp310-cp310-macosx_11_0_arm64.whl (251.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: klygo-2.0.12.tar.gz
  • Upload date:
  • Size: 78.9 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.12.tar.gz
Algorithm Hash digest
SHA256 be95facbb437534ac3c86db677331506d3d3665c51aee97cfd947bf2a1d0eb59
MD5 727a1ea31394a188c6edb5ae53a5dd18
BLAKE2b-256 136c5f4312a8c6ef6fd944597deaddef5a252a941e72b1f6c471511795ef7056

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: klygo-2.0.12-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 536.4 kB
  • 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.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 145aa72945cd2c769dc0d3fc4514661e9223f6bb1a1739979ff90f877e96f02f
MD5 3a706f1f0581d1f23532d02ac3db8cfc
BLAKE2b-256 7340b69f6a65823121765144194e2763bd04f030db9fb90c40515262c70ae8e0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 905cc738ba7721a94f89851cbb2ce473ef0e1dd5673233e3a441f8df92a9d1e4
MD5 56acd48599c9fe054bda20463905906c
BLAKE2b-256 4e2e119c1a53e9a6b7a7ff63c6003f4a080a4cb083fb12c8d90000a5865b72cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b778d60f783e81c54a59b8877f99dee30be0389bdd58bf3c94bb433da029694
MD5 851656a9a56ebf514f70cbcdea8577a0
BLAKE2b-256 e1c9619eccc541820652ad804e9637a714de635ef7dba580bb1887d6010d953c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: klygo-2.0.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 533.8 kB
  • 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.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 280aca0d98878d8abb7e970db2a14d4e64d83fff733ad1cf1ee2b724f2c2be81
MD5 3283993929ce201b1525441d45fa3b58
BLAKE2b-256 5dd37bfc9faff322ac778ea1f6a531528d3b9a65df9628e6f54a86630b615919

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5cde9f5964380c902399353b9013a7de8c2c22224a1ffd95c74ded687e73cd42
MD5 d2b5fb3c82cebaf93804385391c37776
BLAKE2b-256 dce6375033f2af292347127650369446a572f273bb39c416fe85792f1e23749d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a7cfe012386a8316c0a2e8c0adb8301c7ba44aaee2b1c8e96de8449456ef99d
MD5 5ff616964f112fcc7874e22487090437
BLAKE2b-256 e6b3d30d0cbcd2135fbc5da02a8357a8fe4d890829dd9ed83f508370427cccab

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: klygo-2.0.12-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 529.1 kB
  • 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.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8e44fe7e466da1c28fa74c9d268be9886b0dfdf47a37dd607fb4dbbbed79b2aa
MD5 51edd934fa8f4bd86bd06b003646b17e
BLAKE2b-256 102a410eb86fb7c17077e743688829fdf3d79eeaffbd3879dae14048262a7eb4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33ded02331397b8bd05818a75a543f841441e733da34471a6f5c4980ba326898
MD5 3f5b65320ab73723145a3e5aded34994
BLAKE2b-256 fd782211d8ef78563e671b48a6830ce8606bdbf6d0a73954202eda4078a723e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d2a1231572821eeb060118dd54fcfef2e2a1a50fabf913b7364fc890d80691de
MD5 27a706da77b4b96e47c4b330c179a398
BLAKE2b-256 dfdb3bc9279b673225e91d9f29fd654a24085af893c0ab0e78567fb42e81b8f4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: klygo-2.0.12-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 296.2 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.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a744b7aa73b592b3a89cadd9fef4136fe69a1273f8081e6101dcde9209e812c2
MD5 1b0e5b7690ccfaef81d7f313afd5b916
BLAKE2b-256 5b6db19f8473dba97e23db8d04728e9a4cb219acc596408c41dd6c70745d4208

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6282beb70be2daf561347d1fe4bb6d120973cf7cdc7a2bcd2fa92c421b6e479
MD5 05d7a4a40c0806b2aa00522df7a3a297
BLAKE2b-256 072325900c942e2b4770f16f0f1a8b89cc96cbdf5ac980fcd7f0bda94baac385

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for klygo-2.0.12-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5373de82af63474ea6b96dcc3c6f01d44d0a14bb56c9e5f23334f0e668efb9d7
MD5 23163dc17a5cf023944e5fafc6104370
BLAKE2b-256 517773cbaf8e90262b3bf8d5c639360ee5dbd76401c9627749843e184274f773

See more details on using hashes here.

Provenance

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