-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a8283f
commit 902e4a6
Showing
4 changed files
with
38 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
---------- | ||
|
@@ -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. | ||
|
@@ -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 | ||
|
@@ -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) | ||
|
@@ -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 | ||
|