An image dataset evaluation library using YOLO models
Project description
pythopix
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
Release history Release notifications | RSS feed
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.4.5.tar.gz
(30.3 kB
view hashes)
Built Distribution
pythopix-0.4.5-py3-none-any.whl
(34.2 kB
view hashes)