{"id":13443915,"url":"https://github.com/NVIDIA/flownet2-pytorch","last_synced_at":"2025-03-20T17:32:20.880Z","repository":{"id":37693016,"uuid":"111462767","full_name":"NVIDIA/flownet2-pytorch","owner":"NVIDIA","description":"Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks","archived":false,"fork":false,"pushed_at":"2023-05-28T03:47:53.000Z","size":6436,"stargazers_count":3199,"open_issues_count":166,"forks_count":744,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-03-16T10:12:04.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NVIDIA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-11-20T21:05:31.000Z","updated_at":"2025-03-15T13:54:51.000Z","dependencies_parsed_at":"2023-10-20T23:15:23.226Z","dependency_job_id":null,"html_url":"https://github.com/NVIDIA/flownet2-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fflownet2-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fflownet2-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fflownet2-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NVIDIA%2Fflownet2-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NVIDIA","download_url":"https://codeload.github.com/NVIDIA/flownet2-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244660660,"owners_count":20489373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:02:13.791Z","updated_at":"2025-03-20T17:32:15.871Z","avatar_url":"https://github.com/NVIDIA.png","language":"Python","funding_links":[],"categories":["Python","Sensor Processing","Paper implementations｜论文实现","Paper implementations"],"sub_categories":["Image Processing","Other libraries｜其他库:","Other libraries:"],"readme":"# flownet2-pytorch \n\nPytorch implementation of [FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks](https://arxiv.org/abs/1612.01925). \n\nMultiple GPU training is supported, and the code provides examples for training or inference on [MPI-Sintel](http://sintel.is.tue.mpg.de/) clean and final datasets. The same commands can be used for training or inference with other datasets. See below for more detail.\n\nInference using fp16 (half-precision) is also supported.\n\nFor more help, type \u003cbr /\u003e\n    \n    python main.py --help\n\n## Network architectures\nBelow are the different flownet neural network architectures that are provided. \u003cbr /\u003e\nA batchnorm version for each network is also available.\n\n - **FlowNet2S**\n - **FlowNet2C**\n - **FlowNet2CS**\n - **FlowNet2CSS**\n - **FlowNet2SD**\n - **FlowNet2**\n\n## Custom layers\n\n`FlowNet2` or `FlowNet2C*` achitectures rely on custom layers `Resample2d` or `Correlation`. \u003cbr /\u003e\nA pytorch implementation of these layers with cuda kernels are available at [./networks](./networks). \u003cbr /\u003e\nNote : Currently, half precision kernels are not available for these layers.\n\n## Data Loaders\n\nDataloaders for FlyingChairs, FlyingThings, ChairsSDHom and ImagesFromFolder are available in [datasets.py](./datasets.py). \u003cbr /\u003e\n\n## Loss Functions\n\nL1 and L2 losses with multi-scale support are available in [losses.py](./losses.py). \u003cbr /\u003e\n\n## Installation \n\n    # get flownet2-pytorch source\n    git clone https://github.com/NVIDIA/flownet2-pytorch.git\n    cd flownet2-pytorch\n\n    # install custom layers\n    bash install.sh\n    \n### Python requirements \nCurrently, the code supports python 3\n* numpy \n* PyTorch ( == 0.4.1, for \u003c= 0.4.0 see branch [python36-PyTorch0.4](https://github.com/NVIDIA/flownet2-pytorch/tree/python36-PyTorch0.4))\n* scipy \n* scikit-image\n* tensorboardX\n* colorama, tqdm, setproctitle \n\n## Converted Caffe Pre-trained Models\nWe've included caffe pre-trained models. Should you use these pre-trained weights, please adhere to the [license agreements](https://drive.google.com/file/d/1TVv0BnNFh3rpHZvD-easMb9jYrPE2Eqd/view?usp=sharing). \n\n* [FlowNet2](https://drive.google.com/file/d/1hF8vS6YeHkx3j2pfCeQqqZGwA_PJq_Da/view?usp=sharing)[620MB]\n* [FlowNet2-C](https://drive.google.com/file/d/1BFT6b7KgKJC8rA59RmOVAXRM_S7aSfKE/view?usp=sharing)[149MB]\n* [FlowNet2-CS](https://drive.google.com/file/d/1iBJ1_o7PloaINpa8m7u_7TsLCX0Dt_jS/view?usp=sharing)[297MB]\n* [FlowNet2-CSS](https://drive.google.com/file/d/157zuzVf4YMN6ABAQgZc8rRmR5cgWzSu8/view?usp=sharing)[445MB]\n* [FlowNet2-CSS-ft-sd](https://drive.google.com/file/d/1R5xafCIzJCXc8ia4TGfC65irmTNiMg6u/view?usp=sharing)[445MB]\n* [FlowNet2-S](https://drive.google.com/file/d/1V61dZjFomwlynwlYklJHC-TLfdFom3Lg/view?usp=sharing)[148MB]\n* [FlowNet2-SD](https://drive.google.com/file/d/1QW03eyYG_vD-dT-Mx4wopYvtPu_msTKn/view?usp=sharing)[173MB]\n    \n## Inference\n    # Example on MPISintel Clean   \n    python main.py --inference --model FlowNet2 --save_flow --inference_dataset MpiSintelClean \\\n    --inference_dataset_root /path/to/mpi-sintel/clean/dataset \\\n    --resume /path/to/checkpoints \n    \n## Training and validation\n\n    # Example on MPISintel Final and Clean, with L1Loss on FlowNet2 model\n    python main.py --batch_size 8 --model FlowNet2 --loss=L1Loss --optimizer=Adam --optimizer_lr=1e-4 \\\n    --training_dataset MpiSintelFinal --training_dataset_root /path/to/mpi-sintel/final/dataset  \\\n    --validation_dataset MpiSintelClean --validation_dataset_root /path/to/mpi-sintel/clean/dataset\n\n    # Example on MPISintel Final and Clean, with MultiScale loss on FlowNet2C model \n    python main.py --batch_size 8 --model FlowNet2C --optimizer=Adam --optimizer_lr=1e-4 --loss=MultiScale --loss_norm=L1 \\\n    --loss_numScales=5 --loss_startScale=4 --optimizer_lr=1e-4 --crop_size 384 512 \\\n    --training_dataset FlyingChairs --training_dataset_root /path/to/flying-chairs/dataset  \\\n    --validation_dataset MpiSintelClean --validation_dataset_root /path/to/mpi-sintel/clean/dataset\n    \n## Results on MPI-Sintel\n[![Predicted flows on MPI-Sintel](./image.png)](https://www.youtube.com/watch?v=HtBmabY8aeU \"Predicted flows on MPI-Sintel\")\n\n## Reference \nIf you find this implementation useful in your work, please acknowledge it appropriately and cite the paper:\n````\n@InProceedings{IMKDB17,\n  author       = \"E. Ilg and N. Mayer and T. Saikia and M. Keuper and A. Dosovitskiy and T. Brox\",\n  title        = \"FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks\",\n  booktitle    = \"IEEE Conference on Computer Vision and Pattern Recognition (CVPR)\",\n  month        = \"Jul\",\n  year         = \"2017\",\n  url          = \"http://lmb.informatik.uni-freiburg.de//Publications/2017/IMKDB17\"\n}\n````\n```\n@misc{flownet2-pytorch,\n  author = {Fitsum Reda and Robert Pottorff and Jon Barker and Bryan Catanzaro},\n  title = {flownet2-pytorch: Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks},\n  year = {2017},\n  publisher = {GitHub},\n  journal = {GitHub repository},\n  howpublished = {\\url{https://github.com/NVIDIA/flownet2-pytorch}}\n}\n```\n## Related Optical Flow Work from Nvidia \nCode (in Caffe and Pytorch): [PWC-Net](https://github.com/NVlabs/PWC-Net) \u003cbr /\u003e\nPaper : [PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume](https://arxiv.org/abs/1709.02371). \n\n## Acknowledgments\nParts of this code were derived, as noted in the code, from [ClementPinard/FlowNetPytorch](https://github.com/ClementPinard/FlowNetPytorch).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNVIDIA%2Fflownet2-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNVIDIA%2Fflownet2-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNVIDIA%2Fflownet2-pytorch/lists"}