Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
---
|
| 4 |
+
# Deep learning phase unwrapping with a U-Net
|
| 5 |
+
A demonstrate of ["Deep learning spatial phase unwrapping: a comparative review"](https://doi.org/10.1117/1.APN.1.1.014001) and ["One-step robust deep learning phase unwrapping"](https://doi.org/10.1364/OE.27.015100).
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
## Preparation
|
| 9 |
+
1. [Install CUDA](https://developer.nvidia.com/cuda-downloads)
|
| 10 |
+
|
| 11 |
+
2. [Install PyTorch](https://pytorch.org/get-started/locally/)
|
| 12 |
+
|
| 13 |
+
3. Install dependencies
|
| 14 |
+
```bash
|
| 15 |
+
pip install -r requirements.txt
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
## Datasets
|
| 19 |
+
Download dataset (without noise) from [here](https://figshare.com/s/685e972475221aa3b4c4) to the current path and unzip. The file structure is the following:
|
| 20 |
+
```
|
| 21 |
+
train_in
|
| 22 |
+
└── 000001.mat
|
| 23 |
+
...
|
| 24 |
+
└── 020000.mat
|
| 25 |
+
train_gt
|
| 26 |
+
└── 000001.mat
|
| 27 |
+
...
|
| 28 |
+
└── 020000.mat
|
| 29 |
+
test_in
|
| 30 |
+
└── 000001.mat
|
| 31 |
+
...
|
| 32 |
+
└── 002000.mat
|
| 33 |
+
test_gt
|
| 34 |
+
└── 000001.mat
|
| 35 |
+
...
|
| 36 |
+
└── 000421.mat
|
| 37 |
+
test_in_real
|
| 38 |
+
└── 000001.mat
|
| 39 |
+
...
|
| 40 |
+
└── 000421.mat
|
| 41 |
+
test_gt_real
|
| 42 |
+
└── 000001.mat
|
| 43 |
+
...
|
| 44 |
+
└── 000421.mat
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Of course, datasets _train_in_, _train_gt_, _test_in_ and _test_gt_ can also be obtained by running _dataset_generation.m_ with MATLAB , whose parameters can be adjusted according to actual needs. (The size range of the noise can be controlled by adjusting the parameter _noise_max_.)
|
| 48 |
+
|
| 49 |
+
## Network traning
|
| 50 |
+
Run _main_train.py_ to start training the neural network.
|
| 51 |
+
```sh
|
| 52 |
+
python main_train.py
|
| 53 |
+
```
|
| 54 |
+
After training, two files (loss and others.csv and weights.pth) will be saved in the folder model_weights
|
| 55 |
+
|
| 56 |
+
## Network testing
|
| 57 |
+
Run _main_test.py_ to do some test.
|
| 58 |
+
```sh
|
| 59 |
+
python main_test.py
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Error statistics
|
| 63 |
+
Run _error_evaluation.m_ with MATLAB to calculate RMSEs for each test result.
|
| 64 |
+
|
| 65 |
+
## More informarion
|
| 66 |
+
Details about the code and dataset can be found in this [paper](https://doi.org/10.1117/1.APN.1.1.014001) and its Supplementary Materials.
|