Downloads · 30 days
0
gokhankocmarli/holopaswin-v3
holopaswin-v3 is a image-to-image model from gokhankocmarli. Use it when you need one image transformed into another. The card lists the license as mit.
HoloPASWIN (Physics-Aware Swin Transformer for Holographic Reconstruction) is a state-of-the-art model for eliminating twin-image artifacts and recovering complex object fields (amplitude and phase) from single-shot i…
Downloads · 30 days
0
Access
Public
Updated Mar 8, 2026
Repo size
133 MB
Likes
1
Public
Click a slice to open those files.
.bin124 MB · 99%
From the Hugging Face model README
HoloPASWIN (Physics-Aware Swin Transformer for Holographic Reconstruction) is a state-of-the-art model for eliminating twin-image artifacts and recovering complex object fields (amplitude and phase) from single-shot in-line holograms.

The model combines the exact physical model of free-space propagation with the powerful representation learning of a Swin Transformer.
HoloPASWIN v3 improves upon traditional CNN-based approaches and iterative solvers:
Evaluated on a test set of 496 holographic samples, HoloPASWIN v3 achieves excellent reconstruction fidelity in both amplitude and phase domains.
Below are sample reconstructions showing the Ground-Truth arrays juxtaposed against the Ground-Truth Amplitude & Phase, Zoomed Details, and Error Maps.

| Metric | HoloPASWIN (Ours) | U-Net | ASM (Dirty) | GS (100 iter) |
|---|---|---|---|---|
| Phase SSIM | 0.9862 | 0.9915 | 0.3038 | 0.3038 |
| Phase PSNR (dB) | 46.55 | 46.43 | 34.69 | 34.69 |
| Amp SSIM | 0.9625 | 0.9917 | 0.6128 | 0.6128 |
| Amp PSNR (dB) | 41.98 | 46.43 | 30.96 | 30.96 |
| Complex MSE | 0.000968 | 0.000608 | 0.0158 | 0.0158 |
| Inference Time | 13.68 ms | 23.14 ms | 2.40 ms | 95.84 ms |
Note: While a significantly larger classic U-Net baseline achieves slightly higher raw SSIM metrics on this particular dataset split, HoloPASWIN operates twice as fast (13.7ms vs 23.1ms) while avoiding the common over-smoothing associated with standard CNNs.
You can load the required classes directly from the repository.
from huggingface_hub import hf_hub_download
import torch
# Load the weights
model_path = hf_hub_download(repo_id="gokhankocmarli/holopaswin-v3", filename="pytorch_model.bin")
# Import the model architecture provided in the same repo
# (Ensure src/holopaswin is in your PYTHONPATH)
from holopaswin.model import HoloPASWIN
# Initialize model
model = HoloPASWIN(
img_size=224,
in_chans=1,
embed_dim=96,
depths=[2, 2, 6, 2],
num_heads=[3, 6, 12, 24],
window_size=7,
)
# Load state dict
model.load_state_dict(torch.load(model_path))
model.eval()
# Dummy input
dummy_hologram = torch.randn(1, 1, 224, 224)
with torch.no_grad():
clean_real_imag = model(dummy_hologram)
If you find this work useful, please cite our paper:
@misc{kocmarli2026holopaswin,
title={HoloPASWIN: Robust Inline Holographic Reconstruction via Physics-Aware Swin Transformers},
author={Gokhan Kocmarli},
year={2026},
eprint={2603.04926},
archivePrefix={arXiv},
primaryClass={eess.IV}
}
Or view the paper directly: HoloPASWIN: Robust Inline Holographic Reconstruction via Physics-Aware Swin Transformers