AANet (fastforks)
AANet (Xu and Zhang 2020): sparse deformable-sampling cost aggregation within and across scales on a 2-D correlation pyramid, without 3-D convolutions.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/haofeixu/aanet at 8d0d747e69bb.
Task: stereo. Tier: experimental. Outputs: disparity. Backends: portable, kernels.
Input: a rectified left / right image pair. Output: a disparity map (pixels, left view).
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
aanet-plus-sceneflow@1 |
aanet+_sceneflow.pth | d3e13ef00d3d |
Apache-2.0 (assumed from code) | yes |
aanet-sceneflow@1 |
aanet_sceneflow.pth | 5aa5a24e2ba8 |
Apache-2.0 (assumed from code) | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Files: LICENSE.
Code licence: Apache-2.0; the authors do not state a separate weights licence.
Training data: Freiburg SceneFlow (FlyingThings3D, Driving, Monkaa).
Licence evidence: https://github.com/haofeixu/aanet/blob/8d0d747e69bbdba43e2578b60ad7df63ba7fdac2/LICENSE
Input size
aanet-plus-sceneflow: any H x W >= 96, padded to a multiple of 96aanet-sceneflow: any H x W >= 48, padded to a multiple of 48 Tested up to (portable, fp16, RTX 5060 Ti 16 GB):aanet-plus-sceneflow1024x2048 (7.1 GiB peak allocated, 8.1 reserved);aanet-sceneflow3000x4000 (9.4 GiB peak allocated, 12.5 reserved)
Speed and memory
Stereo, Middlebury 2014 half, 994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
aanet-plus-sceneflow |
262.9 | 194.2 | 159.22 | 88.91 | 2.2x | 1.8x | 3652 / 3784 | 1142 / 1278 | 813 / 920 |
aanet-sceneflow |
289.2 | 178.0 | 139.79 | 100.81 | 1.8x | 1.4x | 1000 / 1126 | 845 / 986 | 536 / 644 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
aanet-plus-sceneflow |
0.15 (375x1242) | 0.16 | 0.20โ | 0.70 (375x1242) | 0.17โ | 0.09โ |
aanet-sceneflow |
0.12 (375x1242) | 0.19 | 0.27โ | 0.07 (375x1242) | 0.14โ | 0.10โ |
Fixed-size speed and peak memory, all models
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|---|---|---|---|---|---|
aanet-plus-sceneflow |
portable | 58.4 ms / 1109 / 1292 | 170.2 ms / 3400 / 3858 | 389.0 ms / 7214 / 8226 | SKIPPED |
aanet-plus-sceneflow |
kernels | 28.8 ms / 178 / 244 | 53.9 ms / 501 / 696 | 128.5 ms / 1049 / 1430 | 793.2 ms / 5752 / 8230 |
aanet-sceneflow |
portable | 40.1 ms / 300 / 340 | 94.2 ms / 781 / 830 | 231.2 ms / 1711 / 1820 | 1591.3 ms / 9603 / 12836 |
aanet-sceneflow |
kernels | 25.9 ms / 148 / 196 | 59.2 ms / 344 / 602 | 152.4 ms / 728 / 1252 | 967.9 ms / 3967 / 6854 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the authors' code at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
Original = the authors' code, same checkpoint and protocol.
| variant | dataset | original | portable | kernels | note |
|---|---|---|---|---|---|
aanet-sceneflow |
ETH3D two-view train, bad > 1 px % / EPE | 14.64 / 0.697 | 14.63 / 0.697 | 14.64 / 0.698 | |
aanet-sceneflow |
Middlebury 2014 trainingH, bad > 2 px % / EPE | 32.15 / 6.305 | 32.16 / 6.301 | 32.16 / 6.303 | |
aanet-plus-sceneflow |
ETH3D two-view train, bad > 1 px % / EPE | 18.48 / 0.811 | 18.50 / 0.811 | 18.51 / 0.812 | |
aanet-plus-sceneflow |
Middlebury 2014 trainingH, bad > 2 px % / EPE | 29.84 / 6.237 | 29.86 / 6.237 | 29.85 / 6.232 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-27.
Parity with the original code
Every variant is checked against golden outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.002 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.02 px and p99 <= 0.25 px.
Limitations
- Only the SceneFlow checkpoints of AANet and AANet+ are included; the original code's KITTI fine-tunes are not.
- At 375x1242 AANet is launch-bound: portable is about as fast as the original code. At 994x1482 portable is faster but allocates more memory.
Usage
from fastforks import stereo
model = stereo.load("aanet-plus-sceneflow") # portable PyTorch on the GPU if there is one, else the CPU
result = model("left.png", "right.png")
result.disparity # [H, W] float32 tensor, input resolution
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: aanet-plus-sceneflow, aanet-sceneflow.
Kernels backend
stereo.load("aanet-plus-sceneflow", mode="kernels") runs our CUDA kernels (deform_conv, igev, cutlass_conv, cudnn_hacc). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.