SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.10955 · 2020

MaskFlownet: Asymmetric Feature Matching with Learnable Occlusion Mask

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-21; 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/2003.10955.json · badge: /api/ran/2003.10955.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
microsoft/MaskFlownet canonical (classifier label)
classifier basis: census
6 ran · 5 no recorded run
FunctionStatusWhere it lives
list_data Ran
ran on a synthesized input
microsoft/MaskFlownet/reader/things3d.py
code served (permissive licence) · get_code("4e20def3f316506f")
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 dict. 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 os
import tempfile
import shutil

# Create a temporary directory structure that mimics FlyingThings3D
temp_dir = tempfile.mkdtemp()

# Create the directory structure
train_dir = os.path.join(temp_dir, 'train')
os.makedirs(train_dir, exist_ok=True)

# Create image directories
for sub_type in ['clean', 'final']:
    for camera in ['left', 'right']:
        image_dir = os.path.join(train_dir, f'image_{sub_type}', camera)
        os.makedirs(image_dir, exist_ok=True)
        # Create dummy image files
        for i in range(2):
            with open(os.path.join(image_dir, f'{i:07d}.png'), 'w') as f:
                f.write('dummy')

# Create flow directories
for camera in ['left', 'right']:
    for orient in ['into_future', 'into_past']:
        flow_dir = os.path.join(train_dir, 'flow', camera, orient)
        os.makedirs(flow_dir, exist_ok=True)
        # Create dummy flow files
        for i in range(2):
            with open(os.path.join(flow_dir, f'{i:07d}.flo'), 'w') as f:
                f.write('dummy')

ARGS = {
    'path': temp_dir,
    'sub_type': 'clean'
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
load Ran
ran on a synthesized input
microsoft/MaskFlownet/reader/sintel.py
code served (permissive licence) · get_code("4acd233d86ecc883")
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 3, dtype family int, shape (10, 12, 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 tempfile
import struct
import numpy as np
import skimage.io
import os

class Flo:
    def __init__(self, w, h):
        self.__floec1__ = float(202021.25)
        self.__floec2__ = int(w)
        self.__floec3__ = int(h)
        self.__floheader__ = struct.pack('fii', self.__floec1__, self.__floec2__, self.__floec3__)
        self.__floheaderlen__ = len(self.__floheader__)
        self.__flow__ = w
        self.__floh__ = h
        self.__floshape__ = [self.__floh__, self.__flow__, 2]
        if self.__floheader__[:4] != b'PIEH':
            raise Exception('Expect machine to be LE.')

    def load(self, file):
        with open(file, 'rb') as fp:
            if fp.read(self.__floheaderlen__) != self.__floheader__:
                raise Exception('Bad flow header: ' + file)
            result = np.ndarray(shape=self.__floshape__, dtype=np.float32, buffer=fp.read(), order='C')
            return result

    def save(self, arr, fname):
        with open(fname, 'wb') as fp:
            fp.write(self.__floheader__)
            fp.write(arr.astype(np.float32).tobytes())

# Create a temporary PNG file for testing
temp_png_path = tempfile.mktemp(suffix='.png')
png_data = np.random.randint(0, 256, (10, 12, 3), dtype=np.uint8)
skimage.io.imsave(temp_png_path, png_data)

# Create a temporary FLO file for testing
temp_flo_path = tempfile.mktemp(suffix='.flo')
flo_writer = Flo(1024, 436)
flow_data = np.random.randn(436, 1024, 2).astype(np.float32)
flo_writer.save(flow_data, temp_flo_path)

ARGS = {
    'fname': temp_png_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (10, 12, 3) — shape (10, 12, 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
load Ran
ran on a synthesized input
microsoft/MaskFlownet/reader/things3d.py
code served (permissive licence) · get_code("90a3966d5dca33d4")
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 3, dtype family float, shape (540, 960, 2) 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 numpy as np
import tempfile
import os

# Create a temporary .flo file for testing
temp_dir = tempfile.mkdtemp()
temp_flo_file = os.path.join(temp_dir, "test_flow.flo")

# Create a valid .flo file with the correct header and flow data
w, h = 960, 540
flo_magic = float(202021.25)
header = np.array([flo_magic], dtype=np.float32).tobytes() + np.array([w, h], dtype=np.int32).tobytes()

# Create flow data with shape [h, w, 2]
flow_data = np.random.randn(h, w, 2).astype(np.float32)

# Write the .flo file
with open(temp_flo_file, 'wb') as fp:
    fp.write(header)
    fp.write(flow_data.tobytes())

ARGS = {
    'fname': temp_flo_file
}
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 ndarray, ndim 3, dtype family float, shape (540, 960, 2) — shape (540, 960, 2) 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
read_dataset Ran
ran on a synthesized input
microsoft/MaskFlownet/reader/hd1k.py
code served (permissive licence) · get_code("556b925e324756cb")
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 dict. 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 os
import tempfile
import cv2
import numpy as np

# Create a temporary directory structure to simulate the HD1K dataset
temp_dir = tempfile.mkdtemp()
image_dir = os.path.join(temp_dir, 'images')
flow_occ_dir = os.path.join(temp_dir, 'flow_occ')
os.makedirs(image_dir)
os.makedirs(flow_occ_dir)

# Create dummy image files
# We need at least 2 images with sequential naming for a valid pair
# Format: XXXXXX_XXXX.png where first 6 digits are sequence, last 4 are frame
height, width = 436, 1024
crop = (50, 100)

# Create image 000000_0000.png
img0_dummy = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
cv2.imwrite(os.path.join(image_dir, '000000_0000.png'), img0_dummy)

# Create image 000000_0001.png (next frame in same sequence)
img1_dummy = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
cv2.imwrite(os.path.join(image_dir, '000000_0001.png'), img1_dummy)

# Create flow_occ file for frame pair (000000_0000 is the reference frame)
# Format: 3 channels - [occlusion, flow_y, flow_x] with flow encoded as uint16
flow_occ_dummy = np.zeros((height, width, 3), dtype=np.uint16)
flow_occ_dummy[..., 0] = 255  # Occlusion channel (255 = visible)
# Flow channels: encode flow as (flow * 64.0 + 32768.0)
flow_occ_dummy[..., 1] = 32768  # flow_y encoded
flow_occ_dummy[..., 2] = 32768  # flow_x encoded
cv2.imwrite(os.path.join(flow_occ_dir, '000000_0000.png'), flow_occ_dummy)

# Create a second valid pair to have more data
img2_dummy = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8)
cv2.imwrite(os.path.join(image_dir, '000000_0002.png'), img2_dummy)
flow_occ_dummy2 = np.zeros((height, width, 3), dtype=np.uint16)
flow_occ_dummy2[..., 0] = 255
flow_occ_dummy2[..., 1] = 32768
flow_occ_dummy2[..., 2] = 32768
cv2.imwrite(os.path.join(flow_occ_dir, '000000_0001.png'), flow_occ_dummy2)

# Construct the path dictionary
path = {
    'image': image_dir,
    'flow_occ': flow_occ_dir
}

ARGS = {
    'path': path,
    'parts': 'train',
    'resize': None,
    'samples': -1,
    'normalize': True,
    'crop': (50, 100)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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_dataset_testing Ran
ran on a synthesized input
microsoft/MaskFlownet/reader/kitti.py
code served (permissive licence) · get_code("2f8369aa1ba0c5b8")
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 dict. 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 os
import cv2
import numpy as np
import tempfile
import shutil

# Create temporary directories and files for testing
temp_dir = tempfile.mkdtemp()

# Create 2012 testing directory with sample images
dir_2012 = os.path.join(temp_dir, '2012testing')
os.makedirs(dir_2012, exist_ok=True)

# Create 2015 testing directory with sample images
dir_2015 = os.path.join(temp_dir, '2015testing')
os.makedirs(dir_2015, exist_ok=True)

# Create sample image files
for k in range(3):
    # Create dummy images for 2012
    img_2012_0 = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
    img_2012_1 = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
    cv2.imwrite(os.path.join(dir_2012, f'{k:06d}_10.png'), img_2012_0)
    cv2.imwrite(os.path.join(dir_2012, f'{k:06d}_11.png'), img_2012_1)
    
    # Create dummy images for 2015
    img_2015_0 = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
    img_2015_1 = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
    cv2.imwrite(os.path.join(dir_2015, f'{k:06d}_10.png'), img_2015_0)
    cv2.imwrite(os.path.join(dir_2015, f'{k:06d}_11.png'), img_2015_1)

# Create kitti_path dictionary
kitti_path_dict = {
    '2012testing': dir_2012,
    '2015testing': dir_2015
}

ARGS = {
    'path': kitti_path_dict,
    'editions': 'mixed',
    'resize': (64, 48),
    'samples': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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_log Ran
ran on a synthesized input
microsoft/MaskFlownet/path.py
code served (permissive licence) · get_code("4b09ec7043892f02")
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 tempfile
import os

# Create a temporary log file with the expected format
temp_dir = tempfile.mkdtemp()
log_file = os.path.join(temp_dir, "test.log")

# Write test log data in the expected format
log_content = """[epoch 1] start=True, lr=0.001, momentum=0.9
[epoch 1] batch=10, loss=0.5
[epoch 1] val_epe=2.3, accuracy=0.95
[epoch 2] start=True, lr=0.0005, momentum=0.9
[epoch 2] batch=20, loss=0.3
[epoch 2] val_epe=1.8, accuracy=0.97
"""

with open(log_file, 'w') as f:
    f.write(log_content)

ARGS = {
    'fname': log_file
}
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
build_network Not yet run
unverified (harvested, no recorded run)
microsoft/MaskFlownet/network/pipeline.py
code served (permissive licence) · get_code("94b4a76fdab01f90")
How it ran

no invocation recorded.

find_checkpoints Not yet run
unverified (harvested, no recorded run)
microsoft/MaskFlownet/path.py
code served (permissive licence) · get_code("c47fe0a72c302ced")
How it ran

no invocation recorded.

find_log Not yet run
unverified (harvested, no recorded run)
microsoft/MaskFlownet/path.py
code served (permissive licence) · get_code("dfeb180d90813e96")
How it ran

no invocation recorded.

list_data Not yet run
unverified (harvested, no recorded run)
microsoft/MaskFlownet/reader/sintel.py
code served (permissive licence) · get_code("27d54fa94eb00588")
How it ran

no invocation recorded.

read_dataset Not yet run
unverified (harvested, no recorded run)
microsoft/MaskFlownet/reader/kitti.py
code served (permissive licence) · get_code("b822bc9a47b5b34d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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-21.

Repositories linked to this paper

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

Abstract

Feature warping is a core technique in optical flow estimation; however, the ambiguity caused by occluded areas during warping is a major problem that remains unsolved. In this paper, we propose an asymmetric occlusion-aware feature matching module, which can learn a rough occlusion mask that filters useless (occluded) areas immediately after feature warping without any explicit supervision. The proposed module can be easily integrated into end-to-end network architectures and enjoys performance gains while introducing negligible computational cost. The learned occlusion mask can be further fed into a subsequent network cascade with dual feature pyramids with which we achieve state-of-the-art performance. At the time of submission, our method, called MaskFlownet, surpasses all published optical flow methods on the MPI Sintel, KITTI 2012 and 2015 benchmarks. Code is available at https://github.com/microsoft/MaskFlownet.

For agents

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

get_harvested_code_for_paper("2003.10955")
get_code_for_paper("2003.10955")
have("2003.10955")

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

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

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

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

Connect an agent — have() is free.