A versatile augmentation library for computer vision projects.
Project description
Unlocking Infinite Possibilities in Computer Vision Augmentation
๐ง Configurable โข โ๏ธ Controllable โข ๐ Format-Agnostic
AugFlow is an advanced open-source augmentation library designed to elevate your computer vision projects. Whether you're a researcher pushing innovation or a practitioner aiming for peak performance, AugFlow enables the creation of highly customizable augmentation pipelines that enhance dataset diversity and improve model generalization. With fully configurable and controllable processes, AugFlow offers unmatched flexibility for precise fine-tuning, optimizing both performance and robustness. ๐
๐พ Features
Discover What Makes AugFlow Unique and So Powerful ๐
-
๐ Innovative Flow Concept AugFlow introduces the entirely novel concept of flows, a groundbreaking approach not yet implemented in any existing theory or solutions. Our initial evaluations demonstrate the impact and advantages this unique methodology brings to data augmentation.
-
๐ ๏ธ Configurable Parameters: Every augmentation is fully configurable through simple and intuitive parameters.
-
๐๏ธ Comprehensive Polygon Clipping Control Unlike existing open and closed-source solutions that inadequately manage polygon clipping, AugFlow offers comprehensive, per-class control over clipped polygons, enhancing dataset diversity especially for those with high intra-class variability.
-
โ๏ธ Enhanced CutOut Functionality AugFlow's CutOut feature provides superior control, enabling precise targeting of large or small polygons along with customizable parameters. This flexibility ensures more effective and tailored data augmentation strategies.
-
๐งฉ Advanced Mosaic Augmentation AugFlow's Mosaic augmentation offers exceptional control with dynamic grid configurations, including larger grids for high-resolution images. This adaptability significantly improves detection accuracy for small objects within complex scenes.
-
๐ Precise Transformation Controls AugFlow enhances fundamental augmentations like Crop, Rotate, Shear, and Translate, allowing precise customization to better suit diverse dataset requirements and improve model robustness.
-
๐ฏ Targeted Category Focusing AugFlow enables targeted augmentation by focusing on images containing specific categories while excluding others, effectively balancing datasets. Future enhancements aim to handle edge cases per class using advanced unsupervised techniques.
-
๐ Format-Agnostic: Supports multiple annotation formats including COCO and YOLO seamlessly, for both detection and segmentation.
-
๐ Logging & Visualization: Track augmentation processes with detailed logs and visualize annotations to ensure quality.
-
๐ง Extensible Architecture: Designed to easily incorporate new augmentations and extend existing functionalities.
๐ Getting Started
โ๏ธ Prerequisites
Before you begin, ensure you have met the following requirements:
- Operating System: Windows, macOS, or Linux
- Python Version: Python 3.6 or higher
- Package Manager: pip installed
- Git: Installed for cloning the repository and contributing (Download Git)
โ๏ธ Installation
๐ ๏ธ Setting Up a Virtual Environment (Recommended):
-
Create a Virtual Environment:
python3 -m venv augflow-env
-
Activate the Virtual Environment:
-
Windows:
augflow-env\Scripts\activate
-
macOS and Linux:
source augflow-env/bin/activate
-
After creating your virtual env you can Install AugFlow using one of the following methods:
-
Build from source:
-
Clone the augflow repository:
git clone https://github.com/ConnectedMotion/augflow.git
-
Navigate to the project directory:
cd augflow
-
Install the project dependencies:
pip install -e .
-
pip install augflow
๐ฏ Quick Start Example
The following example demonstrates how to use AugFlow's Pipeline to apply a tree of augmentations to a YOLO-formatted dataset. This pipeline includes rotations, translations, mosaics, crops, and cutouts to enhance the diversity and robustness of a vehicle damage segmentation dataset. After running your experiment, you will receive detailed logs about the flow, saved in the augflow_pipeline.log file.
import copy
from augflow.pipeline import Pipeline
import augflow.utils.configs as config
# Define the experiment identifier
experiment_id = 'your_experiment_id'
# Initialize the AugFlow pipeline
pipe = Pipeline()
# Configure the pipeline task for YOLO format, specifying the dataset path containing images and labels
pipe.task(
format='yolo',
dataset_path='your_dataset_path'
)
# Apply default rotation augmentations to the original dataset
pipe.fuse(source_id='root', type='rotate', id='aug_rotate')
# Apply translation augmentations and merge them into the final output
pipe.fuse(source_id='root', type='translate', id='aug_translate', merge=True)
# Create a 2x2 mosaic of rotated images with output dimensions of 1280x1280 pixels
pipe.fuse(
source_id='aug_rotate',
type='mosaic',
id='mosaic_2by2',
output_dim=(1280, 1280),
merge=True
)
# Crop only the mosaic images that contain all polygons with their area exceeding 0.5% of the original image's area
pipe.fuse(
source_id='mosaic_2by2',
type='crop',
min_relative_area=0.005,
merge=True
)
# Customize the mosaic configuration to create a 4x4 grid by copying and modifying the default settings
mosaic_4by4 = copy.deepcopy(config.mosaic_default_config)
mosaic_4by4['grid_size'] = (4, 4)
# Apply the customized 4x4 mosaic augmentations and merge them into the final output
pipe.fuse(
source_id='root',
type='mosaic',
config=mosaic_4by4,
merge=True
)
# Apply cutout augmentations targeting images containing only objects from the 'scratch' class
pipe.fuse(
source_id='root',
type='cutout',
focus={'include': ['scratch'], 'exclude': 'all_others'},
merge=True
)
# Define the output configuration for the pipeline, specifying YOLO format and the destination path
pipe.out(
format='yolo',
output_path=f'your_outpath_path/{experiment_id}',
ignore_masks=False,
visualize_annotations=True
)
๐ฌ Unit Testing
Run the test suite using PyTest:
pytest tests/ -v
๐ Project Roadmap
-
[โ ] Milestone 1: Implement more controllable, configurable, and intelligent augmentation flows (Done)
-
[โ] Milestone 2: Develop Detailed Documentation. ๐
-
[โ] Milestone 3: Add Comprehensive Control Over Individual Augmentations. ๐
-
[โ] Milestone 4: Provide predefined augmentation presets based on the dataset's statistical distribution. ๐
-
[โ] Milestone 5: Support Key Points Annotations. ๐
-
[โ] Milestone 6: Enhance Augmentation Focus Based on Object Features. ๐
-
[โ] Milestone 7: Support 3D Augmentations. ๐
-
[โ] Milestone 8: Develop an Interactive GUI for Augmentation Setup. ๐
๐ฐ Contributing
- ๐ฌ Join the Discussions: Share your insights, provide feedback, or ask questions.
- ๐ Report Issues: Submit bugs found or log feature requests for the
augflowproject. - ๐ก Submit Pull Requests: Review open PRs, and submit your own PRs.
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/your-username/augflow.git
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
๐ License
This project is licensed under the MIT License. For more details, refer to the LICENSE file.
๐ฌ Contact and Support
For any inquiries or support, feel free to reach out via Issues or join the Discussions.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file augflow-1.0.1.tar.gz.
File metadata
- Download URL: augflow-1.0.1.tar.gz
- Upload date:
- Size: 55.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2f5cf2e512b6ff8921cdbc7eff4d5fcb9c1d0b0a232ef86fdc24bae033b623a
|
|
| MD5 |
1edd9e3c95e0145e92797db5cf094059
|
|
| BLAKE2b-256 |
a52f61b95b03f5c917bd9a0aaf83b6416301bdfc6b62aae6ae14cc09589809b8
|
File details
Details for the file augflow-1.0.1-py3-none-any.whl.
File metadata
- Download URL: augflow-1.0.1-py3-none-any.whl
- Upload date:
- Size: 74.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eee93f4e7836363b8c5acec30ee2c770550727cdbbc7d10e4ac85c3365154812
|
|
| MD5 |
150ac015d35bacaec141c4d0ddb0b32b
|
|
| BLAKE2b-256 |
5ae4716378524b0ede7b59fdadd2c01b96c1beed6584222bc2e6545213b1ce15
|