The HoloGen toolkit generates paired object-domain images and their inline or off-axis holograms for machine learning workflows.
See the first dataset (100k, 157.4GB!) generated with the HoloGen in HuggingFace 🤗
- Binary object-domain sample generation with diverse analytic shapes
- Complex field support for amplitude, phase, and mixed object types
- Strategy-based hologram creation supporting inline and off-axis methods
- Reconstruction pipeline for object-domain recovery from holograms
- Dataset writer for NumPy bundles and preview imagery with multiple field representations
- Realistic noise and aberration modeling for physically accurate simulations
Install the package and its hologen command:
uv tool install . # or: pip install .Generate the dataset with the default, cited recipe (25,000 holograms of 224 x 224 pixels in four noise configurations):
hologen generate --output dataset-224Common options override the recipe; run hologen generate --help for all of them:
hologen generate --output small --samples 1000 --resolution 128 --seed 1
hologen generate --output laser --config ideal --config camera_laser_speckleThe folder also receives recipe.toml, the exact recipe the dataset was made from.
Every physical value (geometry, camera, speckle) is part of a recipe. Write the default recipe, with the unit and source of each value, edit it and generate from it:
hologen recipe --output paper.toml
hologen generate --recipe paper.toml --output dataset-paperValues missing from a recipe file keep their defaults, and unknown keys are rejected.
From Python, use hologen.dataset.default_recipe() and load_recipe(path).
Every recording passes through a model of a real camera (Sony ICX267 CCD, EMVA 1288): shot noise, dark current, read noise and a 12-bit ADC. The light source adds speckle (Goodman's model). The dataset has four configurations of equal size:
| Configuration | Noise | rms deviation from the noise-free hologram |
|---|---|---|
ideal |
none (reference) | 0.02% |
camera |
shot + dark + read + ADC | 1.6% |
camera_led_speckle |
camera + speckle contrast 0.014 | 2.1% |
camera_laser_speckle |
camera + speckle contrast 0.12 | 12.1% |
To see each noise source live, open an interactive explorer:
hologen explore speckle # contrast and grain size
hologen explore shot-noise # exposure and saturation
hologen explore dark-current # temperature and exposure time
hologen explore readout # read noise and ADC bit depth
hologen explore speckle my_photo.png --save speckle.pngReleased under the MIT License. See LICENSE for details.