SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 136950157 · ECCV · 2022

K-centered Patch Sampling for Efficient Video Recognition

Jinwoo Shin, Jung-Woo Ha, Jihoon Tack, Byeongho Heo, Seong Park

Open in the Atlas

Code that ran

11 of 15 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 7 have no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/136950157.json · badge: /api/ran/136950157.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
kami93/kcenter_video canonical (classifier label)
classifier basis: census
11 ran · 4 no recorded run
FunctionStatusWhere it lives
adapt_input_conv Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/models/kcenter_motionformer/vit_helper.py
code served (permissive licence) · get_code("e2458dafc5cd98b0")
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 (4, 1, 5, 5) 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 math
from einops import rearrange, repeat

torch.manual_seed(0)

# Create a small convolutional weight tensor
# Shape: (O, I, J, K) = (out_channels, in_channels, height, width)
# Using distinct sizes: 4, 3, 5, 5
conv_weight = torch.randn(4, 3, 5, 5)

ARGS = {
    'in_chans': 1,
    'conv_weight': conv_weight,
    'agg': 'sum'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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 (4, 1, 5, 5) — shape (4, 1, 5, 5) 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
get_attention_module Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/models/kcenter_motionformer/vit_helper.py
code served (permissive licence) · get_code("ff999fa93574fc09")
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 TrajectoryAttention. 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

torch.manual_seed(0)

ARGS = {
    'attn_type': 'trajectory',
    'dim': 768,
    'num_heads': 12,
    'qkv_bias': False,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
    'use_original_code': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TrajectoryAttention — a TrajectoryAttention output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TrajectoryAttention 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
get_loss_func Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/utils/losses.py
code served (permissive licence) · get_code("76d03c11b9f557f3")
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 CrossEntropyLoss. 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

torch.manual_seed(0)

class MockConfig:
    def __init__(self, loss_func_name, smoothing_value):
        self.MODEL = type('obj', (object,), {'LOSS_FUNC': loss_func_name})()
        self.SOLVER = type('obj', (object,), {'SMOOTHING': smoothing_value})()

ARGS = {
    'cfg': MockConfig('cross_entropy', 0.1)
}
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 CrossEntropyLoss — a CrossEntropyLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CrossEntropyLoss 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
get_sequence Ran
ran, honoured the contract we drafted
kami93/kcenter_video/kcenter_transformer/datasets/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from CAMMA-public/SurgVLP, is pointer only (licence: NONE) · get_code("37cabfc73f71318b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from CAMMA-public/SurgVLP, 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.

get_start_end_idx Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/datasets/kinetics/decoder.py
code served (permissive licence) · get_code("37ded9e72ab9aadd")
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 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 random
import numpy as np

# Set seeds for reproducibility
np.random.seed(0)
random.seed(0)

# Define arguments for get_start_end_idx
ARGS = {
    "video_size": 100,
    "clip_size": 16,
    "clip_idx": -1,
    "num_clips": 10,
    "seed": 42
}
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, ndim 1, 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
horizontal_flip Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/datasets/transform.py
code served (permissive licence) · get_code("95e893e990814428")
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 torch
import numpy as np
import random

torch.manual_seed(0)

# Create a small tensor for images: num_frames x channel x height x width
# Using distinct dimensions: 2 frames, 3 channels, 4 height, 5 width
images = torch.randn(2, 3, 4, 5)

# Create boxes: num_boxes x 4
# Each box has [x1, y1, x2, y2] coordinates
boxes = np.array([
    [1.0, 1.0, 3.0, 3.0],
    [2.0, 2.0, 4.0, 4.0]
], dtype=np.float32)

ARGS = {
    "prob": 0.7,
    "images": images,
    "boxes": boxes,
    "seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
qkv_attn Ran
ran; our contract draft was wrong, not the code
kami93/kcenter_video/kcenter_transformer/models/kcenter_motionformer/vit_helper.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/Motionformer, is pointer only (licence: NONE) · get_code("83c9daa7db244c42")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from facebookresearch/Motionformer, 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.

random_short_side_scale_jitter Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/datasets/transform.py
code served (permissive licence) · get_code("2733e51a492620d5")
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 torch
import numpy as np
import random

torch.manual_seed(0)
np.random.seed(0)
random.seed(0)

# Create a small tensor: num_frames x channel x height x width
# Using distinct dimensions: 2 frames, 3 channels, 5 height, 7 width
images = torch.randn(2, 3, 5, 7)

# Create optional boxes: num_boxes x 4
# 2 boxes with 4 coordinates each
boxes = np.array([[0.1, 0.2, 0.3, 0.4], [0.5, 0.6, 0.7, 0.8]], dtype=np.float32)

ARGS = {
    "images": images,
    "min_size": 4,
    "max_size": 8,
    "boxes": boxes,
    "inverse_uniform_sampling": False,
    "seed": 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
short_side_scale_jitter Ran
ran on a synthesized input
kami93/kcenter_video/kcenter_transformer/datasets/transform.py
code served (permissive licence) · get_code("94596f55274c699c")
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 torch
import math
import numpy as np

torch.manual_seed(0)

# Create a small tensor for images: num_frames x channel x height x width
# Using distinct dimensions: 2 frames, 3 channels, 8 height, 6 width
images = torch.randn(2, 3, 8, 6)

# Create boxes: num_boxes x 4 (x1, y1, x2, y2 format)
boxes = np.array([[1.0, 2.0, 5.0, 7.0], [2.0, 3.0, 4.0, 6.0]], dtype=np.float32)

# Size parameter for the short side
size = 4

ARGS = {
    "images": images,
    "size": size,
    "boxes": boxes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
temporal_sampling Ran
ran; our contract draft was wrong, not the code
kami93/kcenter_video/kcenter_transformer/datasets/kinetics/decoder.py
code served (permissive licence) · get_code("2ce6782a49b98214")
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 (5, 3, 4, 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

torch.manual_seed(0)

# Create a tensor of video frames: num_frames x channels x height x width
frames = torch.randn(10, 3, 4, 4)

start_idx = 0
end_idx = 9
num_samples = 5

ARGS = {
    "frames": frames,
    "start_idx": start_idx,
    "end_idx": end_idx,
    "num_samples": num_samples,
}
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 (5, 3, 4, 4) — shape (5, 3, 4, 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: none by the harness; any seed is in the setup block
translate_x_rel Ran
ran; our contract draft was wrong, not the code
kami93/kcenter_video/kcenter_transformer/datasets/autoaugment.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tongzixin716716/Inverse-Loss-Reweighting, is pointer only (licence: NONE) · get_code("a4b471197204b414")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tongzixin716716/Inverse-Loss-Reweighting, 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.

pyav_decode_stream Not yet run
unverified (harvested, no recorded run)
kami93/kcenter_video/kcenter_transformer/datasets/kinetics/decoder.py
code served (permissive licence) · get_code("b28b46ef7776c434")
How it ran

no invocation recorded.

shear_x Not yet run
unverified (harvested, no recorded run)
kami93/kcenter_video/kcenter_transformer/datasets/autoaugment.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tongzixin716716/Inverse-Loss-Reweighting, is pointer only (licence: NONE) · get_code("7b4e3d0bd192b677")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tongzixin716716/Inverse-Loss-Reweighting, 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. No invocation recorded.

shear_y Not yet run
unverified (harvested, no recorded run)
kami93/kcenter_video/kcenter_transformer/datasets/autoaugment.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tongzixin716716/Inverse-Loss-Reweighting, is pointer only (licence: NONE) · get_code("e31c4b500a240e69")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tongzixin716716/Inverse-Loss-Reweighting, 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. No invocation recorded.

spatial_sampling Not yet run
unverified (harvested, no recorded run)
kami93/kcenter_video/kcenter_transformer/datasets/utils.py
code served (permissive licence) · get_code("89b18019382c2af2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 6 later) and 8 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
shear_x 27 other papers
4 dated earlier, 17 later, 6 same year, order not determinable
1811.12814 (2018-11)
Graph-Based Global Reasoning Networks
2109.03508 (2021-09)
RepNAS: Searching for Efficient Re-parameterizing Blocks
2109.06165 (2021-09)
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
and 24 more not named here
shear_y 27 other papers
4 dated earlier, 17 later, 6 same year, order not determinable
1811.12814 (2018-11)
Graph-Based Global Reasoning Networks
2109.03508 (2021-09)
RepNAS: Searching for Efficient Re-parameterizing Blocks
2109.06165 (2021-09)
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
and 24 more not named here
translate_x_rel 26 other papers
4 dated earlier, 16 later, 6 same year, order not determinable
1811.12814 (2018-11)
Graph-Based Global Reasoning Networks
2109.03508 (2021-09)
RepNAS: Searching for Efficient Re-parameterizing Blocks
2109.06165 (2021-09)
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
and 23 more not named here
pyav_decode_stream 4 other papers
2 dated earlier, 1 later, 1 same year, order not determinable
2005.03788 (2020-05)
ProSelfLC: Progressive Self Label Correction for Training Robust Deep Neural Networks
2206.03428 (2022-06)
Revealing Single Frame Bias for Video-and-Language Learning
and 1 more not named here
temporal_sampling 4 other papers
2 dated earlier, 2 later
2005.03788 (2020-05)
ProSelfLC: Progressive Self Label Correction for Training Robust Deep Neural Networks
2306.07703 (2023-06)
E2E-LOAD: End-to-End Long-form Online Action Detection
and 1 more not named here
get_sequence 3 other papers
1 dated earlier, 1 later, 1 same year, order not determinable
Shi_Multi-Modal_Multi-Action_Video_Recognition_ICCV_2021_paper (2021 (year only))
Multi-Modal Multi-Action Video Recognition
136640364 (2022 (year only))
Continual 3D Convolutional Neural Networks for Real-time Processing of Videos
2410.00263 (2024-10)
Procedure-Aware Surgical Video-language Pretraining with Hierarchical Knowledge Augmentation
qkv_attn 2 other papers
2 dated earlier
2106.05392 (2021-06)
Keeping Your Eye on the Ball: Trajectory Attention in Video Transformers
2110.06915 (2021-10)
Object-Region Video Transformers

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

For decades, it has been a common practice to choose a subset of video frames for reducing the computational burden of a video understanding model. In this paper, we argue that this popular heuristic might be sub-optimal under recent transformer-based models. Specifically, inspired by that transformers are built upon patches of video frames, we propose to sample patches rather than frames using the greedy Kcenter search, i.e., the farthest patch to what has been chosen so far is sampled iteratively. We then show that a transformer trained with the selected video patches can outperform its baseline trained with the video frames sampled in the traditional way. Furthermore, by adding a certain spatiotemporal structuredness condition, the proposed K-centered patch sampling can be even applied to the recent sophisticated video transformers, boosting their performance further. We demonstrate the superiority of our method on Something-Something and Kinetics datasets.

For agents

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

get_harvested_code_for_paper("136950157")
get_code_for_paper("136950157")
have("136950157")

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

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

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

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

Connect an agent — have() is free.