SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_19900 · AAAI · 2022

DCAN: Improving Temporal Action Detection via Dual Context Aggregation

Tong Lu, Limin Wang, Guo Chen, Yin-Dong Zheng

Open in the Atlas

Code that ran

10 of 14 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 6 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/aaai_19900.json · badge: /api/ran/aaai_19900.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
cg1177/DCAN canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_video_hit_at_k Ran
ran, honoured the contract we drafted
cg1177/DCAN/dcan_anet/Eval/eval_classification.py
code served (permissive licence) · get_code("880fcf2ffcde257a")
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 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 pandas as pd
import numpy as np

# Create ground truth dataframe
ground_truth_data = {
    'video-id': [1, 1, 2, 2, 3],
    'label': ['cat', 'dog', 'bird', 'cat', 'dog']
}
ground_truth = pd.DataFrame(ground_truth_data)

# Create prediction dataframe
prediction_data = {
    'video-id': [1, 1, 1, 2, 2, 3, 3],
    'label': ['cat', 'dog', 'bird', 'cat', 'dog', 'bird', 'cat'],
    'score': [0.9, 0.7, 0.5, 0.8, 0.6, 0.75, 0.65]
}
prediction = pd.DataFrame(prediction_data)

ARGS = {
    'ground_truth': ground_truth,
    'prediction': prediction,
    'top_k': 3,
    'avg': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
eq Ran
ran on a synthesized input
cg1177/DCAN/dcan_anet/Eval/get_ava_active_speaker_performance.py
code served (permissive licence) · get_code("080a23995e2591f0")
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 bool, 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
import numpy as np

torch.manual_seed(0)

# The function eq compares two values and checks if their absolute difference
# is within a tolerance. It works with numeric types (int, float, etc.)
# We need to provide two numeric values and optionally a tolerance parameter.

# Simple numeric values that are approximately equal
a = 1.0
b = 1.0000000001
tolerance = 1e-09

ARGS = {
    "a": a,
    "b": b,
    "tolerance": tolerance
}
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 bool, 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
get_mask Ran
ran on a synthesized input
cg1177/DCAN/dcan_anet/loss.py
code served (permissive licence) · get_code("04b66f5261500ebe")
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 2, dtype family float, shape (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 numpy as np
import torch

torch.manual_seed(0)

# The function get_mask takes a single parameter: tscale
# It creates a 2D numpy array of shape [tscale, tscale]
# and populates it with 1s in the upper triangular region (including diagonal)
# Then converts it to a torch.Tensor

# tscale should be a positive integer representing the time scale dimension
tscale = 5

ARGS = {
    "tscale": tscale
}
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 Tensor, ndim 2, dtype family float, shape (5, 5) — shape (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_mask Ran
ran on a synthesized input
cg1177/DCAN/dcan_thumos/loss.py
code served (permissive licence) · get_code("3d82d4ea01af3875")
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 2, dtype family float, shape (3, 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 numpy as np
import torch

torch.manual_seed(0)

# Analyzing the function:
# - tscale: used as an integer in range() and for indexing, appears to be a temporal scale dimension
# - max_len: used as an integer in range() and for creating mask shape, appears to be maximum length
# Both are simple integers used to create a numpy array of shape [max_len, tscale]

tscale = 5
max_len = 3

ARGS = {
    "tscale": tscale,
    "max_len": max_len,
}
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 Tensor, ndim 2, dtype family float, shape (3, 5) — shape (3, 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
load_csv Ran
ran; our contract draft was wrong, not the code
cg1177/DCAN/dcan_anet/Eval/get_ava_active_speaker_performance.py
code served (permissive licence) · get_code("c277623807229f9f")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create a temporary CSV file with test data
temp_dir = tempfile.mkdtemp()
temp_csv = os.path.join(temp_dir, "test_data.csv")

# Write test CSV data without header
test_data = """1234567890,obj_123,data1
1234567891,obj_456,data2"""

with open(temp_csv, 'w') as f:
    f.write(test_data)

# Define column names that match the CSV structure
column_names = ['frame_timestamp', 'entity_id', 'value']

ARGS = {
    'filename': temp_csv,
    'column_names': column_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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_json Ran
ran on a synthesized input
cg1177/DCAN/dcan_anet/dataset.py
code served (permissive licence) · get_code("dc1482f0574c1e5e")
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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(json_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "file": json_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 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
make_image_key Ran
ran on a synthesized input
cg1177/DCAN/dcan_anet/Eval/get_ava_performance.py
code served (permissive licence) · get_code("4c6224ef80a79273")
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 str. 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 decimal

def make_image_key(video_id, timestamp):
    """Returns a unique identifier for a video id & timestamp."""
    return '%s,%.6f' % (video_id, decimal.Decimal(timestamp))

ARGS = {
    'video_id': 'video_12345',
    'timestamp': 42.123456789
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_csv Ran
ran; our contract draft was wrong, not the code
cg1177/DCAN/dcan_anet/Eval/get_ava_performance.py
code served (permissive licence) · get_code("c28b8fe34d19dcca")
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 csv
import io
import tempfile

# Create a minimal CSV file content in AVA format
csv_content = """video_001,0.5
video_001,0.5,0.1,0.2,0.3,0.4,1
video_001,0.5,0.15,0.25,0.35,0.45,2,0.95
video_002,1.0,0.2,0.3,0.4,0.5,3
video_002,1.0,0.25,0.35,0.45,0.55,1,0.85
"""

# Create a file-like object
csv_file = io.StringIO(csv_content)
csv_file.name = "test_ava.csv"

# Define ARGS with all parameters for read_csv
ARGS = {
    'csv_file': csv_file,
    'class_whitelist': {1, 2, 3},
    'capacity': 2
}
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 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
read_labelmap Ran
ran; our contract draft was wrong, not the code
cg1177/DCAN/dcan_anet/Eval/get_ava_performance.py
code served (permissive licence) · get_code("85fa68422781ddad")
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 io

# Create a mock labelmap file content
labelmap_content = """item {
  name: "background"
  id: 0
  display_name: "background"
}
item {
  name: "person"
  id: 1
  display_name: "person"
}
item {
  name: "car"
  label_id: 2
  display_name: "car"
}
"""

# Create a file-like object
labelmap_file = io.StringIO(labelmap_content)

ARGS = {
    'labelmap_file': labelmap_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 — 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
weighted_binary_logistic Ran
ran on a synthesized input
cg1177/DCAN/dcan_anet/loss.py
code served (permissive licence) · get_code("8f9dade245887fca")
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 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)

# Create small tensors for pred_score and gt_label
# pred_score: predicted scores (should be in range [0, 1] for logistic)
# gt_label: ground truth labels (binary, 0 or 1)
pred_score = torch.rand(4, 3)  # Shape: 4x3, values in [0, 1]
gt_label = torch.randint(0, 2, (4, 3)).float()  # Shape: 4x3, binary values

threshold = 0.5

ARGS = {
    "pred_score": pred_score,
    "gt_label": gt_label,
    "threshold": threshold
}
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 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
bmn_loss Not yet run
unverified (harvested, no recorded run)
cg1177/DCAN/dcan_anet/loss.py
code served (permissive licence) · get_code("bcb999cb857a11a7")
How it ran

no invocation recorded.

bmn_loss Not yet run
unverified (harvested, no recorded run)
cg1177/DCAN/dcan_thumos/loss.py
code served (permissive licence) · get_code("fe697a4aca30cc2e")
How it ran

no invocation recorded.

compute_average_precision Not yet run
unverified (harvested, no recorded run)
cg1177/DCAN/dcan_anet/Eval/get_ava_active_speaker_performance.py
code served (permissive licence) · get_code("029d0444c2c321d4")
How it ran

no invocation recorded.

compute_average_precision_detection Not yet run
unverified (harvested, no recorded run)
cg1177/DCAN/dcan_anet/Eval/eval_detection.py
code served (permissive licence) · get_code("7be4ca6a451d8384")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
compute_average_precision 11 other papers
3 dated earlier, 6 later, 2 same year, order not determinable
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
2006.07976 (2020-06)
Actor-Context-Actor Relation Network for Spatio-Temporal Action Localization
2107.06592 (2021-07)
Is Someone Speaking? Exploring Long-term Temporal Features for Audio-visual Active Speaker Detection
and 8 more not named here
compute_average_precision_detection 4 other papers
3 dated earlier, 1 later
1911.11462 (2019-11)
G-TAD: Sub-Graph Localization for Temporal Action Detection
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
aaai_16280 (2021 (year only))
Weakly-supervised Temporal Action Localization by Uncertainty Modeling
and 1 more not named here
compute_video_hit_at_k 2 other papers
1 dated earlier, 1 later
aaai_16280 (2021 (year only))
Weakly-supervised Temporal Action Localization by Uncertainty Modeling
aaai_28539 (2024 (year only))
HR-Pro: Point-Supervised Temporal Action Localization via Hierarchical Reliability Propagation
eq 2 other papers
2 dated earlier
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
2107.06592 (2021-07)
Is Someone Speaking? Exploring Long-term Temporal Features for Audio-visual Active Speaker Detection
load_csv 1 other paper
1 dated earlier
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
make_image_key 1 other paper
1 dated earlier
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
read_csv 1 other paper
1 dated earlier
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization
read_labelmap 1 other paper
1 dated earlier
aaai_6793 (2020 (year only))
Background Suppression Network for Weakly-Supervised Temporal Action Localization

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

Temporal action detection aims to locate the boundaries of action in the video. The current method based on boundary matching enumerates and calculates all possible boundary matchings to generate proposals. However, these methods neglect the long-range context aggregation in boundary prediction. At the same time, due to the similar semantics of adjacent matchings, local semantic aggregation of densely-generated matchings cannot improve semantic richness and discrimination. In this paper, we propose the endto-end proposal generation method named Dual Context Aggregation Network (DCAN) to aggregate context on two levels, namely, boundary level and proposal level, for generating high-quality action proposals, thereby improving the performance of temporal action detection. Specifically, we design the Multi-Path Temporal Context Aggregation (MTCA) to achieve smooth context aggregation on boundary level and precise evaluation of boundaries. For matching evaluation, Coarse-to-Fine Matching (CFM) is designed to aggregate context on the proposal level and refine the matching map from coarse to fine. We conduct extensive experiments on ActivityNet v1.3 and THUMOS-14. DCAN obtains an average mAP of 35.39% on ActivityNet v1.3 and reaches mAP 54.1% at IoU@0.5 on THUMOS-14, which demonstrates DCAN can generate high-quality proposals and achieve state-of-the-art performance. We release the code at https://github.com/cg1177/DCAN.

For agents

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

get_harvested_code_for_paper("aaai_19900")
get_code_for_paper("aaai_19900")
have("aaai_19900")

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

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

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

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

Connect an agent — have() is free.