SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.10062 · 2018

CSRNet: Dilated Convolutional Neural Networks for Understanding the Highly Congested Scenes

arXiv · PDF · Open in the Atlas

Code that ran

13 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; 3 honoured the contract we drafted, 1 violated it and 8 have no contract verdict; 1 failure 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/1802.10062.json · badge: /api/ran/1802.10062.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
CommissarMa/CSRNet-pytorch community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
DiaoXY/CSRnet reimplementation (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
Saritus/Crowd-Counter community (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
Bazingaliu/learning_CSRNet reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
create_img Ran
ran, honoured the contract we drafted
DiaoXY/CSRnet/Model.py
pointer only (licence: NONE) · get_code("ce39b03640271550")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DiaoXY/CSRnet 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.

create_img Ran
ran, honoured the contract we drafted
DiaoXY/CSRnet/Inference.py
pointer only (licence: NONE) · get_code("26d3609a29bca3ac")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DiaoXY/CSRnet 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.

create_test_dataloader Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/dataset.py
code served (permissive licence) · get_code("699624a8df54b1f2")
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 DataLoader. 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 os
import tempfile
import torch
import numpy as np
from PIL import Image
from torchvision.transforms import Compose, ToTensor, Normalize

torch.manual_seed(0)

# Create a temporary directory structure that mimics the dataset layout
temp_dir = tempfile.mkdtemp()
test_data_dir = os.path.join(temp_dir, 'test_data')
os.makedirs(test_data_dir)

images_dir = os.path.join(test_data_dir, 'images')
densitymaps_dir = os.path.join(test_data_dir, 'densitymaps')
os.makedirs(images_dir)
os.makedirs(densitymaps_dir)

# Create two small test images
for i in range(2):
    img = Image.new('RGB', (48, 48), color=(100, 150, 200))
    img.save(os.path.join(images_dir, f'image_{i}.jpg'))
    
    # Create corresponding density maps as numpy arrays
    dmap = np.random.rand(48, 48).astype(np.float32) * 0.5
    np.save(os.path.join(densitymaps_dir, f'image_{i}.npy'), dmap)

# Create parent directory for 'test' phase
parent_dir = os.path.dirname(test_data_dir)

ARGS = {
    'root': parent_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
create_train_dataloader Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/dataset.py
code served (permissive licence) · get_code("804f70b76bd6432b")
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 DataLoader. 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 os
import tempfile
import numpy as np
import torch
import random
from PIL import Image
from torchvision.transforms import Compose, ToTensor, Normalize
import torchvision.transforms.functional as F

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

# Create temporary directory structure with minimal test data
tmpdir = tempfile.mkdtemp()
train_images_dir = os.path.join(tmpdir, 'train_data', 'images')
train_dmaps_dir = os.path.join(tmpdir, 'train_data', 'densitymaps')
os.makedirs(train_images_dir, exist_ok=True)
os.makedirs(train_dmaps_dir, exist_ok=True)

# Create 2 minimal test images (4x3 RGB)
for i in range(2):
    img = Image.new('RGB', (16, 16), color=(73, 109, 137))
    img.save(os.path.join(train_images_dir, f'img_{i}.jpg'))
    
    # Create corresponding density map
    dmap = np.random.rand(16, 16).astype(np.float32)
    np.save(os.path.join(train_dmaps_dir, f'img_{i}.npy'), dmap)

ARGS = {
    'root': tmpdir,
    'use_flip': True,
    'batch_size': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
denormalize Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/utils.py
code served (permissive licence) · get_code("c0c074850363dcfc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (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

torch.manual_seed(0)

# The function denormalize expects a tensor with shape (3, ...) 
# since it iterates over the first dimension with zip(tensor, mean, std)
# where mean and std have 3 elements each.
# We'll create a tensor of shape (3, 2, 4) to match the expected iteration pattern.

tensor = torch.randn(3, 2, 4)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (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: none by the harness; any seed is in the setup block
gaussian_filter_density Ran
ran, violated the contract we drafted
DiaoXY/CSRnet/Preprocess.py
pointer only (licence: NONE) · get_code("78634a059bd32f30")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DiaoXY/CSRnet 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.

generate_fixed_kernel_densitymap Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/data_preparation/dmap_for_SHHB.py
code served (permissive licence) · get_code("d78d232773b61dc2")
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 ndarray, ndim 2, dtype family float, shape (100, 150) 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
from scipy.ndimage.filters import gaussian_filter

# Create a small test image (height=100, width=150, channels=3)
image = np.random.randint(0, 256, (100, 150, 3), dtype=np.uint8)

# Create some test points in [col, row] format
# These should be within image bounds
points = np.array([
    [50.5, 25.3],
    [100.2, 75.8],
    [120.1, 40.5]
])

# Define sigma for gaussian kernel
sigma = 15

ARGS = {
    "image": image,
    "points": points,
    "sigma": sigma
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (100, 150) — shape (100, 150) 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
generate_k_nearest_kernel_densitymap Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/data_preparation/dmap_for_SHHA.py
code served (permissive licence) · get_code("5448b1b07af1f412")
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 ndarray, ndim 2, dtype family float, shape (10, 12) 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 scipy.spatial
import scipy.ndimage

# Create a small test image (height=10, width=12, channels=3)
image = np.random.randint(0, 256, (10, 12, 3), dtype=np.uint8)

# Create test points in [col, row] format
# Points must be within image bounds: col < width (12), row < height (10)
points = np.array([
    [3, 2],      # col=3, row=2
    [7, 5],      # col=7, row=5
    [2, 8],      # col=2, row=8
    [10, 4]      # col=10, row=4
], dtype=np.float32)

ARGS = {
    "image": image,
    "points": points
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (10, 12) — shape (10, 12) 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
generate_perspective_densitymap Ran
ran on a synthesized input
CommissarMa/CSRNet-pytorch/data_preparation/dmap_for_MALL.py
code served (permissive licence) · get_code("5c608855cf4b96b9")
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 ndarray, ndim 2, dtype family float, shape (10, 12) 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
from scipy.ndimage.filters import gaussian_filter

# Create a small image (height=10, width=12)
image = np.random.rand(10, 12).astype(np.float32)

# Create a few points with [col, row] coordinates
# Points should be within image bounds
points = np.array([
    [3.5, 2.5],
    [8.2, 7.1],
    [1.0, 9.5]
], dtype=np.float32)

# Create a perspective map with same shape as image
# Values should be > 0 since they're used as divisor for sigma
p_map = np.ones((10, 12), dtype=np.float32) * 2.0

ARGS = {
    "image": image,
    "points": points,
    "p_map": p_map
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (10, 12) — shape (10, 12) 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_input Ran
ran, honoured the contract we drafted
DiaoXY/CSRnet/Model.py
pointer only (licence: NONE) · get_code("70f82265ce8e8a4e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, DiaoXY/CSRnet 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.

make_layers Ran
ran; our contract draft was wrong, not the code
CommissarMa/CSRNet-pytorch/model.py
pointer only (licence: MIT); the stored copy get_code serves, from jani-excergy/Crowd_Density_Estimation, is pointer only (licence: NONE) · get_code("bd14ee2717325fe2")
How it ran

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

read_file_header Ran
ran on a synthesized input
Saritus/Crowd-Counter/mat4conda.py
code served (permissive licence) · get_code("ee85fe0942254f17")
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 struct
import io

def unpack(endian, fmt, data):
    """Unpack a byte string to the given format. If the byte string
    contains more bytes than required for the given format, the function
    returns a tuple of values.
    """
    if fmt == 's':
        val = struct.unpack(''.join([endian, str(len(data)), 's']), data)[0]
    else:
        num = len(data) // struct.calcsize(fmt)
        val = struct.unpack(''.join([endian, str(num), fmt]), data)
        if len(val) == 1:
            val = val[0]
    return val

def read_file_header(fd, endian):
    """Read mat 5 file header of the file fd.
    Returns a dict with header values.
    """
    fields = [('description', 's', 116), ('subsystem_offset', 's', 8), ('version', 'H', 2), ('endian_test', 's', 2)]
    hdict = {}
    for name, fmt, num_bytes in fields:
        data = fd.read(num_bytes)
        hdict[name] = unpack(endian, fmt, data)
    hdict['description'] = hdict['description'].strip()
    v_major = hdict['version'] >> 8
    v_minor = hdict['version'] & 255
    hdict['__version__'] = '%d.%d' % (v_major, v_minor)
    return hdict

# Create a valid file-like object with proper MAT5 header data
description = b'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Mon Jan 01 00:00:00 2024'
description = description.ljust(116, b' ')
subsystem_offset = b'        '  # 8 bytes
version = struct.pack('<H', 0x0100)  # version 1.0
endian_test = b'MI'  # 2 bytes

header_data = description + subsystem_offset + version + endian_test
fd = io.BytesIO(header_data)
endian = '<'

ARGS = {
    'fd': fd,
    'endian': endian
}
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
unpack Ran
ran on a synthesized input
Saritus/Crowd-Counter/mat4conda.py
code served (permissive licence) · get_code("0deef73b258cd476")
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 bytes. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-26T21:52:49Z. 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 struct

# Test case 1: unpacking a single string
data_string = b"hello"
endian_string = '<'
fmt_string = 's'

# Test case 2: unpacking multiple integers
data_ints = struct.pack('<4i', 1, 2, 3, 4)
endian_ints = '<'
fmt_ints = 'i'

# Test case 3: unpacking floats
data_floats = struct.pack('<2f', 3.14, 2.71)
endian_floats = '<'
fmt_floats = 'f'

# Define ARGS - using the string case as the primary example
ARGS = {
    'endian': '<',
    'fmt': 's',
    'data': b"hello"
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
diff Not yet run
unverified (harvested, no recorded run)
Saritus/Crowd-Counter/mat4conda.py
code served (permissive licence) · get_code("2e7c732fa310801f")
How it ran

no invocation recorded.

gaussian_filter_density Not yet run
unverified (harvested, no recorded run)
Bazingaliu/learning_CSRNet/make_dataset.py
pointer only (licence: NONE) · get_code("b58a2ec6960d759c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Bazingaliu/learning_CSRNet 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.

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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 14 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
make_layers 4 other papers
4 later
1811.10452 (2018-11)
Context-Aware Crowd Counting
1908.06473 (2019-08)
From Open Set to Closed Set: Counting Objects by Spatial Divide-and-Conquer
2001.03360 (2020-01)
NWPU-Crowd: A Large-Scale Benchmark for Crowd Counting and Localization
and 1 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

We propose a network for Congested Scene Recognition called CSRNet to provide a data-driven and deep learning method that can understand highly congested scenes and perform accurate count estimation as well as present high-quality density maps. The proposed CSRNet is composed of two major components: a convolutional neural network (CNN) as the front-end for 2D feature extraction and a dilated CNN for the back-end, which uses dilated kernels to deliver larger reception fields and to replace pooling operations. CSRNet is an easy-trained model because of its pure convolutional structure. We demonstrate CSRNet on four datasets (ShanghaiTech dataset, the UCF_CC_50 dataset, the WorldEXPO'10 dataset, and the UCSD dataset) and we deliver the state-of-the-art performance. In the ShanghaiTech Part_B dataset, CSRNet achieves 47.3% lower Mean Absolute Error (MAE) than the previous state-of-the-art method. We extend the targeted applications for counting other objects, such as the vehicle in TRANCOS dataset. Results show that CSRNet significantly improves the output quality with 15.4% lower MAE than the previous state-of-the-art approach.

For agents

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

get_harvested_code_for_paper("1802.10062")
get_code_for_paper("1802.10062")
have("1802.10062")

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

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

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

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

Connect an agent — have() is free.