Using CNN to convert from SDR to HDR
Please install python3.X, either directly, or through Anaconda
If python2.X already exists on the computer it is required for the user to specify python3 instead of python in the terminal
- Pillow
- Keras
- Tensorflow-gpu (please confirm the corresponding version compatibility with both keras and CUDA)
- Numpy
pip install Pillow
pip install Numpy
- Install tensorflow for GPU (Tensorflow-gpu)
- Install CUDA and Cudnn (ensure they are version compatible according to Nvidia website) *Please also ensure that the Tensorflow-gpu version is compatible with Keras version and also the CUDA version.
To see if GPU is working, run this inside python CLI
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
Due to the large size of the training dataset, the images are not included in the repository. Please insert the input images from the SDR Virtual Camera to the directory
./data/train/input1/input/
Correspondingly, the output images should go to
./data/train/output1/output/
Run in the terminal (Linux / MacOS) or Powershell (Windows)
python main.py
Please insert the images that you would like to predict inside the directory
./images_to_predict/input/
Then run in the terminal (Linux / MacOS) or Powershell (Windows)
python predict.py
The predicted images would be populated in the corresponding output directory to be retrieved
The matlab files can be found the the m-files directory
Please use virtual_camera.m for generating input images and Reinhard.m for generating output images (replace input images)
Please run the inverse_Reinhard.m on the produced CNN output to generate the final HDR image (replace input images)