This repository contains all samples generated in the paper "Conditional diffusion-based microstructure reconstruction". For training and sampling of the conditional diffusion models the implementation of OpenAI improved-difusion and "Improved Denoising Diffusion Probabilistic Models" was used, respectively.
The following READDME.md
contains the instructions to vizualize the generated samples. The samples are stored as *.npz
containing 64 samples the size 256x256x3 [h,w,c]
for each class and correspdoning model introduced in "Conditional diffusion-based microstructure reconstruction".
- Python3
- numpy >= 1.22.3
- pillow >= 9.1.0
- matplotlib >= 3.5.2
to install all necessary packages and their dependencies please run
python -m pip install -r requirements.txt
sometimes you may run
python3 -m pip install -r requirements.txt
Just to vizualize the sampled microstructures you can set only the --file=<path-to-file>
argument:
python vizualize_samples.py --file=<path-to-file>
This is the expected outpt as a matplotlib
figure:
If you want to save the samples in ´*.tif´ imagefile format you have to specify the output directory with the argument --dir=<path-to-save-images>
:
python vizualize_samples.py --file=<path-to-file> --dir=<path-to-save-images>
The following table shows selected images from the coresponding sample files and class, respectively.
class | sample file | example image |
---|---|---|
martensite | ||
biological | ||
FVC60 |