Practical overview
When it fits
Use it when you want to inspect or experiment with the documented GAN-based compression method in Python, and can work with its legacy TensorFlow environment and dataset configuration.
Who it is for
- Computer-vision researchers investigating learned image compression.
- Developers prototyping GAN-based compression workflows or testing the method on image datasets.
Documented uses
- Train a learned image-compression model from image paths organized in an HDF5-backed Pandas dataframe.
- Compress a single image with a model checkpoint and compare the reconstruction with the original.
- Explore conditional reconstruction using semantic label maps.
Requirements & limits
The repository is public and identifies its license as MIT. It is code intended to run in a Python environment, not a hosted compression service.
- The README lists Python 3.6, Pandas and TensorFlow 1.8 as dependencies.
- Training requires a Pandas dataframe saved as HDF5, with image paths and a configured dataset location.
- The conditional GAN variant needs semantic-label-map paths and is explicitly described as experimental.
- The README reports hallucinated content in some reconstructions, including greenery in buildings.
- The README says pretrained models trained with TensorFlow 1.3 appeared to load with TensorFlow 1.8, but does not guarantee compatibility.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Compress one image with a trained model
Run the documented single-image compression command and save a side-by-side reconstruction comparison.
Before you start
- Python 3.6, Pandas and TensorFlow 1.8, as listed by the README.
- A model checkpoint and input image.
- For the supplied noise-sampling model, retain the hyperparameters under config_test in config.py; otherwise match test-time parameters to training.
Steps
Clone the repository and change into its directory.
Run python3 compress.py -r /path/to/model/checkpoint -i /path/to/image -o path/to/output/image, substituting the checkpoint and image paths.
Find the side-by-side comparison under the path specified by directories.samples in config.py.
Expected outcome
A side-by-side comparison of the input and its reconstruction is written in the configured samples directory.
Guide limitations
- The README's command includes an output path argument but says the comparison is saved under directories.samples in config.py.
- The README notes that reconstructions may hallucinate content.
- The listed environment is TensorFlow 1.8; pretrained models were trained with TensorFlow 1.3, and loading is not guaranteed.
Prepare image paths and start model training
Set up the documented image-path dataset configuration and invoke the training script.
Before you start
- Python 3.6, Pandas and TensorFlow 1.8.
- Training images and a Pandas dataframe with a path column, saved as HDF5.
- A configured HDF5 path under the directories class in config.py.
Steps
Prepare image paths in a Pandas dataframe column named path and save the dataframe as an HDF5 file.
Set the HDF5 file path under the directories class in config.py.
Clone the repository and change into its directory.
Inspect available training arguments with python3 train.py -h, then run the documented example: python3 train.py -opt momentum --name my_network.
Expected outcome
The training process is invoked; the README says reconstructed samples and TensorBoard summaries are written periodically and checkpoints are saved every 10 epochs.
Guide limitations
- The README documents ADE20K and Cityscapes preparation examples, with resizing requirements, rather than a universal dataset workflow.
- The documented example does not specify all training arguments or a guaranteed successful run.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- Justin-Tan/generative-compression · Official homepage title · retained in its source language
Related options
High-Fidelity Generative Image Compression — The README points to this separate implementation as an option for higher-bitrate compression and says it supports arbitrary image sizes and resolutions.

