From fe80a0682716739bc6dc2fbeac529dc14ff19786 Mon Sep 17 00:00:00 2001 From: Lucas Beveridge Date: Fri, 1 Sep 2023 10:00:58 +0100 Subject: [PATCH] Updated README.md --- README.md | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index f4e756f..339ae5c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The network can train on both synthetic and real-life data.
### Requirements - A Linux machine with a GPU and CUDA - Conda - - Python 3.9 + - Python 3.9+ - PyTorch - TomoPy @@ -20,31 +20,21 @@ First, set up the project environment: - Create the conda environment: `conda env create -f environment.yml` - Activate the conda environment: `conda activate nostripesnet` -#### Generate Data -Next, generate some data to train/test on.
-If you have access to an HDF5 or Nexus file, you can generate a dataset from real-life data.
-Otherwise, you are limited to just synthetic data.
- - Open the data generation script in a text editor: [run_scripts/data_generator.sh](run_scripts/data_generator.sh) - - Change the parameters to suit your use case - - Run the script: `./run_scripts/data_generator.sh` -For more information about the data created & the parameters, see [this description](simulator/README.md). - -#### Train a Model -Finally, train a model on the generated data.
-Run the following to see information about the options you can specify:
-`python -m network.training -h`
-Then choose the values of the options you want to specify, and run the same command again (without `-h`).
-For example, if training a masked model, you might run something like this:
-`python -m network.training --model mask --epochs 10 --save-dir ./data --verbose`
- -Follow the same procedure for testing:
-`python -m network.testing -h`
-Choose your parameters, then run again with those options.
- -If you want to both train and test a model all at once, follow these steps:
- - Open the [train/test script](run_scripts/train_test.sh) in a text editor - - Specify the values of the parameters you want to train & test with - - Run the script: `./run_scripts/train_test.sh` +### The Repository +- `network/` contains Python code to train and test a model, as well as the dataset and visualiser classes. +- `run_scripts/` contains bash scripts to generate masks & datasets and train/test models. +- `simulator` contains Python code to generate masks & datasets. +- `utils/` - contains utility functions used throughout the codebase. +- `TUTORIAL.md` is a walkthrough of how to generate a dataset, and train & apply a model. +- `apply_model.py` is a program that applies a model to a given tomographic scan. +- `graphs.ipynb` is a Jupyter Notebook used to create the graphs in the paper. +- `residuals.ipynb` is a Jupyter Notebook used to create the residual images in the paper. +- `rmse.ipynb` is a Jupyter Notebook used to calculate the RMSEs in the paper. +- `submit.sh` is a bash script to train a model on multiple nodes, using multiple GPUs on each. +- `visualize_results.ipynb` is a Jupyter Notebook used to visualize the results of a model. + -A graph of the training losses will be saved to `NoStripesNet/images`.
\ No newline at end of file +### Running the Code +A full walkthrough of how to generate a dataset and train a model can be found [here](./TUTORIAL.md).
+To apply a trained model to a tomographic scan, see [run_scripts/apply_model.sh](./run_scripts/apply_model.sh).