@@ -18,11 +18,92 @@ This repository has three main branches:
## Requirements
- gmerlin access or an nvidia gpu with cuda & drivers installed.
- apptainer
- gmerlin access or a local nvidia gpu with cuda & drivers installed.
- apptainer (see [Containerized Usage](#containerized-usage)) **or** local TensorFlow installation (see [Local Usage](#local-usage))
## Usage Overview
To use the RLN on your data you need to train and adapt the model to the noise characteristics of your camera or microscope. This can be done by the following steps:
1. Determine the PSF of the microscope or camera.
2. Use the Python script in [Phantom_generate](Phantom_generate) to generate phantoms that were blured using the PSF of your microscope.
3. Train the network using the synthetic data generated by the Python script.
4. Use the network on real world images.
# Local Usage
To use the scripts with a local installation of python. You need to install TensorFlow2. Follow this [guide](https://www.tensorflow.org/install/pip) for more details.
You may want to install TF2 in a virtual environment.
## Usage
#### Synthetic Data
There is a python [script](Phantom_generate/synthetic_data.py) to generate synthetic training data and blur it using the PSF function of the camera. See the python script for more details. There are also helper scripts available to determine the PSF of the camera from images of pinhole light sources. See [this](helper scripts/PSF/VC MIPI/README.md) for more details.
### Training
#### Data Structure
Before training, we need to create our folder structure. This can be on merlin in the /data directory or locally if you are using a local machine
are currently available. They depend on [RLN_single_Model.py](RLN_code/RLN_single_Model.py) and [TF2ImageHelpers.py](RLN_code/TF2ImageHelpers.py) being available in the same directory to funciton.
#### Monitoring the Training Progress
Using tensorboard it is possible to monitor the training progress in real-time from a web browser.
You need to have TensorFlow installed in order to use TensorBoard:
```shell
tensorbaord --logdir{path to your data}/logs
```
## Containers
# Containerized Usage
This project uses [apptainer](https://apptainer.org/docs/user/main/introduction.html) as the main container engine. Basic commands are:
```shell
apptainer build target.sif definiton.def #build the definition.def into target.sif