GithubHelp home page GithubHelp logo

joewang45 / strainnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dreamip/strainnet

0.0 0.0 0.0 25.81 MB

Subpixelic displacement and strain fields estimation with deep learning

License: Other

MATLAB 27.26% Python 72.74%

strainnet's Introduction

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 paper [1] for details.

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

Prerequisite

Install the following modules:

pytorch >= 1.2
torchvision
tensorboardX 
imageio
argparse
path.py
numpy
pandas
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
python Train.py --arch StrainNet_h 
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

python inference.py /path/to/input/images/  --arch StrainNet_h  --pretrained /path/to/pretrained/model
python inference.py /path/to/input/images/  --arch StrainNet_f  --pretrained /path/to/pretrained/model  

Pretrained Models

The pretrained models of StrainNet-h and StrainNet_f 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)

python inference.py ../Star_frames/Noiseless_frames/  --arch StrainNet_h  --pretrained StrainNet-h.pth.tar
python inference.py ../Star_frames/Noiseless_frames/  --arch StrainNet_f  --pretrained StrainNet-f.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

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

Acknowledgments

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

strainnet's People

Contributors

kamelabdelouahab avatar seyfeddineboukhtache avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.