SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.16518 · CVPR · 2022

Collaborative Transformers for Grounded Situation Recognition

Suha Kwak, Junhyeong Cho, Youngseok Yoon

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 2 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.16518.json · badge: /api/ran/2203.16518.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
towhee-io/towhee community
Papers with Code archive
3 ran · 0 no recorded run
jhcho99/CoFormer community
Papers with Code archive
2 ran · 1 no recorded run
ruipingl/opensu community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
CoFormer Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/coformer/coformer.py
code served (permissive licence) · get_code("b2ba2a748ffd3281")
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 an instance of its own class, CoFormer: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn as nn
from torch import Tensor
from typing import Optional, List

torch.manual_seed(0)

# Define minimal backbone
class MinimalBackbone(nn.Module):
    def __init__(self):
        super().__init__()
        self.num_channels = 3
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
    
    def forward(self, samples):
        # samples is a NestedTensor
        x = samples.tensors
        # x shape: [batch, 3, H, W]
        # Return list of features and positional encodings
        feat = self.conv(x)  # [batch, 8, H, W]
        
        # Create a NestedTensor for features
        mask = samples.mask
        features_nested = type('NestedTensor', (), {
            'tensors': feat,
            'mask': mask,
            'decompose': lambda: (feat, mask)
        })()
        
        # Positional encoding (simplified)
        pos_encoding = torch.randn(x.shape[0], 8, x.shape[2], x.shape[3])
        
        return [features_nested], [pos_encoding]

# Define minimal transformer
class MinimalTransformer(nn.Module):
    def __init__(self):
        super().__init__()
        self.d_model = 8
        self.self_attn = nn.MultiheadAttention(8, num_heads=1, batch_first=True)
        self.linear1 = nn.Linear(8, 16)
        self.linear2 = nn.Linear(16, 8)
        self.norm1 = nn.LayerNorm(8)
        self.norm2 = nn.LayerNorm(8)
    
    def forward(self, src, mask, il_embed, rl_embed, verb_embed, role_embed, pos, vidx_ridx, targets=None):
        # src: [1, 8, H, W]
        # Flatten spatial dims
        b, c, h, w = src.shape
        src_flat = src.reshape(b, c, h*w).transpose(1, 2)  # [b, h*w, c]
        
        # Simple self-attention
        attn_out, _ = self.self_attn(src_flat, src_flat, src_flat)
        src_flat = self.norm1(src_flat + attn_out)
        
        # FFN
        ffn_out = self.linear2(torch.relu(self.linear1(src_flat)))
        src_flat = self.norm2(src_flat + ffn_out)
        
        return src_flat

# Create instances
backbone = MinimalBackbone()
transformer = MinimalTransformer()

# Create verb index to role index mapping
vidx_ridx = {
    0: [0, 1, 2],
    1: [1, 2, 3],
    2: [2, 3, 4]
}

num_noun_classes = 50

# Create CoFormer model
coformer = nn.Module()  # Placeholder to avoid circular import

ARGS = {
    'backbone': backbone,
    'transformer': transformer,
    'num_noun_classes': num_noun_classes,
    'vidx_ridx': vidx_ridx
}
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 CoFormer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CoFormer 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
NestedTensor Ran
ran on a synthesized input · constructed an object; no result was computed
towhee-io/towhee/towhee/models/coformer/coformer.py
code served (permissive licence) · get_code("42fe8f9fc92da57d")
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 an instance of its own class, NestedTensor: the run constructed the object and did not call it, so no result was computed. 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
from torch import Tensor
from typing import Optional

torch.manual_seed(0)

# Create a small batch of tensors (batch_size=2, feature_dim=4)
tensors = torch.randn(2, 4)

# Create a corresponding mask (same batch size, arbitrary feature dim for mask)
mask = torch.ones(2, 3, dtype=torch.bool)

ARGS = {
    "tensors": tensors,
    "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 NestedTensor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a NestedTensor 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
NestedTensor Ran
ran on a synthesized input · constructed an object; no result was computed
jhcho99/CoFormer/models/coformer.py
code served (permissive licence) · get_code("8ae3464a294cdaed")
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 NestedTensor: the class was constructed and called, and the call returned an instance of its own class. 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
from torch import Tensor
from typing import Optional

class NestedTensor(object):

    def __init__(self, tensors, mask: Optional[Tensor]):
        self.tensors = tensors
        self.mask = mask

    def to(self, device):
        cast_tensor = self.tensors.to(device)
        mask = self.mask
        if mask is not None:
            assert mask is not None
            cast_mask = mask.to(device)
        else:
            cast_mask = None
        return NestedTensor(cast_tensor, cast_mask)

    def decompose(self):
        return (self.tensors, self.mask)

    def __repr__(self):
        return str(self.tensors)


INIT_ARGS = {
    'tensors': torch.randn(2, 4, 3),
    'mask': torch.ones(2, 4, 3, dtype=torch.bool)
}

ARGS = {
    'device': 'cpu'
}

METHOD = 'to'

if __name__ == '__main__':
    nested = NestedTensor(**INIT_ARGS)
    result = nested.to(**ARGS)
    print(result)
    print("Decompose:", result.decompose())
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 NestedTensor — the call returned an instance of its own class, which has no array shape; none is stated — the instrument coerces any output to an array; for a NestedTensor 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
nested_tensor_from_tensor_list Ran
ran; our contract draft was wrong, not the code
towhee-io/towhee/towhee/models/coformer/coformer.py
code served (permissive licence) · get_code("32db9196c8ba7a26")
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 NestedTensor. 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
from torch import Tensor
from typing import List

torch.manual_seed(0)

# Create a list of 3D tensors with different sizes
# Shape: (channels, height, width)
tensor1 = torch.randn(3, 4, 5)  # 3 channels, 4 height, 5 width
tensor2 = torch.randn(3, 6, 7)  # 3 channels, 6 height, 7 width

tensor_list = [tensor1, tensor2]

ARGS = {
    "tensor_list": tensor_list
}
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 NestedTensor — a NestedTensor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NestedTensor 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
nested_tensor_from_tensor_list Ran
ran; our contract draft was wrong, not the code
jhcho99/CoFormer/models/coformer.py
code served (permissive licence) · get_code("ab1a441fc7e324ad")
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 NestedTensor. 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
from torch import Tensor
from typing import List

torch.manual_seed(0)

# Create a list of 3D tensors with different sizes
# Each tensor has shape (C, H, W) where C=channels, H=height, W=width
tensor1 = torch.randn(3, 4, 5)  # 3 channels, 4 height, 5 width
tensor2 = torch.randn(3, 6, 7)  # 3 channels, 6 height, 7 width

tensor_list = [tensor1, tensor2]

ARGS = {
    "tensor_list": tensor_list
}
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 NestedTensor — a NestedTensor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NestedTensor 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
CoFormer Not yet run
unverified (harvested, no recorded run)
jhcho99/CoFormer/models/coformer.py
code served (permissive licence) · get_code("984efcc5a150c7e9")
How it ran

no invocation recorded.

CoFormer Not yet run
unverified (harvested, no recorded run)
ruipingl/opensu/models/coformer.py
code served (permissive licence) · get_code("0d4f3b554a49c218")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 2 the same month, 2 later) and 4 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
NestedTensor
brick of this paper's assembly: helper
32 other papers
15 dated earlier, 2 the same month, 15 later · 28 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2101.01909 (2021-01)
Line Segment Detection Using Transformers without Edges
2103.04503 (2021-03)
End-to-End Human Object Interaction Detection with HOI Transformer
and 29 more not named here
nested_tensor_from_tensor_list
brick of this paper's assembly: helper
19 other papers
7 dated earlier, 3 the same month, 9 later · 11 only as an assembly brick
2005.12872 (2020-05)
End-to-End Object Detection with Transformers
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.05399 (2021-03)
QPIC: Query-Based Pairwise Human-Object Interaction Detection with Image-Wide Contextual Information
and 16 more not named here

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

Grounded situation recognition is the task of predicting the main activity, entities playing certain roles within the activity, and bounding-box groundings of the entities in the given image. To effectively deal with this challenging task, we introduce a novel approach where the two processes for activity classification and entity estimation are interactive and complementary. To implement this idea, we propose Collaborative Glance-Gaze TransFormer (CoFormer) that consists of two modules: Glance transformer for activity classification and Gaze transformer for entity estimation. Glance transformer predicts the main activity with the help of Gaze transformer that analyzes entities and their relations, while Gaze transformer estimates the grounded entities by focusing only on the entities relevant to the activity predicted by Glance transformer. Our CoFormer achieves the state of the art in all evaluation metrics on the SWiG dataset. Training code and model weights are available at https://github.com/jhcho99/CoFormer.

For agents

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

get_harvested_code_for_paper("2203.16518")
get_code_for_paper("2203.16518")
have("2203.16518")

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

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

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

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

Connect an agent — have() is free.