项目作者: DreamIP

项目描述 :
Subpixel displacement and strain fields estimation with deep learning
高级语言: Python
项目地址: git://github.com/DreamIP/StrainNet.git
创建时间: 2020-06-17T09:10:24Z
项目社区:https://github.com/DreamIP/StrainNet

开源协议:Other

下载


StrainNet (Pytorch implementation)

StrainNet estimates subpixelic displacement and strain fields from pairs of reference and deformed images of a flat speckled surface, as Digital Image Correlation (DIC) does. See papers [1] and [2] for details.

If you find this implementation useful, please cite references [1] and [2]. Also, make sure to adhere to the licensing terms of the authors.

Prerequisite

Install the following modules:

  1. pytorch >= 1.2
  2. torchvision
  3. tensorboardX
  4. imageio
  5. argparse
  6. path.py
  7. numpy
  8. pandas
  9. tqdm

Training

  1. Generate Speckle dataset 1.0 or 2.0
  2. Specify the paths to:
    Train dataset, Test dataset, Train_annotations.csv, and Test_annotations.csv in the file Train.py (exactly in the definition of train_set and test_set)
  3. Execute the following commands
    1. python Train.py --arch StrainNet_h
    2. python Train.py --arch StrainNet_f

Running inference

The images pairs should be in the same location, with the name pattern 1.ext 2.ext

  1. python inference.py /path/to/input/images/ --arch StrainNet_h --pretrained /path/to/pretrained/model
  2. python inference.py /path/to/input/images/ --arch StrainNet_f --pretrained /path/to/pretrained/model
  3. python inference.py /path/to/input/images/ --arch StrainNet_l --pretrained /path/to/pretrained/model

Pretrained Models

The pretrained models of StrainNet-h, StrainNet_f and StrainNet_l are available here

Results of star images

Execute the following commands in the StrainNet directory (please also copy here the tar files if you use the pretrained models)

  1. python inference.py ../Star_frames/Noiseless_frames/ --arch StrainNet_h --pretrained StrainNet-h.pth.tar
  2. python inference.py ../Star_frames/Noiseless_frames/ --arch StrainNet_f --pretrained StrainNet-f.pth.tar
  3. python inference.py ../Star_frames/Noiseless_frames/ --arch StrainNet_l --pretrained StrainNet-l.pth.tar

The output of inference.py can be found in Star_frames/Noiseless_frames/flow/

You can use Script_flow.m to visualize the obtained displacements

Reference image
Reference displacement
Retrieved by StrainNet-h
Retrieved by StrainNet-f
Retrieved by StrainNet-l

Reference

[1] S. Boukhtache, K. Abdelouahab, F. Berry, B. Blaysat, M. Grédiac and F. Sur. “When Deep Learning Meets Digital Image Correlation”, Optics and Lasers in Engineering, Volume 136, 2021. Available at:

https://www.sciencedirect.com/science/article/pii/S0143816620306588?via%3Dihub

https://hal.archives-ouvertes.fr/hal-02933431

https://arxiv.org/abs/2009.03993

[2] S. Boukhtache, K. Abdelouahab, A. Bahou, F. Berry, B. Blaysat, M. Grédiac and F. Sur. “A lightweight convolutional neural network as an alternative to DIC to measure in-plane displacement fields”, Optics and Lasers in Engineering, 2022.

Acknowledgments

This code is based on the Pytorch implmentation of FlowNetS from FlowNetPytorch