OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Histogan

Histogan is a reference-code repository for HistoGAN, a GAN method that controls generated-image colors with target color histograms, and for ReHistoGAN, an extension that recolors real images using a jointly trained encoder.

Independent OpenViST project profile, based on linked sources.

Histogan — AI Models
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the repository when you need reference code for histogram-controlled GAN image generation or real-image recoloring, or when you want to examine its histogram-loss classes for a deep-learning optimization.

Who it is for

  • Researchers and developers working on GAN-based image generation or recoloring.
  • Practitioners who want to compute differentiable color-histogram loss for deep-learning optimization.
  • Image-tool builders exploring histogram-guided color-transfer or recoloring workflows.

Documented uses

  • Train or test a HistoGAN model using a dataset and selected training settings.
  • Guide generated image colors with a target histogram feature.
  • Recolor real images while encouraging the original image content to remain.
  • Compute differentiable histogram loss using RGB-uv, rg-chroma or CIE Lab histogram classes.
Before you choose

Requirements & limits

The public repository is identified as open source under the MIT license.

  • The implementation is documented as Jupyter Notebook code, with the principal training and testing entry point named histoGAN.py.
  • The README lists Python 3.6 and specific Conda and pip dependencies.
  • Optional dependencies include dlib for face preprocessing; the README identifies a Windows pip installation caveat.
  • Training iteration count requires user judgment, and the README notes that generated images may degrade with continued training.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up the documented HistoGAN environment

Create the Python 3.6 environment and install the listed core and optional dependencies.

Before you start

  • Conda and pip
  • Python 3.6

Steps

  1. Create and activate the histoGAN Conda environment with Python 3.6, NumPy 1.13.3 and SciPy.

  2. Install PyTorch and torchvision, then tqdm, Pillow and OpenCV using the README's Conda commands.

  3. Install CMake, dlib, linear-attention-transformer, vector-quantize-pytorch, torch-optimizer and retry with pip as listed.

Expected outcome

The README's named environment and dependencies are installed.

Guide limitations

  • The README warns that dlib installation with pip may cause problems on Windows.
  • dlib is only required for face preprocessing; without it, do not use ReHistoGAN's --face_extraction option.
Source-based practical guide

Configure and start HistoGAN training

Launch training on a dataset directory with a chosen model name, iteration count and GPU index.

Before you start

  • The documented HistoGAN environment and dependencies
  • A dataset at the path supplied to --data
  • A chosen number of training iterations

Steps

  1. Choose a model name, dataset directory, iteration count and GPU index.

  2. Run the README's training command: python histoGAN.py --name histoGAN_model --data ./datasets/faces/ --num_train_steps XX --gpu 0, replacing XX with the chosen iteration count.

  3. Review generated sample images in the results directory specified by --results_dir during training.

Expected outcome

Training is configured to write example samples to the results directory; model files are expected in a model-named subdirectory under models, unless --models_dir changes that location.

Guide limitations

  • The README states there is no ideal iteration count and suggests continuing until generated images begin to degrade.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
20 November 2026
Original website title
mahmoudnafifi/HistoGAN · Official homepage title · retained in its source language