{"id":43212404,"url":"https://github.com/megvii-research/agflow","last_synced_at":"2026-02-01T07:34:07.017Z","repository":{"id":45264377,"uuid":"436634597","full_name":"megvii-research/AGFlow","owner":"megvii-research","description":"Learning Optical Flow with Adaptive Graph Reasoning (AGFlow, AAAI-2022)","archived":false,"fork":false,"pushed_at":"2022-09-17T08:18:31.000Z","size":77,"stargazers_count":36,"open_issues_count":4,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-01-29T22:47:07.285Z","etag":null,"topics":["optical-flow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/megvii-research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-09T13:51:26.000Z","updated_at":"2024-01-04T17:04:01.000Z","dependencies_parsed_at":"2023-01-18T11:37:34.956Z","dependency_job_id":null,"html_url":"https://github.com/megvii-research/AGFlow","commit_stats":null,"previous_names":["la30/agflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/megvii-research/AGFlow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megvii-research%2FAGFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megvii-research%2FAGFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megvii-research%2FAGFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megvii-research%2FAGFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megvii-research","download_url":"https://codeload.github.com/megvii-research/AGFlow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megvii-research%2FAGFlow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28972584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T06:46:42.625Z","status":"ssl_error","status_checked_at":"2026-02-01T06:44:56.173Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["optical-flow"],"created_at":"2026-02-01T07:34:06.486Z","updated_at":"2026-02-01T07:34:07.010Z","avatar_url":"https://github.com/megvii-research.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e [AAAI2022]Learning Optical Flow with Adaptive Graph Reasoning \u003c/h2\u003e \n\n\n\u003ch4 align=\"center\"\u003eAo Luo\u003csup\u003e1\u003c/sup\u003e, Fan Fang\u003csup\u003e2\u003c/sup\u003e, Kunming Luo\u003csup\u003e1\u003c/sup\u003e, Xin Li\u003csup\u003e2\u003c/sup\u003e, Haoqiang Fan\u003csup\u003e1\u003c/sup\u003e, Shuaicheng Liu\u003csup\u003e3\u003c/sup\u003e\u003c/h4\u003e\n\u003ch4 align=\"center\"\u003e1. Megvii Research,             2. Group 42\u003c/h4\u003e\n\u003ch4 align=\"center\"\u003e3. University of Electronic Science and Technology of China\u003c/h4\u003e\n\n\n\n\n\nThis is the official implementation of 'Learning Optical Flow with Adaptive Graph Reasoning', named as 'AGFlow' for short, AAAI 2022, [[paper](https://www.aaai.org/AAAI22Papers/AAAI-1843.LuoA.pdf)]\n\n## Presentation Video\n[[Youtube](https://www.youtube.com/watch?v=7ywAgSTaj1A)], [[Bilibili](https://www.bilibili.com/video/BV1Fm4y1f7QC/)]\n\n## Abstract\nEstimating per-pixel motion between video frames, known as optical flow, is a long-standing problem in video understanding and analysis. Most contemporary optical flow techniques largely focus on addressing the cross-image matching with feature similarity, with few methods considering how to explicitly reason over the given scene for achieving a holistic motion understanding. In this work, taking a fresh perspective, we introduce a novel graph-based approach, called adaptive graph reasoning for optical flow (AGFlow), to emphasize the value of scene/context information in optical flow. Our key idea is to decouple the context reasoning from the matching procedure, and exploit scene information to effectively assist motion estimation by learning to reason over the adaptive graph. The proposed AGFlow can effectively exploit the context information and incorporate it within the matching procedure, producing more robust and accurate results. On both Sintel clean and final passes, our AGFlow achieves the best accuracy with EPE of 1.43 and 2.47 pixels, outperforming state-of-the-art approaches by 11.2% and 13.6%, respectively.\n\n\n## Overview\n\nWe propose a novel graph-based approach, called adaptive graph reasoning for optical flow (AGFlow), to emphasize the value of scene context in optical flow. Our key idea is to decouple the context reasoning from the matching procedure, and exploit scene information to effectively assist motion estimation by learning to reason over the adaptive graph. \n\n\u003cimg width=\"1000\" alt=\"overview\" src=\"https://user-images.githubusercontent.com/47421121/147655606-bd8a1640-5c57-4c23-a50d-57661ec49f54.png\"\u003e\n\n## Requirements\n\nPython 3.6 with following packages\n```Shell\npytorch==1.6.0\ntorchvision==0.7.0\nmatplotlib\nscipy\nopencv-python\ntensorboard\n```\n(The code has been tested on Cuda 10.0.)\n\n## Usage\n\n1. The trained weights are available on [GoogleDrive](https://drive.google.com/drive/folders/1Bnijg9VPJwc9RPk0wOJNx8ngxXBnrGsV?usp=sharing). Put `*.pth` files into folder `./weights`.\n\n2. Download [Sintel](http://sintel.is.tue.mpg.de/) and [KITTI](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow) dataset, and set the root path of each class in `./core/datasets.py`.\n\n\n3. Evaluation on Sintel\n```Shell\n./eval_sintel.sh\n```\n\n4. Evaluation on KITTI\n```Shell\n./eval_kitti.sh\n```\n\n![results](https://user-images.githubusercontent.com/1344482/180935818-1f77400a-6a60-48e5-aed2-7cd274269785.JPG)\n\n\n## Citation\n\nIf you think this work is helpful, please cite\n```\n@InProceedings{luo2022learning,\n  title={Learning Optical Flow with Adaptive Graph Reasoning},\n  author={Luo, Ao and Yang, Fan and Luo, Kunming and Li, Xin and Fan, Haoqiang and Liu, Shuaicheng},\n  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence (AAAI)},\n  year={2022},\n}\n```\n\nIf you have any questions, please contact me at (aoluo_uestc@hotmail.com).\n\n## Acknowledgement\n\nThe main framework is adapted from [RAFT](https://github.com/princeton-vl/RAFT). We thank the authors for the contribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegvii-research%2Fagflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegvii-research%2Fagflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegvii-research%2Fagflow/lists"}