SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.00196 · NeurIPS · 2020

First Order Motion Model for Image Animation

Aliaksandr Siarohin, Stéphane Lathuilière, Sergey Tulyakov, Elisa Ricci, Fondazione Kessler, Nicu Sebe

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 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 1 has no contract verdict; 2 failures of our instrument; 7 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.00196.json · badge: /api/ran/2003.00196.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
AliaksandrSiarohin/first-order-model marked official in Papers with Code
Papers with Code archive
3 ran · 6 no recorded run
abhaskumarsinha/KMT community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
AntiAliasInterpolation2d Ran
ran on a synthesized input
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("edb6dfe56cd0b289")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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 torch
import numpy as np
from torch import nn
import torch.nn.functional as F

class AntiAliasInterpolation2d(nn.Module):
    """
    Band-limited downsampling, for better preservation of the input signal.
    """
    def __init__(self, channels, scale):
        super(AntiAliasInterpolation2d, self).__init__()
        sigma = (1 / scale - 1) / 2
        kernel_size = 2 * round(sigma * 4) + 1
        self.ka = kernel_size // 2
        self.kb = self.ka - 1 if kernel_size % 2 == 0 else self.ka
        kernel_size = [kernel_size, kernel_size]
        sigma = [sigma, sigma]
        kernel = 1
        meshgrids = torch.meshgrid([torch.arange(size, dtype=torch.float32) for size in kernel_size])
        for size, std, mgrid in zip(kernel_size, sigma, meshgrids):
            mean = (size - 1) / 2
            kernel *= torch.exp(-(mgrid - mean) ** 2 / (2 * std ** 2))
        kernel = kernel / torch.sum(kernel)
        kernel = kernel.view(1, 1, *kernel.size())
        kernel = kernel.repeat(channels, *[1] * (kernel.dim() - 1))
        self.register_buffer('weight', kernel)
        self.groups = channels
        self.scale = scale
        inv_scale = 1 / scale
        self.int_inv_scale = int(inv_scale)

    def forward(self, input):
        if self.scale == 1.0:
            return input
        out = F.pad(input, (self.ka, self.kb, self.ka, self.kb))
        out = F.conv2d(out, weight=self.weight, groups=self.groups)
        out = out[:, :, ::self.int_inv_scale, ::self.int_inv_scale]
        return out

INIT_ARGS = {
    'channels': 4,
    'scale': 0.5
}

ARGS = {
    'input': torch.randn(2, 4, 8, 6)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
kp2gaussian Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("e136efdcba23139b")
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 4, dtype family float, shape (2, 4, 8, 6) 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

torch.manual_seed(0)

# Construct valid arguments for kp2gaussian function
# The function expects:
# - kp: a dict with 'value' key containing a tensor of keypoint coordinates
# - spatial_size: tuple of (height, width)
# - kp_variance: float for gaussian variance

# Looking at the function body:
# - kp['value'] is accessed and has a .type() method (it's a tensor)
# - mean.shape is used to determine leading dimensions
# - The function expects mean to have shape (..., 2) where ... are batch dimensions
# - spatial_size should be a tuple of (h, w)
# - kp_variance is used in division, so it's a scalar

# Create a keypoint dict with a tensor value
# Shape: (batch=2, num_keypoints=4, coordinates=2)
kp_value = torch.randn(2, 4, 2)

kp = {
    'value': kp_value
}

# Spatial size as (height, width)
spatial_size = (8, 6)

# Variance for gaussian
kp_variance = 0.01

ARGS = {
    'kp': kp,
    'spatial_size': spatial_size,
    'kp_variance': kp_variance
}
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 4, dtype family float, shape (2, 4, 8, 6) — shape (2, 4, 8, 6) 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
make_coordinate_grid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("fe3cbec3030f03b9")
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 3, dtype family float, shape (4, 3, 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 torch

torch.manual_seed(0)

# spatial_size: tuple of (height, width)
spatial_size = (4, 3)

# type: torch dtype
type_arg = torch.float32

ARGS = {
    "spatial_size": spatial_size,
    "type": type_arg,
}
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 3, dtype family float, shape (4, 3, 2) — shape (4, 3, 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
Decoder Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("9eb5832abf4b62e6")
How it ran

no invocation recorded.

DenseMotionNetwork Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("f6cf0fcc857e8ebe")
How it ran

no invocation recorded.

DownBlock2d Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("c7c16f0f3d5ecdfb")
How it ran

no invocation recorded.

Encoder Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("b03fc15ff72def85")
How it ran

no invocation recorded.

Hourglass Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("de1c6f08275d28ed")
How it ran

no invocation recorded.

KeypointBasedTransform Not yet run
unverified (harvested, no recorded run)
abhaskumarsinha/KMT/src/models/generator.py
code served (permissive licence) · get_code("7296b7ae122b4252")
How it ran

no invocation recorded.

UpBlock2d Not yet run
unverified (harvested, no recorded run)
AliaksandrSiarohin/first-order-model/modules/dense_motion.py
code served (permissive licence) · get_code("639ec175e8e81a68")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 8 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 8 later) and 2 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
make_coordinate_grid
brick of this paper's assembly: helper
7 other papers
7 later · 4 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2203.14367 (2022-03)
Thin-Plate Spline Motion Model for Image Animation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
and 4 more not named here
DownBlock2d
brick of this paper's assembly: helper
4 other papers
4 later · 3 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2203.06605 (2022-03)
Depth-Aware Generative Adversarial Network for Talking Head Video Generation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
and 1 more not named here
Encoder
brick of this paper's assembly: helper
4 other papers
4 later · 2 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2203.14367 (2022-03)
Thin-Plate Spline Motion Model for Image Animation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
and 1 more not named here
UpBlock2d
brick of this paper's assembly: helper
4 other papers
4 later · 3 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2203.06605 (2022-03)
Depth-Aware Generative Adversarial Network for Talking Head Video Generation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
and 1 more not named here
Decoder
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
2401.13976 (2024-01)
Learning to Manipulate Artistic Images
Hourglass
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
2401.13976 (2024-01)
Learning to Manipulate Artistic Images
kp2gaussian
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2204.05018 (2022-04)
Structure-Aware Motion Transfer with Deformable Anchor Model
2209.10340 (2022-09)
FNeVR: Neural Volume Rendering for Face Animation
2304.03199 (2023-04)
Face Animation with an Attribute-Guided Diffusion Model
AntiAliasInterpolation2d
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2104.11280 (2021-04)
Motion Representations for Articulated Animation
2401.13976 (2024-01)
Learning to Manipulate Artistic Images

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

Image animation consists of generating a video sequence so that an object in a source image is animated according to the motion of a driving video. Our framework addresses this problem without using any annotation or prior information about the specific object to animate. Once trained on a set of videos depicting objects of the same category (e.g. faces, human bodies), our method can be applied to any object of this class. To achieve this, we decouple appearance and motion information using a self-supervised formulation. To support complex motions, we use a representation consisting of a set of learned keypoints along with their local affine transformations. A generator network models occlusions arising during target motions and combines the appearance extracted from the source image and the motion derived from the driving video. Our framework scores best on diverse benchmarks and on a variety of object categories. Our source code is publicly available 1 .

For agents

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

get_harvested_code_for_paper("2003.00196")
get_code_for_paper("2003.00196")
have("2003.00196")

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

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

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

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

Connect an agent — have() is free.