Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
YohannPerron committed Jul 21, 2023
1 parent 1a8283f commit 902e4a6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 69 deletions.
4 changes: 1 addition & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@
"pycsou.util",
"pycsou.util.ptype",
"PIL",
"PIL.Image",
"tqdm",
"paramiko",
"paramiko.ssh_exception",
"waveprop.simulation",
"paramiko.ssh_exception"
]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
Expand Down
4 changes: 4 additions & 0 deletions docs/source/evaluation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@

.. automodule:: lensless.eval.benchmark

.. autoclass:: lensless.eval.benchmark.ParallelDataset
:members:
:special-members: __init__

.. autofunction:: lensless.eval.benchmark.benchmark
21 changes: 0 additions & 21 deletions docs/source/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,3 @@ Image analysis
.. autofunction:: lensless.utils.image.autocorr2d

.. autofunction:: lensless.utils.image.print_image_info

Dataset
------------

.. automodule:: lensless.utils.dataset

.. autoclass:: lensless.utils.dataset.DualDataset
:members: _get_images_pair
:special-members: __init__, __len__

.. autoclass:: lensless.utils.dataset.LenslessDataset
:members:
:special-members: __init__

.. autoclass:: lensless.utils.dataset.SimulatedDataset
:members:
:special-members: __init__

.. autoclass:: lensless.utils.dataset.DiffuserCamTestDataset
:members:
:special-members: __init__
78 changes: 33 additions & 45 deletions lensless/utils/dataset.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# #############################################################################
# dataset.py
# =================
# Authors :
# Yohann PERRON [[email protected]]
# #############################################################################

import numpy as np
import glob
import os
Expand Down Expand Up @@ -36,7 +29,6 @@ def __init__(
"""
Dataset consisting of lensless and corresponding lensed image. Default parameters are for the DiffuserCam
Lensless Mirflickr Dataset (DLMD).
Parameters
----------
indexes : range or int or None
Expand Down Expand Up @@ -70,7 +62,7 @@ def __len__(self):

@abstractmethod
def _get_images_pair(self, idx):
"""Abstract method to get the lensed and lensless images. Supposed to return a pair (lensless, lensled) of numpy array with value in [0,1].
"""Abstract method to get the lansed and lensless images. Supposed to return a pair (lensless, lensled) of numpy array with value in [O,1].
Parameters
----------
Expand Down Expand Up @@ -139,7 +131,6 @@ def __init__(
"""
Parameters
----------
psf : torch.Tensor
PSF to use for propagation. Should be a 4D tensor with shape 1 H W C.
For no simated dataset don't support 3D reconstruction.
Expand Down Expand Up @@ -214,21 +205,20 @@ def __init__(
"""
Dataset consisting of lensless and corresponding lensed image. Default parameters are for the DiffuserCam
Lensless Mirflickr Dataset (DLMD).
Parameters
----------
root_dir : str
Path to the test dataset. It is expected to contain two folders: ones of lensless images and one of original images.
lensless_fn : str, optional
Name of the folder containing the lensless images, by default "diffuser".
lensed_fn : str, optional
Name of the folder containing the lensed images, by default "lensed".
image_ext : str, optional
Extension of the images, by default "npy".
image_ext : str, optional
Extension of the original image if different from lenless, by default None.
downsample : int, optional
Downsample factor of the lensless images, by default 1.
root_dir : str
Path to the test dataset. It is expected to contain two folders: ones of lensless images and one of original images.
lensless_fn : str, optional
Name of the folder containing the lensless images, by default "diffuser".
lensed_fn : str, optional
Name of the folder containing the lensed images, by default "lensed".
image_ext : str, optional
Extension of the images, by default "npy".
image_ext : str, optional
Extension of the original image if different from lenless, by default None.
downsample : int, optional
Downsample factor of the lensless images, by default 1.
"""
super(LenslessDataset, self).__init__(downsample=1, **kwargs)
self.pre_downsample = downsample
Expand Down Expand Up @@ -310,29 +300,28 @@ def __init__(
"""
Dataset consisting of lensless and corresponding lensed image. Default parameters are for the DiffuserCam
Lensless Mirflickr Dataset (DLMD).
Parameters
----------
root_dir : str
Path to the test dataset. It is expected to contain two folders: ones of lensless images and one of lensed images.
n_files : int or None, optional
Metrics will be computed only on the first ``n_files`` images. If None, all images are used, by default False
background : :py:class:`~torch.Tensor` or None, optional
If not ``None``, background is removed from lensless images, by default ``None``.
downsample : int, optional
Downsample factor of the lensless images, by default 4.
flip : bool, optional
If ``True``, lensless images are flipped, by default ``False``.
transform_lensless : PyTorch Transform or None, optional
Transform to apply to the lensless images, by default None
transform_lensed : PyTorch Transform or None, optional
Transform to apply to the lensed images, by default None
lensless_fn : str, optional
Name of the folder containing the lensless images, by default "diffuser".
lensed_fn : str, optional
Name of the folder containing the lensed images, by default "lensed".
image_ext : str, optional
Extension of the images, by default "npy".
root_dir : str
Path to the test dataset. It is expected to contain two folders: ones of lensless images and one of lensed images.
n_files : int or None, optional
Metrics will be computed only on the first ``n_files`` images. If None, all images are used, by default False
background : :py:class:`~torch.Tensor` or None, optional
If not ``None``, background is removed from lensless images, by default ``None``.
downsample : int, optional
Downsample factor of the lensless images, by default 4.
flip : bool, optional
If ``True``, lensless images are flipped, by default ``False``.
transform_lensless : PyTorch Transform or None, optional
Transform to apply to the lensless images, by default None
transform_lensed : PyTorch Transform or None, optional
Transform to apply to the lensed images, by default None
lensless_fn : str, optional
Name of the folder containing the lensless images, by default "diffuser".
lensed_fn : str, optional
Name of the folder containing the lensed images, by default "lensed".
image_ext : str, optional
Extension of the images, by default "npy".
"""

super(ParallelDataset, self).__init__(**kwargs)
Expand Down Expand Up @@ -396,7 +385,6 @@ def __init__(
"""
Dataset consisting of lensless and corresponding lensed image. Default parameters are for the test set of DiffuserCam
Lensless Mirflickr Dataset (DLMD).
Parameters
----------
data_dir : str, optional
Expand Down

0 comments on commit 902e4a6

Please sign in to comment.