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.3.tar.gz (46.4 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.3-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: transforms_fake-0.1.3.tar.gz
  • Upload date:
  • Size: 46.4 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.3.tar.gz
Algorithm Hash digest
SHA256 07b9c9d491074df28445b9bc6d14b5fe56170ce8c335123101db9a9675218485
MD5 fee80761e78b5c9d4224357890fe1963
BLAKE2b-256 583434e6969c92dda31a8b06fdc36c573e8f2faebef9988704ed12cd3d8163a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for transforms_fake-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 149e5a359635f89a5381b96eed4731ac04fb4e58d322f890edb5a5accc21273e
MD5 afc5360cd13b00d940a1b849cba6f860
BLAKE2b-256 200b55a77ce3b1781723cf15373c858610f6e61ee2ab3311725dab7efbcef235

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