{"id":20434206,"url":"https://github.com/vt-vl-lab/df-net","last_synced_at":"2026-02-27T01:32:15.343Z","repository":{"id":52919339,"uuid":"147424369","full_name":"vt-vl-lab/DF-Net","owner":"vt-vl-lab","description":"[ECCV 2018] DF-Net: Unsupervised Joint Learning of Depth and Flow using Cross-Task Consistency","archived":false,"fork":false,"pushed_at":"2018-09-11T09:58:18.000Z","size":27314,"stargazers_count":212,"open_issues_count":4,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-21T19:39:52.610Z","etag":null,"topics":["depth","optical-flow","self-supervised-learning"],"latest_commit_sha":null,"homepage":"http://yuliang.vision/DF-Net/","language":"Python","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/vt-vl-lab.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":"2018-09-04T21:53:12.000Z","updated_at":"2025-01-08T15:07:40.000Z","dependencies_parsed_at":"2022-08-23T15:22:32.531Z","dependency_job_id":null,"html_url":"https://github.com/vt-vl-lab/DF-Net","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vt-vl-lab/DF-Net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vt-vl-lab%2FDF-Net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vt-vl-lab%2FDF-Net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vt-vl-lab%2FDF-Net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vt-vl-lab%2FDF-Net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vt-vl-lab","download_url":"https://codeload.github.com/vt-vl-lab/DF-Net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vt-vl-lab%2FDF-Net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["depth","optical-flow","self-supervised-learning"],"created_at":"2024-11-15T08:25:05.799Z","updated_at":"2026-02-27T01:32:15.321Z","avatar_url":"https://github.com/vt-vl-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DF-Net: Unsupervised Joint Learning of Depth and Flow using Cross-Task Consistency\n\nA TensorFlow re-implementation for [DF-Net: Unsupervised Joint Learning of Depth and Flow using Cross-Task Consistency](https://arxiv.org/abs/1809.01649). There are some minor differences from the model described in the paper:\n\n- Model in the paper uses 2-frame as input, while this code uses 5-frame as input (you might use any odd numbers of frames as input, though you would need to tune the hyper-parameters)\n- FlowNet in the paper is pre-trained on SYNTHIA, while this one is pre-trained on Cityscapes\n\nPlease see the [project page](http://yuliang.vision/DF-Net/) for more details. \n\n\u003cimg src=\"misc/zou2018dfnet.gif\"\u003e\n\n\n## Prerequisites\nThis codebase was developed and tested with the following settings:\n```\nPython 3.6\nTensorFlow 1.2.0 (this is the only supported version)\ng++ 4.x (this is the only supported version)\nCUDA 8.0\nUnbuntu 14.04\n4 Tesla K80 GPUs (w/ 12G memory each)\n```\n\nSome Python packages you might not have\n```\npypng\nopencv-python\n```\n\n## Installation\n1. Clone this repository\n```Shell\ngit clone git@github.com:vt-vl-lab/DF-Net.git\ncd DF-Net\n```\n\n2. Prepare models and training data\n```Shell\nchmod +x ./misc/prepare.sh\n./misc/prepare.sh\n```\nNOTE: Frames belonging to KITTI2012/2015 train/test scenes have been excluded in the provided training set. Add these frames back to the training set would improve the performance of DepthNet.\n\n## Data preparation (for evaluation)\nAfter accepting their license conditions, download [KITTI raw](http://www.cvlibs.net/datasets/kitti/raw_data.php), [KITTI flow 2012](http://www.cvlibs.net/datasets/kitti/eval_stereo_flow.php?benchmark=flow), [KITTI flow 2015](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow).\n\nThen you can make soft-link for them\n```Shell\ncd dataset\nmkdir KITTI\ncd KITTI\n\nln -s /path/to/KITTI/raw raw\nln -s /path/to/KITTI/2012 flow2012\nln -s /path/to/KITTI/2015 flow2015\n```\n\n**(Optional)** You can add those KITTI2012/2015 frames back to the training set, by commenting line81~line85 in `data/kitti/kitti_raw_loader.py`, and do\n```\npython data/prepare_train_data.py --dataset_name='kitti_raw_eigen' --dump_root=/path/to/save/ --num_threads=4\n```\n\n## Training\n```\nexport CUDA_VISIBLE_DEVICES=0,1,2,3\npython train_df.py --dataset_dir=/path/to/your/data --checkpoint_dir=/path/to/save/your/model\n```\n\nFor the first time, custom CUDA operations for FlowNet will be compiled. If you have any compliation issues, please check `core/UnFlow/src/e2eflow/ops.py` \n- Line31: specify your CUDA path\n- Line32: Add `-I $CUDA_HOME/include`, where `$CUDA_HOME` is your CUDA directory\n- Line38: specify your g++ version\n\n## Testing\nTest DepthNet on KITTI raw (You can use the validation set to selct the best model.)\n```\npython test_kitti_depth.py --dataset_dir=/path/to/your/data --output_dir=/path/to/save/your/prediction --ckpt_file=/path/to/your/ckpt --split=\"val or test\"\npython kitti_eval/eval_depth.py --pred_file=/path/to/your/prediction --split=\"val or test\"\n```\n\nTest FlowNet on KITTI 2012 (Please use training set)\n```\npython test_flownet_2012.py --dataset_dir=/path/to/your/data --ckpt_file=/path/to/your/ckpt\n```\n\nTest FlowNet on KITTI 2015 (Please use training set)\n```\npython test_flownet_2015.py --dataset_dir=/path/to/your/data --ckpt_file=/path/to/your/ckpt\n```\n\nNOTE: For KITTI 2012/2015\n- If you want to generate visualization colormap for **training set**, you can specify `output_dir`\n- If you want to test on **test set** and upload it to KITTI server, you can specify `output_dir` and test on test set.\n\n## Pre-trained model performance\nYou should get the following numbers if you use the pre-trained model `pretrained/dfnet`\n\n\nDepthNet (KITTI raw test test)\n\nabs rel | sq rel | rms | log rms | a1 | a2 | a3 |\n---------------|------------|------------|------------|------------|------------|------------|\n0.1452 | 1.2904 | 5.6115 | 0.2194 | 0.8114 | 0.9394 | 0.9767 |\n\n\nFlowNet (KITTI 2012/2015 training set)\n\nKITTI 2012 EPE | KITTI 2015 EPE | KITTI 2015 F1 | \n---------------|----------------|---------------|\n3.1052 | 7.4482 | 0.2695 |\n\n\n## Citation\nIf you find this code useful for your research, please consider citing the following paper:\n\n    @inproceedings{zou2018dfnet,\n    author    = {Zou, Yuliang and Luo, Zelun and Huang, Jia-Bin}, \n    title     = {DF-Net: Unsupervised Joint Learning of Depth and Flow using Cross-Task Consistency}, \n    booktitle = {European Conference on Computer Vision},\n    year      = {2018}\n    }\n\n\n## Acknowledgement\nCodes are heavily borrowed from several great work, including [SfMLearner](https://github.com/tinghuiz/SfMLearner), [monodepth](https://github.com/mrharicot/monodepth), and [UnFlow](https://github.com/simonmeister/UnFlow). We thank [Shih-Yang Su](https://github.com/LemonATsu) for the code review.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvt-vl-lab%2Fdf-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvt-vl-lab%2Fdf-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvt-vl-lab%2Fdf-net/lists"}