GANrec is an data reconstruction framework that harnesses the power of Generative Adversarial Networks (GANs). While traditional reconstruction methods primarily rely on intricate algorithms to piece together fragmented data, GANrec employs the generative capabilities of GANs to reimagine and revitalize data reconstruction.
Originally designed for the fields of tomography and phase retrieval, GANrec shines in its adaptability. With a provision to input the forward model, the framework can be flexibly adapted for complex data reconstruction processes across diverse applications.
- GAN-powered Reconstruction: At its core, GANrec employs GANs to assist in the reconstruction process, enabling more accurate and efficient results than conventional methods.
- Specialized for Tomography & Phase Retrieval: GANrec has been optimized for tomography and phase retrieval applications, ensuring precision and reliability in these domains.
- Modular Design: The framework's architecture allows users to provide their forward model, making it adaptable for various complex data reconstruction challenges.
- Efficient and Scalable: Built to handle large datasets, GANrec ensures that speed and efficiency are maintained without compromising the accuracy of reconstruction.
This guide provides detailed steps for setting up the ganrec
package in a Conda environment.
Open your terminal or command prompt and create a new conda environment named ganrec
with Python 3.11:
conda create --name ganrec python=3.11
conda activate ganrec
Choose and install either TensorFlow or PyTorch based on your preference.
For TensorFlow:
pip install tensorflow
For PyTorch (make sure to select the correct version for your system from the PyTorch website):
# Example command for installing PyTorch with CUDA support
pip install torch torchvision torchaudio
Finally, install the ganrec package from PyPI:
pip install ganrec
If you want to work for some developments based on GANrec, please follow the steps below to install and set up GANrec:
Open your terminal or command prompt and create a new conda environment named ganrec
with Python 3.11:
conda create --name ganrec python=3.11
conda activate ganrec
Choose and install either TensorFlow or PyTorch based on your preference.
For TensorFlow:
pip install tensorflow
For PyTorch (make sure to select the correct version for your system from the PyTorch website):
# Example command for installing PyTorch with CUDA support
pip install torch torchvision torchaudio
Clone the GANrec repository from GitHub to your local machine.
git clone https://github.com/XYangXRay/ganrec.git`
Navigate to the main directory of the cloned repository and install the necessary packages.
cd ganrec
python3 -m pip install -e .
If you're not sure which one to choose, consider the specific requirements of your project or any existing familiarity you have with either library. TensorFlow is often chosen for its production deployment capabilities and integration with TensorFlow Extended (TFX). PyTorch is favored for its ease of use, dynamic computation graph, and strong support from the research community.
ganrec requires heavy duty work with GPU, make sure to install the GPU versions of TensorFlow or PyTorch. Instructions for this can be found on the respective official websites (TensorFlow and PyTorch).
GANrec currently has the applications for tomography reconstructon and in-line phase contrast (holography) phase retrieval:
- X-ray tomography reconstruction:
- Holography phase retreival:
If you find GANrec is useful in your work, please consider citing:
J. Synchrotron Rad. (2020). 27, 486-493. Available at: https://doi.org/10.1107/S1600577520000831