SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.04229 · CVPR · 2022

Neural Face Identification in a 2D Wireframe Projection of a Manifold Object

Zihan Zhou, Jia Zheng, Kehan Wang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 3 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/2203.04229.json · badge: /api/ran/2203.04229.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
manycore-research/faceformer marked official in Papers with Code
Papers with Code archive
6 ran · 3 no recorded run
FunctionStatusWhere it lives
PositionEmbeddingLearned Ran
ran on a synthesized input
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("506244c56ca673d9")
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 3, dtype family float, shape (1, 16, 8) 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 as nn

class PositionEmbeddingLearned(nn.Module):
    """
    Absolute pos embedding, learned.
    """

    def __init__(self, num_model, max_len=5000):
        super().__init__()
        position = torch.arange(0, max_len, dtype=torch.long).unsqueeze(0)
        self.register_buffer('position', position)
        self.pos_embed = nn.Embedding(max_len, num_model)
        self._init_embeddings()

    def _init_embeddings(self):
        nn.init.kaiming_normal_(self.pos_embed.weight, mode='fan_in')

    def forward(self, x):
        pos = self.position[:, :x.size(1)]
        return self.pos_embed(pos)


INIT_ARGS = {
    'num_model': 8,
    'max_len': 512,
}

ARGS = {
    'x': torch.randn(2, 16, 8),
}

if __name__ == '__main__':
    model = PositionEmbeddingLearned(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 (1, 16, 8) — shape (1, 16, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerDecoder Ran
ran on a synthesized input
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("d71df66cc8b6ec24")
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 3, dtype family float, shape (3, 2, 4) 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 as nn
import copy
from typing import List, Optional
from torch import Tensor

def _get_clones(module, N):
    return nn.ModuleList([copy.deepcopy(module) for i in range(N)])

class TransformerDecoder(nn.Module):

    def __init__(self, decoder_layer, num_layers, norm=None, return_intermediate=False):
        super().__init__()
        self.layers = _get_clones(decoder_layer, num_layers)
        self.num_layers = num_layers
        self.norm = norm
        self.return_intermediate = return_intermediate

    def forward(self, tgt, memory, tgt_mask: Optional[Tensor]=None, memory_mask: Optional[Tensor]=None, tgt_key_padding_mask: Optional[Tensor]=None, memory_key_padding_mask: Optional[Tensor]=None, pos: Optional[Tensor]=None, query_pos: Optional[Tensor]=None):
        output = tgt
        intermediate = []
        for layer in self.layers:
            output = layer(output, memory, tgt_mask=tgt_mask, memory_mask=memory_mask, tgt_key_padding_mask=tgt_key_padding_mask, memory_key_padding_mask=memory_key_padding_mask, pos=pos, query_pos=query_pos)
            if self.return_intermediate:
                intermediate.append(self.norm(output))
        if self.norm is not None:
            output = self.norm(output)
            if self.return_intermediate:
                intermediate.pop()
                intermediate.append(output)
        if self.return_intermediate:
            return torch.stack(intermediate)
        return output


class MockDecoderLayer(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, tgt, memory, tgt_mask=None, memory_mask=None, tgt_key_padding_mask=None, memory_key_padding_mask=None, pos=None, query_pos=None):
        return self.linear(tgt)


d_model = 4
num_layers = 2
seq_len_tgt = 3
seq_len_memory = 5
batch_size = 2

decoder_layer = MockDecoderLayer(d_model)
norm = nn.LayerNorm(d_model)

INIT_ARGS = {
    'decoder_layer': decoder_layer,
    'num_layers': num_layers,
    'norm': norm,
    'return_intermediate': False
}

ARGS = {
    'tgt': torch.randn(seq_len_tgt, batch_size, d_model),
    'memory': torch.randn(seq_len_memory, batch_size, d_model),
    'tgt_mask': None,
    'memory_mask': None,
    'tgt_key_padding_mask': None,
    'memory_key_padding_mask': None,
    'pos': None,
    'query_pos': None
}

decoder = TransformerDecoder(**INIT_ARGS)
output = decoder(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: ({seq_len_tgt}, {batch_size}, {d_model})")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 (3, 2, 4) — shape (3, 2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerEncoder Ran
ran on a synthesized input
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("118c23617c908725")
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 3, dtype family float, shape (2, 3, 4) 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 as nn
import copy
from typing import List, Optional
from torch import Tensor

def _get_clones(module, N):
    return nn.ModuleList([copy.deepcopy(module) for i in range(N)])

class TransformerEncoder(nn.Module):

    def __init__(self, encoder_layer, num_layers, norm=None):
        super().__init__()
        self.layers = _get_clones(encoder_layer, num_layers)
        self.num_layers = num_layers
        self.norm = norm

    def forward(self, src, mask: Optional[Tensor]=None, src_key_padding_mask: Optional[Tensor]=None, pos: Optional[Tensor]=None):
        output = src
        for layer in self.layers:
            output = layer(output, src_mask=mask, src_key_padding_mask=src_key_padding_mask, pos=pos)
        if self.norm is not None:
            output = self.norm(output)
        return output


class SimpleEncoderLayer(nn.Module):
    def __init__(self, d_model, nhead, dim_feedforward):
        super().__init__()
        self.self_attn = nn.MultiheadAttention(d_model, nhead, batch_first=True)
        self.linear1 = nn.Linear(d_model, dim_feedforward)
        self.linear2 = nn.Linear(dim_feedforward, d_model)
        self.norm1 = nn.LayerNorm(d_model)
        self.norm2 = nn.LayerNorm(d_model)
        self.dropout = nn.Dropout(0.1)

    def forward(self, src, src_mask=None, src_key_padding_mask=None, pos=None):
        x = src
        if pos is not None:
            x = x + pos
        attn_out, _ = self.self_attn(x, x, x, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)
        x = x + self.dropout(attn_out)
        x = self.norm1(x)
        ff_out = self.linear2(torch.relu(self.linear1(x)))
        x = x + self.dropout(ff_out)
        x = self.norm2(x)
        return x


d_model = 4
nhead = 2
dim_feedforward = 8
num_layers = 2
batch_size = 2
seq_len = 3

encoder_layer = SimpleEncoderLayer(d_model, nhead, dim_feedforward)
norm_layer = nn.LayerNorm(d_model)

INIT_ARGS = {
    'encoder_layer': encoder_layer,
    'num_layers': num_layers,
    'norm': norm_layer
}

ARGS = {
    'src': torch.randn(batch_size, seq_len, d_model),
    'mask': None,
    'src_key_padding_mask': None,
    'pos': torch.randn(batch_size, seq_len, d_model)
}

if __name__ == '__main__':
    transformer_encoder = TransformerEncoder(**INIT_ARGS)
    output = transformer_encoder(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 (2, 3, 4) — shape (2, 3, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerEncoderLayer Ran
ran on a synthesized input
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("000429586ff77403")
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 3, dtype family float, shape (3, 2, 4) 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 as nn
from typing import Optional
from torch import Tensor

def _get_activation_fn(activation):
    """Return an activation function given a string"""
    if activation == 'relu':
        return torch.nn.functional.relu
    if activation == 'gelu':
        return torch.nn.functional.gelu
    if activation == 'glu':
        return torch.nn.functional.glu
    raise RuntimeError(f'activation should be relu/gelu, not {activation}.')

class TransformerEncoderLayer(nn.Module):

    def __init__(self, num_model, num_head, num_feedforward=2048, dropout=0.1, activation='relu', normalize_before=False):
        super().__init__()
        self.self_attn = nn.MultiheadAttention(num_model, num_head, dropout=dropout)
        self.linear1 = nn.Linear(num_model, num_feedforward)
        self.dropout = nn.Dropout(dropout)
        self.linear2 = nn.Linear(num_feedforward, num_model)
        self.norm1 = nn.LayerNorm(num_model)
        self.norm2 = nn.LayerNorm(num_model)
        self.dropout1 = nn.Dropout(dropout)
        self.dropout2 = nn.Dropout(dropout)
        self.activation = _get_activation_fn(activation)
        self.normalize_before = normalize_before

    def with_pos_embed(self, tensor, pos: Optional[Tensor]):
        return tensor if pos is None else tensor + pos

    def forward_post(self, src, src_mask: Optional[Tensor]=None, src_key_padding_mask: Optional[Tensor]=None, pos: Optional[Tensor]=None):
        q = k = self.with_pos_embed(src, pos)
        src2 = self.self_attn(q, k, value=src, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
        src = src + self.dropout1(src2)
        src = self.norm1(src)
        src2 = self.linear2(self.dropout(self.activation(self.linear1(src))))
        src = src + self.dropout2(src2)
        src = self.norm2(src)
        return src

    def forward_pre(self, src, src_mask: Optional[Tensor]=None, src_key_padding_mask: Optional[Tensor]=None, pos: Optional[Tensor]=None):
        src2 = self.norm1(src)
        q = k = self.with_pos_embed(src2, pos)
        src2 = self.self_attn(q, k, value=src2, attn_mask=src_mask, key_padding_mask=src_key_padding_mask)[0]
        src = src + self.dropout1(src2)
        src2 = self.norm2(src)
        src2 = self.linear2(self.dropout(self.activation(self.linear1(src2))))
        src = src + self.dropout2(src2)
        return src

    def forward(self, src, src_mask: Optional[Tensor]=None, src_key_padding_mask: Optional[Tensor]=None, pos: Optional[Tensor]=None):
        if self.normalize_before:
            return self.forward_pre(src, src_mask, src_key_padding_mask, pos)
        return self.forward_post(src, src_mask, src_key_padding_mask, pos)


INIT_ARGS = {
    'num_model': 4,
    'num_head': 2,
    'num_feedforward': 8,
    'dropout': 0.1,
    'activation': 'relu',
    'normalize_before': False
}

ARGS = {
    'src': torch.randn(3, 2, 4),
    'src_mask': None,
    'src_key_padding_mask': None,
    'pos': None
}

if __name__ == '__main__':
    layer = TransformerEncoderLayer(**INIT_ARGS)
    output = layer(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 (3, 2, 4) — shape (3, 2, 4) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
info_value_of_dtype Ran
ran; our contract draft was wrong, not the code
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("ee785cb822525e6d")
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) and returned finfo. 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 torch

torch.manual_seed(0)

# The function takes a torch.dtype and returns finfo or iinfo
# We'll test with a floating point dtype

ARGS = {
    "dtype": torch.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type finfo — a finfo output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a finfo 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
min_value_of_dtype Ran
ran, honoured the contract we drafted
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("6e33f07855c9f000")
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) and returned float, 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

torch.manual_seed(0)

# The function min_value_of_dtype takes a single parameter: dtype
# It calls info_value_of_dtype(dtype) which checks if dtype is torch.bool,
# then calls either torch.finfo(dtype) or torch.iinfo(dtype) depending on
# whether it's a floating point type. Both finfo and iinfo have a .min attribute.

# We need to test with valid torch dtypes that are not torch.bool
# Let's use a floating point dtype as an example

ARGS = {
    "dtype": torch.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
SurfaceFormer Not yet run
unverified (harvested, no recorded run)
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("0d387fb75c2fd44a")
How it ran

no invocation recorded.

TransformerDecoderLayer Not yet run
unverified (harvested, no recorded run)
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("eed247c01f20b78e")
How it ran

no invocation recorded.

VanillaEmedding Not yet run
unverified (harvested, no recorded run)
manycore-research/faceformer/faceformer/models/model.py
code served (permissive licence) · get_code("8931487f88d578ba")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 later) and 7 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
TransformerEncoder
brick of this paper's assembly: model
16 other papers
7 dated earlier, 2 the same month, 7 later · 7 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2103.11468 (2021-03)
Learning Multi-Scene Absolute Pose Regression with Transformers
2103.12236 (2021-03)
Instance-level Image Retrieval using Reranking Transformers
and 13 more not named here
TransformerDecoder
brick of this paper's assembly: model
1 other paper
1 later
2212.09877 (2022-12)
LayoutDETR: Detection Transformer Is a Good Multimodal Layout Designer

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

In computer-aided design (CAD) systems, 2D line drawings are commonly used to illustrate 3D object designs. To reconstruct the 3D models depicted by a single 2D line drawing, an important key is finding the edge loops in the line drawing which correspond to the actual faces of the 3D object. In this paper, we approach the classical problem of face identification from a novel data-driven point of view. We cast it as a sequence generation problem: starting from an arbitrary edge, we adopt a variant of the popular Transformer model to predict the edges associated with the same face in a natural order. This allows us to avoid searching the space of all possible edge loops with various hand-crafted rules and heuristics as most existing methods do, deal with challenging cases such as curved surfaces and nested edge loops, and leverage additional cues such as face types. We further discuss how possibly imperfect predictions can be used for 3D object reconstruction. The project page is at https://manycoreresearch.github.io/faceformer.

For agents

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

get_harvested_code_for_paper("2203.04229")
get_code_for_paper("2203.04229")
have("2203.04229")

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

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

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

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

Connect an agent — have() is free.