Skip to main content

Cross-platform graphical installer with Docker support.

Project description

transforms_fake

A Python library for generating realistic synthetic images to train segmentation models in a smart, simple way.

PyPI version License Status

Overview

transforms_fake automatically generates new labeled images and masks from existing annotated datasets. Unlike traditional augmentation libraries, which only transform existing data, this library creates entirely new training examples by intelligently extracting and repositioning objects with their corresponding masks.

Key innovation: context-aware object insertion that maintains a realistic appearance while expanding the diversity of the dataset.

Features

  • Instance-aware copy and paste: extract objects using segmentation masks
  • Contextual transformations: rotation, scaling, and inversion with mask preservation
  • Insertion between images: place objects from one image into different backgrounds
  • Automatic mask updates: maintains segmentation labels with pixel-perfect accuracy
  • Framework integration: compatible with PyTorch and FastAI workflows
  • Dataset export: generate ready-to-use training datasets

Installation

pip install transforms_fake

For the latest development version:

pip install git+https://github.com/THOTIACORP/transforms_fake.git

Quick start

from transforms_fake.main import main

# Basic usage
main()

Dataset structure

Organize your data as follows:

dataset/
├── images/
│   ├── image1.png
│   └── image2.png
└── masks/
    ├── image1_mask.png
    └── image2_mask.png

How it works

  1. Input processing: Loads images with corresponding segmentation masks
  2. Instance detection: Identifies individual objects within the masks
  3. Object extraction: Isolates objects using the mask boundaries
  4. Contextual placement: Inserts objects into new locations with transformations
  5. Mask synchronization: Updates the segmentation masks to match the new object positions

Comparison with existing tools

vs. Albumentations

Feature Albumentations transforms_fake
Traditional augmentation
Synthetic instance generation
Individual object manipulation
Copy and paste with mask recognition

vs. Other augmentation tools

  • Traditional libraries modify existing pixels
  • transforms_fake creates new object arrangements while preserving realism
  • Designed specifically for segmentation tasks that require diversity at the instance level

Use cases

  • Medical images: augment rare cases of pathologies
  • Object detection: augment variations in object occurrence
  • Segmentation: generate diverse object arrangements
  • Small datasets: multiply training examples contextually

Requirements

  • Python 3.7+
  • PIL/Pillow for image processing
  • NumPy for matrix operations
  • Compatible with PyTorch and FastAI

Contributions

Contributions are welcome! Please:

  1. Fork the repository
  2. Create feature branches
  3. Submit pull requests with clear descriptions
  4. Report bugs via issues on GitHub

License

GNU General Public License v3.0 - See LICENSE for details.

Contact

THOTIACORP

Authors

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

transforms_fake-0.1.2.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transforms_fake-0.1.2-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file transforms_fake-0.1.2.tar.gz.

File metadata

  • Download URL: transforms_fake-0.1.2.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for transforms_fake-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6b8ec1d6b886de530e9f68a2977ec15b70f02598281b4dd8004447bf7873b690
MD5 93e5a81131cf6b8e8d85de33f9465b4f
BLAKE2b-256 251f1782791fa4c56e4ad0b3676d94d02cd1c9ef8cab233c2be2a7f47905b864

See more details on using hashes here.

File details

Details for the file transforms_fake-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for transforms_fake-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a78ed542fcf8da31e931970981d6e5275fcc3c6cac8f3f7a6eda10cec0a1a860
MD5 643cfd53b3e91b3591391e298689717b
BLAKE2b-256 e819e02c8e14390750f4c00ccdd7479b011d110acc5f54999e021082201a3dce

See more details on using hashes here.

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