SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.04314 · CVPR · 2021

CFNet: Cascade and Fused Cost Volume for Robust Stereo Matching

Yuchao Dai, Zhelun Shen, Zhibo Rao

arXiv · PDF · Open in the Atlas

Code that ran

11 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 6 failures of our instrument; 10 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2104.04314.json · badge: /api/ran/2104.04314.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
gallenszl/MSMD-Net canonical (classifier label)
classifier basis: census
11 ran · 2 no recorded run
gallenszl/pcwnet community
Papers with Code archive
0 ran · 4 no recorded run
gallenszl/CFNet marked official in Papers with Code
Papers with Code archive
0 ran · 4 no recorded run
FunctionStatusWhere it lives
convbn Ran
ran; our contract draft was wrong, not the code
gallenszl/MSMD-Net/models/submodule.py
pointer only (licence: MIT); the stored copy get_code serves, from lijia7/sddr, is pointer only (licence: NONE) · get_code("4589ab426bdcfbb8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lijia7/sddr, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

convbn_3d Ran
ran; our contract draft was wrong, not the code
gallenszl/MSMD-Net/models/submodule.py
pointer only (licence: MIT); the stored copy get_code serves, from lijia7/sddr, is pointer only (licence: NONE) · get_code("252c55c642e6a443")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lijia7/sddr, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

dataloader Ran
ran; our contract draft was wrong, not the code
gallenszl/MSMD-Net/datasets/listfiles.py
code served (permissive licence) · get_code("b0a995994e4e38c4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure that mimics the expected format
temp_dir = tempfile.mkdtemp()

# Create subdirectories with the required image and disparity files
for i in range(2):
    subdir = os.path.join(temp_dir, f'scene_{i}')
    os.makedirs(subdir, exist_ok=True)
    
    # Create dummy files
    open(os.path.join(subdir, 'im0.png'), 'w').close()
    open(os.path.join(subdir, 'im1.png'), 'w').close()
    open(os.path.join(subdir, 'disp0GT.pfm'), 'w').close()
    open(os.path.join(subdir, 'disp1GT.pfm'), 'w').close()

ARGS = {
    'filepath': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
default_loader Ran
ran, honoured the contract we drafted
gallenszl/MSMD-Net/datasets/MiddleburyLoader.py
pointer only (licence: MIT); the stored copy get_code serves, from xlgsyzp/cvpt, is pointer only (licence: NONE) · get_code("ac269a0e4b8d946e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from xlgsyzp/cvpt, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

disparity_loader Ran
ran, honoured the contract we drafted
gallenszl/MSMD-Net/datasets/MiddleburyLoader.py
code served (permissive licence) · get_code("6f290af6f9436c6b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import torch
import numpy as np
from PIL import Image
import tempfile

torch.manual_seed(0)

# Create a temporary PNG file with disparity data
temp_dir = tempfile.gettempdir()
png_path = os.path.join(temp_dir, "test_disparity.png")

# Create a simple grayscale image and save as PNG
disparity_image = Image.fromarray(np.uint8(np.random.randint(0, 256, (4, 3))), mode='L')
disparity_image.save(png_path)

ARGS = {
    'path': png_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
disparity_regression Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gallenszl/MSMD-Net/models/submodule.py
pointer only (licence: MIT); the stored copy get_code serves, from mickeykang16/Ev-Stereo3D, is pointer only (licence: NONE) · get_code("b667855f4bbc313f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mickeykang16/Ev-Stereo3D, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_image_file Ran
ran, violated the contract we drafted
gallenszl/MSMD-Net/datasets/MiddleburyLoader.py
pointer only (licence: MIT); the stored copy get_code serves, from sgoldyaev/DeepFashion.ADGAN, is pointer only (licence: NONE) · get_code("ab4109634b75ef8b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sgoldyaev/DeepFashion.ADGAN, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

model_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gallenszl/MSMD-Net/models/loss.py
code served (permissive licence) · get_code("ef110dda447f94a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create tiny tensors for disparity estimation
# disp_ests should be a list of 6 tensors (one for each weight)
# Each tensor represents estimated disparity at different pyramid levels
batch_size = 2
height = 4
width = 3

disp_ests = [
    torch.randn(batch_size, 1, height, width) for _ in range(6)
]

# Ground truth disparity
disp_gt = torch.randn(batch_size, 1, height, width)

# Mask to select valid pixels (boolean tensor same shape as disparity)
mask = torch.ones(batch_size, 1, height, width, dtype=torch.bool)
mask[0, 0, 0, 0] = False  # Make at least one pixel invalid

ARGS = {
    "disp_ests": disp_ests,
    "disp_gt": disp_gt,
    "mask": mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pfm_imread Ran
ran on a synthesized input
gallenszl/MSMD-Net/datasets/data_io.py
code served (permissive licence) · get_code("c35f13ea74c6be42")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create a temporary PFM file for testing
temp_dir = tempfile.mkdtemp()
pfm_path = os.path.join(temp_dir, "test.pfm")

# Write a valid PFM file (color, 3x2 image, scale 1.0)
with open(pfm_path, 'wb') as f:
    # Header: PF for color
    f.write(b'PF\n')
    # Dimensions: width=3, height=2
    f.write(b'3 2\n')
    # Scale: 1.0 (positive = big endian)
    f.write(b'1.0\n')
    # Image data: 2 rows x 3 cols x 3 channels = 18 floats
    data = np.ones((2, 3, 3), dtype='>f')
    data.tofile(f)

ARGS = {
    'filename': pfm_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
readPFM Ran
ran; our contract draft was wrong, not the code
gallenszl/MSMD-Net/datasets/readpfm.py
code served (permissive licence) · get_code("d8dba6f53d86a041")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
import struct
import numpy as np

# Create a temporary PFM file for testing
temp_dir = tempfile.mkdtemp()
pfm_path = os.path.join(temp_dir, "test.pfm")

# Create a valid PFM file (color variant, 'PF')
with open(pfm_path, 'wb') as f:
    # Header: 'PF' for color
    f.write(b'PF\n')
    # Dimensions: width=3, height=2
    f.write(b'3 2\n')
    # Scale: positive value (big-endian)
    f.write(b'1.0\n')
    # Image data: 2 height x 3 width x 3 channels = 18 floats
    data = np.ones((2, 3, 3), dtype='>f')
    f.write(data.tobytes())

ARGS = {
    'file': pfm_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_all_lines Ran
ran on a synthesized input
gallenszl/MSMD-Net/datasets/data_io.py
code served (permissive licence) · get_code("e711a03e74028ed6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with some test content
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt') as f:
    f.write("line one\n")
    f.write("line two\n")
    f.write("line three\n")
    temp_filename = f.name

ARGS = {
    "filename": temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PWCNet Not yet run
unverified (harvested, no recorded run)
gallenszl/pcwnet/models/pwcnet.py
code served (permissive licence) · get_code("02fe2a4c8495bd97")
How it ran

no invocation recorded.

PWCNet_G Not yet run
unverified (harvested, no recorded run)
gallenszl/MSMD-Net/models/pwcnet.py
code served (permissive licence) · get_code("228040fffd916ded")
How it ran

no invocation recorded.

PWCNet_GC Not yet run
unverified (harvested, no recorded run)
gallenszl/MSMD-Net/models/pwcnet.py
code served (permissive licence) · get_code("9cffe943e8f11cb4")
How it ran

no invocation recorded.

cfnet Not yet run
unverified (harvested, no recorded run)
gallenszl/CFNet/models/cfnet.py
code served (permissive licence) · get_code("62b8c9c0e874f080")
How it ran

no invocation recorded.

feature_extraction Not yet run
unverified (harvested, no recorded run)
gallenszl/CFNet/models/cfnet.py
code served (permissive licence) · get_code("a491de58629728ba")
How it ran

no invocation recorded.

feature_extraction Not yet run
unverified (harvested, no recorded run)
gallenszl/pcwnet/models/pwcnet.py
code served (permissive licence) · get_code("51f513f2170035a0")
How it ran

no invocation recorded.

hourglass Not yet run
unverified (harvested, no recorded run)
gallenszl/CFNet/models/cfnet.py
code served (permissive licence) · get_code("8d7de0be86b5a6fe")
How it ran

no invocation recorded.

hourglassup Not yet run
unverified (harvested, no recorded run)
gallenszl/CFNet/models/cfnet.py
code served (permissive licence) · get_code("ee1891dd3bc104aa")
How it ran

no invocation recorded.

hourglassup Not yet run
unverified (harvested, no recorded run)
gallenszl/pcwnet/models/pwcnet.py
code served (permissive licence) · get_code("0fb7e137c632d36a")
How it ran

no invocation recorded.

refinenet_version3 Not yet run
unverified (harvested, no recorded run)
gallenszl/pcwnet/models/pwcnet.py
code served (permissive licence) · get_code("568992afe2a876a6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 10 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 8 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
is_image_file 62 other papers
18 dated earlier, 1 the same month, 43 later
1609.04802 (2016-09)
Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
1703.07511 (2017-03)
Deep Photo Style Transfer
1710.10916 (2017-10)
StackGAN++: Realistic Image Synthesis with Stacked Generative Adversarial Networks
and 59 more not named here
default_loader 27 other papers
12 dated earlier, 14 later, 1 same year, order not determinable
1710.03463 (2017-10)
Learning to Generalize: Meta-Learning for Domain Generalization
1803.08669 (2018-03)
Pyramid Stereo Matching Network
1810.11408 (2018-10)
Anytime Stereo Image Depth Estimation on Mobile Devices
and 24 more not named here
convbn 5 other papers
5 later
2312.09243 (2023-12)
OccNeRF: Advancing 3D Occupancy Prediction in LiDAR-Free Environments
2403.07535 (2024-03)
Adaptive Fusion of Single-View and Multi-View Depth for Autonomous Driving
and 2 more not named here
convbn_3d 4 other papers
4 later
2312.09243 (2023-12)
OccNeRF: Advancing 3D Occupancy Prediction in LiDAR-Free Environments
2409.17880 (2024-09)
Self-Distilled Depth Refinement with Noisy Poisson Fusion
and 1 more not named here
pfm_imread 4 other papers
2 dated earlier, 2 later
1806.01260 (2018-06)
Digging Into Self-Supervised Monocular Depth Estimation
1912.06378 (2019-12)
Cascade Cost Volume for High-Resolution Multi-View Stereo and Stereo Matching
2209.12699 (2022-09)
Accurate and Efficient Stereo Matching via Attention Concatenation Volume
and 1 more not named here
read_all_lines 4 other papers
2 dated earlier, 2 later
1806.01260 (2018-06)
Digging Into Self-Supervised Monocular Depth Estimation
1912.06378 (2019-12)
Cascade Cost Volume for High-Resolution Multi-View Stereo and Stereo Matching
2209.12699 (2022-09)
Accurate and Efficient Stereo Matching via Attention Concatenation Volume
and 1 more not named here
disparity_regression 3 other papers
3 later
2209.12699 (2022-09)
Accurate and Efficient Stereo Matching via Attention Concatenation Volume
2508.02288 (2025-08)
Unleashing the Temporal Potential of Stereo Event Cameras for Continuous-Time 3D Object Detection
PWCNet_G 1 other paper
1 dated earlier
2006.12797 (2020-06)
PCW-Net: Pyramid Combination and Warping Cost Volume for Stereo Matching
PWCNet_GC 1 other paper
1 dated earlier
2006.12797 (2020-06)
PCW-Net: Pyramid Combination and Warping Cost Volume for Stereo Matching
disparity_loader 1 other paper
1 later
2209.12699 (2022-09)
Accurate and Efficient Stereo Matching via Attention Concatenation Volume

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recently, the ever-increasing capacity of large-scale annotated datasets has led to profound progress in stereo matching. However, most of these successes are limited to a specific dataset and cannot generalize well to other datasets. The main difficulties lie in the large domain differences and unbalanced disparity distribution across a variety of datasets, which greatly limit the real-world applicability of current deep stereo matching models. In this paper, we propose CFNet, a Cascade and Fused cost volume based network to improve the robustness of the stereo matching network. First, we propose a fused cost volume representation to deal with the large domain difference. By fusing multiple low-resolution dense cost volumes to enlarge the receptive field, we can extract robust structural representations for initial disparity estimation. Second, we propose a cascade cost volume representation to alleviate the unbalanced disparity distribution. Specifically, we employ a variance-based uncertainty estimation to adaptively adjust the next stage disparity search space, in this way driving the network progressively prune out the space of unlikely correspondences. By iteratively narrowing down the disparity search space and improving the cost volume resolution, the disparity estimation is gradually refined in a coarse-tofine manner. When trained on the same training images and evaluated on KITTI, ETH3D, and Middlebury datasets with the fixed model parameters and hyperparameters, our proposed method achieves the state-of-the-art overall performance and obtains the 1st place on the stereo task of Robust Vision Challenge 2020. The code will be available at https://github.com/gallenszl/CFNet.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2104.04314")
get_code_for_paper("2104.04314")
have("2104.04314")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2104.04314.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2104.04314.svg)](https://syntology.ai/paper/2104.04314)

Connect an agent — have() is free.