This repository contains the implementation for LCNF introduced in the following paper:
The LCNF requires a standard computer with at least 16GB RAM and Nvidia GPU with at least 12GB VRAM.
- Python 3.8.10
- pytorch 1.13.1
- TensorboardX
- PyYAML, numpy, tqdm, imageio
The typical install time on a normal desktop computer is about 1 hour.
Run python train_LCNF.py --config configs/test.yaml
.
--config: predefined network training parameters in .yaml file
Here, we provide ethanol-fixed Hela cells at Dataset for training (one pair of data).
The expected training time is around 3 hours.
Run python inference_LCNF.py --input Dataset/Inference/22.npy --model save/_test/epoch-best.pth --resolution 1500,1500 --output Dataset/Inference/pred22.png
.
Once the network finished training, we will use the model saved in 'save/_test/epoch-best.pth' to reconstruct the high-resolution phase image.
--input: path of input preprocessed low-resolution image
--model: trained model, will be saved in the save folder
--resolution: queried pixel resolution for high-resolution image
--output: path of reconstructed image
Expected output is a high-resolution phase image with .png format. Expected inference time is around 30s.
To use our trained models, first download models (https://drive.google.com/drive/folders/1zIBaYvLkABGXDJFIzgbtJoXavZIBUmAU?usp=sharing), then change the --model name to the trained models when running the inference_LCNF.py
To request more data, please contact the author: Hao Wang, wanghao6@bu.edu