This project trains a Generative Adversarial Network (GAN) to synthesize realistic microstructure images based on input RGB image data. It supports multi-class training and saves both intermediate and final results for further analysis.
Follow the steps below to set up the environment and run the project.
β Step 1: Install Miniconda
- Download the Miniconda installer: Miniconda for Windows
- Run the
.exeinstaller and follow the prompts. - Open the Anaconda Prompt after installation.
# Download and install Miniconda
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash Miniconda3-latest-MacOSX-x86_64.shThen restart your terminal.
# Download and install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.shThen restart your shell or run: source ~/.bashrc
Clone the repository (or download the files) and make sure you're in the root directory.
git clone https://github.com/cmaloney111/deep-microstructure-reconstruction.git
conda env create -f environment.yml
conda activate MicroReccd src/new-final-ganYour RGB image folder should be structured like this:
/path/to/RGB-image-folder/
βββ class_0/
β βββ image_0.jpg
β βββ image_1.jpg
β βββ ...
βββ class_1/
β βββ image_0.jpg
β βββ image_1.jpg
β βββ ...
βββ ...
Each subfolder represents a class label (e.g., microstructure type), and contains images in .jpg/.jpeg, .png, or .tif format.
python train.py --path /path/to/RGB-image-folderArguments:
--path: Path to the root folder containing your image classes.
Example:
python train.py --path ./data/microstructuresAfter training, you will find:
- Generated images (images folder)
- Model checkpoints (models folder)