{"id":19666710,"url":"https://github.com/open-mmlab/denseflow","last_synced_at":"2025-04-06T12:12:26.946Z","repository":{"id":38054911,"uuid":"277727192","full_name":"open-mmlab/denseflow","owner":"open-mmlab","description":"Extracting optical flow and frames","archived":false,"fork":false,"pushed_at":"2022-03-01T00:24:14.000Z","size":247,"stargazers_count":313,"open_issues_count":41,"forks_count":61,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T11:09:03.371Z","etag":null,"topics":["denseflow","optical-flow"],"latest_commit_sha":null,"homepage":"https://open-mmlab.github.io/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-mmlab.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}},"created_at":"2020-07-07T05:41:14.000Z","updated_at":"2025-03-22T07:59:05.000Z","dependencies_parsed_at":"2022-07-14T02:10:40.315Z","dependency_job_id":null,"html_url":"https://github.com/open-mmlab/denseflow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-mmlab%2Fdenseflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-mmlab%2Fdenseflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-mmlab%2Fdenseflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-mmlab%2Fdenseflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-mmlab","download_url":"https://codeload.github.com/open-mmlab/denseflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478326,"owners_count":20945266,"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":["denseflow","optical-flow"],"created_at":"2024-11-11T16:28:40.870Z","updated_at":"2025-04-06T12:12:26.926Z","avatar_url":"https://github.com/open-mmlab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Denseflow\n\nExtracting dense flow field given a video.\n\n## Features\n\n- support multiple optical flow algorithms, including Nvidia hardware optical flow\n- support single video (or a frame folder) / a list of videos (or a list of frame folders) as input\n- support multiple output types (image, hdf5)\n- faster, 40% faster (by parallelize IO \u0026 computation)\n- record the progress when extract a list of videos, and resume by simply running the same command again (idempotent)\n\n## Install\n\n### Dependencies:\n\n- CUDA (driver version \u003e 400)\n- OpenCV (with CUDA support):\n[opencv3](https://www.learnopencv.com/install-opencv3-on-ubuntu/) |\n[opencv4](https://www.learnopencv.com/install-opencv-4-on-ubuntu-16-04/)\n- Boost\n- HDF5 (Optional)\n\n```bash\ngit clone https://github.com/open-mmlab/denseflow.git\ncd denseflow \u0026\u0026 mkdir build \u0026\u0026 cd build\ncmake -DCMAKE_INSTALL_PREFIX=$HOME/app -DUSE_HDF5=no -DUSE_NVFLOW=no ..\nmake -j\nmake install\n```\n\nIf you have trouble setting up building environments, scripts in [INSTALL](INSTALL.md) might be helpful.\n\n## Usage\n\n### Extract optical flow of a single video\n\n```bash\ndenseflow test.avi -b=20 -a=tvl1 -s=1 -v\n```\n\n- `test.avi`: input video\n- `-b=20` bound set to 20\n- `-a=tvl1` algorithm is tvl1\n- `-s=1` step is 1, ie flow of adjacent frames\n- `-v`: verbose\n\n### Extract optical flow of a list of videos\n\n```bash\ndenseflow videolist.txt -b=20 -a=tvl1 -s=1 -v\n```\n\n- `videolist.txt`: a list of video paths\n- `-b=20` bound set to 20\n- `-a=tvl1` algorithm is tvl1\n- `-s=1` step is 1, ie flow of adjacent frames\n- `-v`: verbose\n\n### Extract optical flow of a list of videos, each video is under a class folder\n\n```bash\ndenseflow videolist.txt -b=20 -a=tvl1 -s=1 -cf -v\n```\n\n- `videolist.txt`: a list of video paths\n- `-b=20` bound set to 20\n- `-a=tvl1` algorithm is tvl1\n- `-s=1` step is 1, ie flow of adjacent frames\n- `-cf` this switch means that parent folder of the video is a class name\n- `-v`: verbose\n\n### Extract optical flow of a folder of frame images\n\n```bash\ndenseflow test -b=20 -a=tvl1 -s=1 -if -v\n```\n\n- `test`: folder of the frame images\n- `-b=20` bound set to 20\n- `-a=tvl1` algorithm is tvl1\n- `-s=1` step is 1, ie flow of adjacent frames\n- `-if` indicates that inputs are frames \n- `-v`: verbose\n\n### Extract frames of a single video\n\n```bash\ndenseflow test.avi -s=0 -v\n```\n\n- `test.avi`: input video\n- `-s=0` step 0 is reserved for extracting frames\n- `-v`: verbose\n\n### Extract frames of a list of videos\n\n```bash\ndenseflow videolist.txt -s=0 -v\n```\n\n- `videolist.txt`: a list of video paths\n- `-s=1` step is 1, ie flow of adjacent frames\n- `-s=0` step 0 is reserved for extracting frames\n- `-v`: verbose\n\n## Documentation\n\n```bash\n$ denseflow -h\nGPU optical flow extraction.\nUsage: denseflow [params] input\n\n        -a, --algorithm (value:tvl1)\n                optical flow algorithm (nv/tvl1/farn/brox)\n        -b, --bound (value:32)\n                maximum of optical flow\n        --cf, --classFolder\n                outputDir/class/video/flow.jpg\n        -f, --force\n                regardless of the marked .done file\n        -h, --help (value:true)\n                print help message\n        --if, --inputFrames\n                inputs are frames\n        --newHeight, --nh (value:0)\n                new height\n        --newShort, --ns (value:0)\n                short side length\n        --newWidth, --nw (value:0)\n                new width\n        -o, --outputDir (value:.)\n                root dir of output\n        -s, --step (value:0)\n                right - left (0 for img, non-0 for flow)\n        --saveType, --st (value:jpg)\n                save format type (png/h5/jpg)\n        -v, --verbose\n                verbose\n\n        input\n                filename of video or folder of frames or a list.txt of those\n```\n\n## Citation\n\nIf you use this tool in your research, please cite this project.\n\n```\n@misc{denseflow,\n  author =       {Wang, Shiguang* and Li, Zhizhong* and Zhao, Yue and Xiong, Yuanjun and Wang, Limin and Lin, Dahua},\n  title =        {{denseflow}},\n  howpublished = {\\url{https://github.com/open-mmlab/denseflow}},\n  year =         {2020}\n}\n```\n\n## Acknowledgement\n\nRewritten based on [yuanjun's fork of dense_flow](https://github.com/yjxiong/dense_flow).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-mmlab%2Fdenseflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-mmlab%2Fdenseflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-mmlab%2Fdenseflow/lists"}