+
+
+
+
+## Requirements
+The code has been tested with PyTorch 1.6 and Cuda 10.1.
+```Shell
+conda create --name raft
+conda activate raft
+conda install pytorch=1.6.0 torchvision=0.7.0 cudatoolkit=10.1 matplotlib tensorboard scipy opencv -c pytorch
+```
+
+## Demos
+Pretrained models can be downloaded by running
+```Shell
+./download_models.sh
+```
+or downloaded from [google drive](https://drive.google.com/drive/folders/1sWDsfuZ3Up38EUQt7-JDTT1HcGHuJgvT?usp=sharing)
+
+You can demo a trained model on a sequence of frames
+```Shell
+python demo.py --model=models/raft-things.pth --path=demo-frames
+```
+
+## Required Data
+To evaluate/train RAFT, you will need to download the required datasets.
+* [FlyingChairs](https://lmb.informatik.uni-freiburg.de/resources/datasets/FlyingChairs.en.html#flyingchairs)
+* [FlyingThings3D](https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html)
+* [Sintel](http://sintel.is.tue.mpg.de/)
+* [KITTI](http://www.cvlibs.net/datasets/kitti/eval_scene_flow.php?benchmark=flow)
+* [HD1K](http://hci-benchmark.iwr.uni-heidelberg.de/) (optional)
+
+
+By default `datasets.py` will search for the datasets in these locations. You can create symbolic links to wherever the datasets were downloaded in the `datasets` folder
+
+```Shell
+├── datasets
+ ├── Sintel
+ ├── test
+ ├── training
+ ├── KITTI
+ ├── testing
+ ├── training
+ ├── devkit
+ ├── FlyingChairs_release
+ ├── data
+ ├── FlyingThings3D
+ ├── frames_cleanpass
+ ├── frames_finalpass
+ ├── optical_flow
+```
+
+## Evaluation
+You can evaluate a trained model using `evaluate.py`
+```Shell
+python evaluate.py --model=models/raft-things.pth --dataset=sintel --mixed_precision
+```
+
+## Training
+We used the following training schedule in our paper (2 GPUs). Training logs will be written to the `runs` which can be visualized using tensorboard
+```Shell
+./train_standard.sh
+```
+
+If you have a RTX GPU, training can be accelerated using mixed precision. You can expect similiar results in this setting (1 GPU)
+```Shell
+./train_mixed.sh
+```
+
+## (Optional) Efficent Implementation
+You can optionally use our alternate (efficent) implementation by compiling the provided cuda extension
+```Shell
+cd alt_cuda_corr && python setup.py install && cd ..
+```
+and running `demo.py` and `evaluate.py` with the `--alternate_corr` flag Note, this implementation is somewhat slower than all-pairs, but uses significantly less GPU memory during the forward pass.
diff --git a/vbench/third_party/grit_src/third_party/CenterNet2/tests/layers/__init__.py b/vbench/third_party/RAFT/__init__.py
old mode 100755
new mode 100644
similarity index 100%
rename from vbench/third_party/grit_src/third_party/CenterNet2/tests/layers/__init__.py
rename to vbench/third_party/RAFT/__init__.py
diff --git a/vbench/third_party/RAFT/alt_cuda_corr/correlation.cpp b/vbench/third_party/RAFT/alt_cuda_corr/correlation.cpp
new file mode 100644
index 0000000..b01584d
--- /dev/null
+++ b/vbench/third_party/RAFT/alt_cuda_corr/correlation.cpp
@@ -0,0 +1,54 @@
+#include | Dataset | +:link: Download Links | +Config file | +Trained on | +Arbitrary/Fixed | +
|---|---|---|---|---|
| AMT-S | +[Google Driver][Baidu Cloud][Hugging Face] | +[cfgs/AMT-S] | +Vimeo90k | +Fixed | +
| AMT-L | +[Google Driver][Baidu Cloud][Hugging Face] | +[cfgs/AMT-L] | +Vimeo90k | +Fixed | +
| AMT-G | +[Google Driver][Baidu Cloud][Hugging Face] | +[cfgs/AMT-G] | +Vimeo90k | +Fixed | +
| AMT-S | +[Google Driver][Baidu Cloud][Hugging Face] | +[cfgs/AMT-S_gopro] | +GoPro | +Arbitrary | +
| Dataset | +:link: Source | +Train/Eval | +Arbitrary/Fixed | +
|---|---|---|---|
| Vimeo90k | +ToFlow (IJCV 2019) | +Both | +Fixed | +
| ATD-12K | +AnimeInterp (CVPR 2021) | +Both | +Fixed | +
| SNU-FILM | +CAIN (AAAI 2021) | +Eval | +Fixed | +
| UCF101 | +Google Driver | +Eval | +Fixed | +
| HD | +MEMC-Net (TPAMI 2018)/Google Driver | +Eval | +Fixed | +
| Xiph-2k/-4k | +SoftSplat (CVPR 2020) | +Eval | +Fixed | +
| MiddleBury | +MiddleBury | +Eval | +Fixed | +
| GoPro | +GoPro | +Both | +Arbitrary | +
| Adobe240fps | +DBN (CVPR 2017) | +Both | +Arbitrary | +
| X4K1000FPS | +XVFI (ICCV 2021) | +Both | +Arbitrary | +
| Dataset | +:link: Download Links | +Config file | +Trained on | +Arbitrary/Fixed | +
|---|---|---|---|---|
| AMT-S | +[Google Driver][Baidu Cloud] | +[cfgs/AMT-S] | +Vimeo90k | +Fixed | +
| AMT-L | +[Google Driver][Baidu Cloud] | +[cfgs/AMT-L] | +Vimeo90k | +Fixed | +
| AMT-G | +[Google Driver][Baidu Cloud] | +[cfgs/AMT-G] | +Vimeo90k | +Fixed | +
| AMT-S | +[Google Driver][Baidu Cloud] | +[cfgs/AMT-S_gopro] | +GoPro | +Arbitrary | +
+
+
+
+
+
+

| CUDA | torch 1.10 | torch 1.9 | torch 1.8 |
|---|---|---|---|
| 11.3 | install | ||
| 11.1 | install | install | install |
| 10.2 | install | install | install |
| 10.1 | install | ||
| cpu | install | install | install |
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|
| R50-C4 | -1x | -0.551 | -0.102 | -4.8 | -35.7 | -137257644 | -model | metrics | -
| R50-DC5 | -1x | -0.380 | -0.068 | -5.0 | -37.3 | -137847829 | -model | metrics | -
| R50-FPN | -1x | -0.210 | -0.038 | -3.0 | -37.9 | -137257794 | -model | metrics | -
| R50-C4 | -3x | -0.543 | -0.104 | -4.8 | -38.4 | -137849393 | -model | metrics | -
| R50-DC5 | -3x | -0.378 | -0.070 | -5.0 | -39.0 | -137849425 | -model | metrics | -
| R50-FPN | -3x | -0.209 | -0.038 | -3.0 | -40.2 | -137849458 | -model | metrics | -
| R101-C4 | -3x | -0.619 | -0.139 | -5.9 | -41.1 | -138204752 | -model | metrics | -
| R101-DC5 | -3x | -0.452 | -0.086 | -6.1 | -40.6 | -138204841 | -model | metrics | -
| R101-FPN | -3x | -0.286 | -0.051 | -4.1 | -42.0 | -137851257 | -model | metrics | -
| X101-FPN | -3x | -0.638 | -0.098 | -6.7 | -43.0 | -139173657 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|
| R50 | -1x | -0.205 | -0.041 | -4.1 | -37.4 | -190397773 | -model | metrics | -
| R50 | -3x | -0.205 | -0.041 | -4.1 | -38.7 | -190397829 | -model | metrics | -
| R101 | -3x | -0.291 | -0.054 | -5.2 | -40.4 | -190397697 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-prop. AR |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| RPN R50-C4 | -1x | -0.130 | -0.034 | -1.5 | -- | 51.6 | -137258005 | -model | metrics | -
| RPN R50-FPN | -1x | -0.186 | -0.032 | -2.7 | -- | 58.0 | -137258492 | -model | metrics | -
| Fast R-CNN R50-FPN | -1x | -0.140 | -0.029 | -2.6 | -37.8 | -- | 137635226 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| R50-C4 | -1x | -0.584 | -0.110 | -5.2 | -36.8 | -32.2 | -137259246 | -model | metrics | -
| R50-DC5 | -1x | -0.471 | -0.076 | -6.5 | -38.3 | -34.2 | -137260150 | -model | metrics | -
| R50-FPN | -1x | -0.261 | -0.043 | -3.4 | -38.6 | -35.2 | -137260431 | -model | metrics | -
| R50-C4 | -3x | -0.575 | -0.111 | -5.2 | -39.8 | -34.4 | -137849525 | -model | metrics | -
| R50-DC5 | -3x | -0.470 | -0.076 | -6.5 | -40.0 | -35.9 | -137849551 | -model | metrics | -
| R50-FPN | -3x | -0.261 | -0.043 | -3.4 | -41.0 | -37.2 | -137849600 | -model | metrics | -
| R101-C4 | -3x | -0.652 | -0.145 | -6.3 | -42.6 | -36.7 | -138363239 | -model | metrics | -
| R101-DC5 | -3x | -0.545 | -0.092 | -7.6 | -41.9 | -37.3 | -138363294 | -model | metrics | -
| R101-FPN | -3x | -0.340 | -0.056 | -4.6 | -42.9 | -38.6 | -138205316 | -model | metrics | -
| X101-FPN | -3x | -0.690 | -0.103 | -7.2 | -44.3 | -39.5 | -139653917 | -model | metrics | -
| Name | -epochs | -train time (s/im) |
-inference time (s/im) |
-box AP |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|
| R50-FPN | -100 | -0.376 | -0.069 | -44.6 | -40.3 | -42047764 | -model | metrics | -
| R50-FPN | -200 | -0.376 | -0.069 | -46.3 | -41.7 | -42047638 | -model | metrics | -
| R50-FPN | -400 | -0.376 | -0.069 | -47.4 | -42.5 | -42019571 | -model | metrics | -
| R101-FPN | -100 | -0.518 | -0.073 | -46.4 | -41.6 | -42025812 | -model | metrics | -
| R101-FPN | -200 | -0.518 | -0.073 | -48.0 | -43.1 | -42131867 | -model | metrics | -
| R101-FPN | -400 | -0.518 | -0.073 | -48.9 | -43.7 | -42073830 | -model | metrics | -
| regnetx_4gf_dds_FPN | -100 | -0.474 | -0.071 | -46.0 | -41.3 | -42047771 | -model | metrics | -
| regnetx_4gf_dds_FPN | -200 | -0.474 | -0.071 | -48.1 | -43.1 | -42132721 | -model | metrics | -
| regnetx_4gf_dds_FPN | -400 | -0.474 | -0.071 | -48.6 | -43.5 | -42025447 | -model | metrics | -
| regnety_4gf_dds_FPN | -100 | -0.487 | -0.073 | -46.1 | -41.6 | -42047784 | -model | metrics | -
| regnety_4gf_dds_FPN | -200 | -0.487 | -0.072 | -47.8 | -43.0 | -42047642 | -model | metrics | -
| regnety_4gf_dds_FPN | -400 | -0.487 | -0.072 | -48.2 | -43.3 | -42045954 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-kp. AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| R50-FPN | -1x | -0.315 | -0.072 | -5.0 | -53.6 | -64.0 | -137261548 | -model | metrics | -
| R50-FPN | -3x | -0.316 | -0.066 | -5.0 | -55.4 | -65.5 | -137849621 | -model | metrics | -
| R101-FPN | -3x | -0.390 | -0.076 | -6.1 | -56.4 | -66.1 | -138363331 | -model | metrics | -
| X101-FPN | -3x | -0.738 | -0.121 | -8.7 | -57.3 | -66.0 | -139686956 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-PQ | -model id | -download | - - -
|---|---|---|---|---|---|---|---|---|---|
| R50-FPN | -1x | -0.304 | -0.053 | -4.8 | -37.6 | -34.7 | -39.4 | -139514544 | -model | metrics | -
| R50-FPN | -3x | -0.302 | -0.053 | -4.8 | -40.0 | -36.5 | -41.5 | -139514569 | -model | metrics | -
| R101-FPN | -3x | -0.392 | -0.066 | -6.0 | -42.4 | -38.5 | -43.0 | -139514519 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| R50-FPN | -1x | -0.292 | -0.107 | -7.1 | -23.6 | -24.4 | -144219072 | -model | metrics | -
| R101-FPN | -1x | -0.371 | -0.114 | -7.8 | -25.6 | -25.9 | -144219035 | -model | metrics | -
| X101-FPN | -1x | -0.712 | -0.151 | -10.2 | -26.7 | -27.1 | -144219108 | -model | metrics | -
| Name | -train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-box AP50 |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| R50-FPN, Cityscapes | -0.240 | -0.078 | -4.4 | -- | - | 36.5 | -142423278 | -model | metrics | -
| R50-C4, VOC | -0.537 | -0.081 | -4.8 | -51.9 | -80.3 | -- | 142202221 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| Baseline R50-FPN | -1x | -0.261 | -0.043 | -3.4 | -38.6 | -35.2 | -137260431 | -model | metrics | -
| Deformable Conv | -1x | -0.342 | -0.048 | -3.5 | -41.5 | -37.5 | -138602867 | -model | metrics | -
| Cascade R-CNN | -1x | -0.317 | -0.052 | -4.0 | -42.1 | -36.4 | -138602847 | -model | metrics | -
| Baseline R50-FPN | -3x | -0.261 | -0.043 | -3.4 | -41.0 | -37.2 | -137849600 | -model | metrics | -
| Deformable Conv | -3x | -0.349 | -0.047 | -3.5 | -42.7 | -38.5 | -144998336 | -model | metrics | -
| Cascade R-CNN | -3x | -0.328 | -0.053 | -4.0 | -44.3 | -38.5 | -144998488 | -model | metrics | -
| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|
| Baseline R50-FPN | -3x | -0.261 | -0.043 | -3.4 | -41.0 | -37.2 | -137849600 | -model | metrics | -
| GN | -3x | -0.309 | -0.060 | -5.6 | -42.6 | -38.6 | -138602888 | -model | metrics | -
| SyncBN | -3x | -0.345 | -0.053 | -5.5 | -41.9 | -37.8 | -169527823 | -model | metrics | -
| GN (from scratch) | -3x | -0.338 | -0.061 | -7.2 | -39.9 | -36.6 | -138602908 | -model | metrics | -
| GN (from scratch) | -9x | -N/A | -0.061 | -7.2 | -43.7 | -39.6 | -183808979 | -model | metrics | -
| SyncBN (from scratch) | -9x | -N/A | -0.055 | -7.2 | -43.6 | -39.3 | -184226666 | -model | metrics | -
| Name | -inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-PQ | -model id | -download | - - -
|---|---|---|---|---|---|---|---|
| Panoptic FPN R101 | -0.098 | -11.4 | -47.4 | -41.3 | -46.1 | -139797668 | -model | metrics | -
| Mask R-CNN X152 | -0.234 | -15.1 | -50.2 | -44.0 | -- | 18131413 | -model | metrics | -
| above + test-time aug. | -- | - | 51.9 | -45.9 | -- | - | - |
-| Name | -lr sched |
-train time (s/iter) |
-inference time (s/im) |
-train mem (GB) |
-box AP |
-mask AP |
-kp. AP |
-model id | -download | - - -
|---|---|---|---|---|---|---|---|---|---|
| Faster R-CNN | -1x | -0.219 | -0.038 | -3.1 | -36.9 | -- | - | 137781054 | -model | metrics | -
| Keypoint R-CNN | -1x | -0.313 | -0.071 | -5.0 | -53.1 | -- | 64.2 | -137781195 | -model | metrics | -
| Mask R-CNN | -1x | -0.273 | -0.043 | -3.4 | -37.8 | -34.9 | -- | 137781281 | -model | metrics | -