Skip to content

Repository files navigation

iflens - Generative AI Data Augmentation Tool

Static Badge Static Badge Static Badge Static Badge

Installation

Clone the repository

git clone https://github.com/Starblessed/iflens.git .

Install the dependencies

uv (recommended)

uv sync

python

python -m venv .venv

.venv\Scripts\activate # Windows
.venv\bin\activate # Linux

pip install .

Usage

Condition Configuration

Edit the conditions-example.yaml file with the desired conditions for image classification.

people:
  empty: No people visible in the scene.
  some: Some people visible in the scene.
  crowded: Lively scene crowded with lots of people.

time_of_day:
  dawn: Early daylight with low ambient illumination.
  morning: Morning daylight with moderate illumination.
  noon: Bright overhead daylight with strong illumination.
  afternoon: Afternoon daylight with warm angled illumination.
  dusk: Fading daylight with low ambient illumination.
  night: Nighttime with minimal natural illumination.

precipitation:
  clean: No precipitation.
  light_rain: Light rainfall with minor visibility reduction.
  heavy_rain: Heavy rainfall with significant visibility reduction.
  stormfront: Severe storm with intense rainfall and turbulent conditions.
  snow: Light snowfall with minor visibility reduction.
  heavy_snow: Heavy snowfall with significant visibility reduction.
  blizzard: Severe snowfall with strong winds and low visibility.

planet:
  earth: Standard picture taken on planet Earth.
  mars: Picture taken on planet Mars.

API Keys

Make a copy of the .env.example file, rename it to .env, and fill in the requested API keys:

GEMINI_API_KEY=YOUR_KEY_HERE
GROQ_API_KEY=YOUR_KEY_HERE

Pipeline Configuration

Modify the generation variables in the iflens/main.py script:

NUMBER_OF_SAMPLE_IMAGES: int = 1 # Should be equal to or smaller than the dataset size

DATASET_PATH: str = os.path.join("examples", "street")
CONDITIONS_YAML_FILE: str = "conditions-example.yaml"

KEEP_CLASSES: list[str] = ["planet"] # Prevents the tool from varying specific condition classes

GENERATION_MODEL: str = "gemini-3.1-flash-lite-image"

Running

Open a console in the project root directory and run:

uv (recommended)

uv run python -m iflens.main

python

.venv\Scripts\activate # Windows
.venv\bin\activate # Linux

python -m iflens.main

Attribution

About

AI-Assisted Image Augmentation Tool.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages