A PyTorch implementation of the paper: [Adaptive Image Sampling using Deep Learning and its Application on X-Ray Fluorescence Image Reconstruction] [Arxiv Preprint]
pip install tqdm
- opencv
conda install -c conda-forge opencv
pip install tensorboard_logger
- h5py
conda install h5py
The train and val datasets are sampled from ImageNet.
Train dataset has 100000 images. Val dataset has 1000 images.
Download the datasets from here,
and then extract it into $data
directory. Modify the path of $data
directory in line#48 of file train_NetE.py and line#48 of file train_NetM.py.
The test image dataset are sampled from ImageNet. It contains 100 images. It is stored in file data_val_100.h5 .
Run
python train_NetE.py
to train the image inpainting network NetE.
After NetE is trained, modify the file name of trained NetE in line#29 of file train_NetM.py and run
python train_NetM.py
to train the adaptive image sampling network NetM.
To visualize the training process, run
tensorboard --logdir tensorBoardRuns
python test_NetE_h5.py
The output reconstructed images are in results/netE_results
directory.
python test_NetM_h5.py
The output reconstructed images are in results/netM_results
directory.