Package: ptlflow
PyTorch Lightning Optical FlowIntroductionThis is a collection of state-of-the-art deep model for estimating optical flow. The main goal is to provide a unified framework where multiple models can be trained and tested more easily.The work and code from many others are present here. I tried to make sure everything is properly referenced, but please let me know if I missed something.This is still under development, so some things may not work as intended. I plan to add more models in the future, as well keep improving the platform.What's newAvailable modelsResultsGetting startedLicensesContributingCitingAcknowledgementsWhat's new- v0.3.0Added new models:DIPhttps://arxiv.org/abs/2204.00330Flow1Dhttps://arxiv.org/abs/2103.04524FlowFormer++https://arxiv.org/abs/2303.01237GMFlow+, UniMatchhttps://arxiv.org/abs/2211.05783MatchFlowhttps://arxiv.org/abs/2303.08384MS-RAFT+https://arxiv.org/abs/2210.16900RPKNethttps://hmorimitsu.com/publication/2024-aaai-rpknetSeparableFlowhttps://openaccess.thecvf.com/content/ICCV2021/papers/Zhang_Separable_Flow_Learning_Motion_Cost_Volumes_for_Optical_Flow_Estimation_ICCV_2021_paper.pdfSKFlowhttps://arxiv.org/abs/2205.14623VideoFlowhttps://arxiv.org/abs/2303.08340speed_benchmark.pybecomesmodel_benchmark.pyand records more metricsFix compatibility with PyTorch 2.0Fix compatibility with PyTorch Lightning 1.9Fix resizing augmentation when the valid mask is sparseAdd support for more datasets:Middleburyhttps://vision.middlebury.edu/flow/Monkaahttps://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.htmlSpringhttps://spring-benchmark.org/Available modelsCRAFThttps://arxiv.org/abs/2203.16896CSFlowhttps://arxiv.org/abs/2202.00909DICL-Flowhttps://arxiv.org/abs/2010.14851DIPhttps://arxiv.org/abs/2204.00330FastFlowNethttps://arxiv.org/abs/2103.04524Flow1Dhttps://arxiv.org/abs/2103.04524FlowFormerhttps://arxiv.org/abs/2203.16194FlowFormer++https://arxiv.org/abs/2303.01237FlowNethttps://arxiv.org/abs/1504.06852FlowNet2https://arxiv.org/abs/1612.01925GMAhttps://arxiv.org/abs/2104.02409GMFlowhttps://arxiv.org/abs/2111.13680GMFlow+, UniMatchhttps://arxiv.org/abs/2211.05783GMFlowNethttps://arxiv.org/abs/2203.11335HD3https://arxiv.org/abs/1812.06264IRRhttps://arxiv.org/abs/1904.05290LCVhttps://arxiv.org/abs/2007.11431LiteFlowNethttps://arxiv.org/abs/1805.07036LiteFlowNet2https://arxiv.org/abs/1903.07414LiteFlowNet3https://arxiv.org/abs/2007.09319MaskFlownethttps://arxiv.org/abs/2003.10955MatchFlowhttps://arxiv.org/abs/2303.08384MS-RAFT+https://arxiv.org/abs/2210.16900PWCNethttps://arxiv.org/abs/1709.02371RAFThttps://arxiv.org/abs/2003.12039RPKNethttps://hmorimitsu.com/publication/2024-aaai-rpknetScopeFlowhttps://arxiv.org/abs/2002.10770SCVhttps://arxiv.org/abs/2104.02166SeparableFlowhttps://openaccess.thecvf.com/content/ICCV2021/papers/Zhang_Separable_Flow_Learning_Motion_Cost_Volumes_for_Optical_Flow_Estimation_ICCV_2021_paper.pdfSKFlowhttps://arxiv.org/abs/2205.14623STaRFlowhttps://arxiv.org/abs/2007.05481VCNhttps://papers.nips.cc/paper/2019/file/bbf94b34eb32268ada57a3be5062fe7d-Paper.pdfVideoFlowhttps://arxiv.org/abs/2303.08340Read more details about the models onhttps://ptlflow.readthedocs.io/en/latest/models/models_list.html.ResultsYou can see a table with main evaluation results of the available modelshere. More results are also available in the folderdocs/source/results.Disclaimer: These results are the ones obtained by evaluating the available models in this framework in my machine. Your results may be different due to differences in hardware and software. I also do not guarantee that the results of each model will be similar to the ones presented in the respective papers or other original sources. If you need to replicate the original results from a paper, you should use the original implementations.Getting startedPlease take a look at thedocumentationto learn how to install and use PTLFlow.You can also check the notebooks below running on Google Colab for some practical examples:Inference with a pretrained model.Training and using the learned weights for inference.LicensesThe original code of this repository is licensed under theApache 2.0 license.Each model may be subjected to different licenses. The license of each model is included in their respective folders. It is your responsibility to make sure that your project is in compliance with all the licenses and conditions involved.The external pretrained weights all have different licenses, which are listed in their respective folders.The pretrained weights that were trained within this project are available under theCC BY-NC-SA 4.0 license, which I believe that covers the licenses of the datasets used in the training. That being said, I am not a legal expert so if you plan to use them to any purpose other than research, you should check all the involved licenses by yourself. Additionally, the datasets used for the training usually require the user to cite the original papers, so be sure to include their respective references in your work.ContributingContribution are welcome! Please checkCONTRIBUTING.mdto see how to contribute.CitingBibTeX@misc{morimitsu2021ptlflow,
  author = {Henrique Morimitsu},
  title = {PyTorch Lightning Optical Flow},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/hmorimitsu/ptlflow}}
}AcknowledgementsThis README file is heavily inspired by the one from thetimmrepository.Some parts of the code were inspired by or taken fromFlowNetPytorch.flownet2-pytorchwas also another important source.The current main training routine is based onRAFT.