Skip to content

Commit

Permalink
Update changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Sep 12, 2024
1 parent 41b4c6f commit 1c49539
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Unreleased
Added
~~~~~

- Option to pass background image to ``utils.io.load_data``.
- Option to set image resolution with ``hardware.utils.display`` function.
- Add utility for mask adapter generation in ``lenseless.hardware.fabrication``
- Option to add simulated background in ``util.dataset``
Expand All @@ -28,11 +27,19 @@ Added
- HFSimulated object for simulating lensless data from ground-truth and PSF.
- Option to set cache directory for Hugging Face datasets.
- Option to initialize training with another model.
- Option to pass background image to ``utils.io.load_data``.
- Option to use background in ``lensless.eval.benchmark``.
- Different techniques to use measured background: direct subtraction, learned subtraction, integrated subtraction, concatenated to input.
- Learnable background subtraction for classes that derive from ``lensless.recon.trainable_recon.TrainableReconstructionAlgorithm``.
- Integrated background subtraction object ``lensless.recon.integrated_background.IntegratedBackgroundSub``.
- Option to concatenate background to input to pre-processor.
- Add support for datasets with measured background to ``lensless.utils.dataset.HFDataset``.


Changed
~~~~~~~

- Nothing
- ``lensless.utils.dataset.HFDataset`` no longer inherits from ``lensless.utils.dataset.DualDataset``.

Bugfix
~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions lensless/eval/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def benchmark(
background = None
lensless = batch[0].to(device)
lensed = batch[1].to(device)
if dataset.measured_bg:
if dataset.measured_bg and use_background:
background = batch[-1].to(device)
if dataset.multimask or dataset.random_flip:
psfs = batch[2]
Expand All @@ -152,7 +152,7 @@ def benchmark(
plot=False,
save=False,
output_intermediate=unrolled_output_factor or pre_process_aux,
background=background if use_background else None,
background=background,
**kwargs,
)

Expand Down
4 changes: 2 additions & 2 deletions lensless/recon/integrated_background_sub.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# #############################################################################
# multi_wiener.py
# ===============
# integrated_background_sub.py
# ============================
# Authors :
# Eric BEZZAM [[email protected]]
# Stefan PETERS
Expand Down
2 changes: 0 additions & 2 deletions lensless/recon/rfft_convolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def convolve(self, x):
conv_output = torch.fft.ifftshift(
torch.fft.irfft2(
torch.fft.rfft2(self._padded_data, dim=(-3, -2)) * self._H,
# torch.fft.rfft2(self._padded_data, dim=(-3, -2)) * self._H.to(self._padded_data.device),
dim=(-3, -2),
s=self._padded_shape[-3:-1],
),
Expand Down Expand Up @@ -185,7 +184,6 @@ def deconvolve(self, y):
deconv_output = torch.fft.ifftshift(
torch.fft.irfft2(
torch.fft.rfft2(self._padded_data, dim=(-3, -2)) * self._Hadj,
# torch.fft.rfft2(self._padded_data, dim=(-3, -2)) * self._Hadj.to(self._padded_data.device),
dim=(-3, -2),
s=self._padded_shape[-3:-1],
),
Expand Down
2 changes: 0 additions & 2 deletions lensless/recon/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,8 @@ def apply_denoiser(
if mode == "inference":
with torch.no_grad():
image = model(image, compensation_output)
# image = model(image, compensation_output, background=background)
elif mode == "train":
image = model(image, compensation_output)
# image = model(image, compensation_output, background=background)
else:
raise ValueError("mode must be 'inference' or 'train'")

Expand Down

0 comments on commit 1c49539

Please sign in to comment.