Skip to main content

An image dataset evaluation library using YOLO models

Project description

pythopix

pythopix Logo

PythoPix is a Python library designed for evaluating and analyzing image datasets using YOLO models. It extends beyond simple data analysis to encompass object detection, comparison of detection results, label handling, and model operations, making it a comprehensive tool for both experienced users and beginners in YOLO model applications.

Features

  • Dataset Evaluation: Robust evaluation of image datasets using YOLO models, with options for detailed analysis.
  • Model Operations: Processing images with YOLO models, calculating metrics like IoU, and managing image segregation for augmentation.
  • Label Operations: Extensive tools for handling, converting, and saving label files in different formats, facilitating versatile dataset management.
  • File Operations: Efficient handling and saving of predictions and analysis results, crucial for post-analysis data management.
  • Comparison Tools: Functions for comparing original and predicted labels, aiding in the visual assessment of model accuracy.
  • Data Handling and Export: Facilitating the export of image analysis results to CSV, enabling easy data sharing and record-keeping.

Installation

Install pythopix using pip:

pip install pythopix

Usage

Evaluating an Image Dataset

from pythopix import evaluate_dataset

evaluate_dataset(
    test_images_folder='/path/to/your/image/dataset',
    model_path='/path/to/your/yolo/model',  # Optional
    num_images=10,  # Optional
    verbose=True,  # Optional
    print_results=True,  # Optional
    copy_images=True  # Optional
)

Comparing Labels

from pythopix.comparison import compare_labels

compare_labels(
    image_path='path/to/image.png',
    predicted_label_path='path/to/predicted/label.txt',
    original_label_path='path/to/original/label.txt',  # Optional
    show=True,  # Optional
    save_fig=False  # Optional
)

Handling Data and Labels

from pythopix.labels_operations import extract_label_files, convert_txt_to_json_labels

# Extract label files
label_files = extract_label_files('/path/to/label_folder')

# Convert TXT to JSON labels
convert_txt_to_json_labels(label_files, label_mapping={0: "Label1", 1: "Label2"})

Requirements

  • Python 3.x
  • PyTorch
  • tqdm
  • Ultralytics YOLO
  • OpenCV
  • matplotlib

Contributing

Contributions to pythopix are welcome! Please refer to our contribution guidelines for details on how to contribute.

License

This project is licensed under the MIT License.

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

pythopix-0.5.3.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

pythopix-0.5.3-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file pythopix-0.5.3.tar.gz.

File metadata

  • Download URL: pythopix-0.5.3.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pythopix-0.5.3.tar.gz
Algorithm Hash digest
SHA256 51954dc945832bdd7a17adb75d6bce80505011b5ce5cfe8600fd5367515e527b
MD5 f108f39491ad01d0db4dace3ab0979ff
BLAKE2b-256 c19fe042015ba3a2efafcc0c8733def731991a34e6ddcf5e37bbb73ab14247d2

See more details on using hashes here.

File details

Details for the file pythopix-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: pythopix-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pythopix-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 256ba3006e84baeac7e38eacad6f1528d9b3c1d94849464765c832ee3f729064
MD5 b019436d7a3b98057083a21e6fcdf752
BLAKE2b-256 70d56420877753623ea5288a8991f165ddc686db22fec4a2e1dc51338c64eff3

See more details on using hashes here.

Supported by

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