SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.13077 · NeurIPS · 2020

Distribution Matching for Crowd Counting

Boyu Wang, Huidong Liu, Dimitris Samaras, Minh Hoai

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2009.13077.json · badge: /api/ran/2009.13077.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
cvlab-stonybrook/DM-Count canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
sinkhorn Ran
ran; our contract draft was wrong, not the code
cvlab-stonybrook/DM-Count/losses/ot_loss.py
code served (permissive licence) · get_code("4a7bb1df79ece9e0")
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 (4, 3) 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)

# Create small valid tensors for optimal transport problem
na = 4  # number of source samples
nb = 3  # number of target samples

# Create normalized measures (sum to 1)
a = torch.ones(na) / na  # shape (4,)
b = torch.ones(nb) / nb  # shape (3,)

# Create cost matrix
C = torch.randn(na, nb).abs()  # shape (4, 3)

# Define all parameters
ARGS = {
    'a': a,
    'b': b,
    'C': C,
    'reg': 0.1,
    'maxIter': 100,
    'maxInnerIter': 100,
    'tau': 1000.0,
    'scaling_base': 0.75,
    'scaling_coef': None,
    'stopThr': 1e-09,
    'verbose': False,
    'log': False,
    'warm_start': None,
    'eval_freq': 10,
    'print_freq': 200,
}
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 (4, 3) — shape (4, 3) 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
sinkhorn_epsilon_scaling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvlab-stonybrook/DM-Count/losses/ot_loss.py
code served (permissive licence) · get_code("6fc6b09f36104fee")
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

torch.manual_seed(0)

# Create small test tensors
na = 4  # number of samples in target domain
nb = 3  # number of samples in source domain

# Create valid measures (non-negative, sum to 1)
a = torch.ones(na) / na
b = torch.ones(nb) / nb

# Create cost matrix
C = torch.randn(na, nb).abs()

# Warm start dictionary (optional)
warm_start = {
    'alpha': torch.zeros(na),
    'beta': torch.zeros(nb)
}

ARGS = {
    'a': a,
    'b': b,
    'C': C,
    'reg': 0.1,
    'maxIter': 100,
    'tau': 1000.0,
    'stopThr': 1e-9,
    'verbose': False,
    'log': True,
    'warm_start': warm_start,
    'eval_freq': 10,
    'print_freq': 50,
}
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 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
sinkhorn_knopp Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvlab-stonybrook/DM-Count/losses/ot_loss.py
code served (permissive licence) · get_code("efb7b74d984b62d7")
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

torch.manual_seed(0)

# Create small test tensors for the Sinkhorn-Knopp algorithm
na = 4  # number of samples in target domain
nb = 3  # number of samples in source domain

# a: target measure (na,), must sum to 1 and be non-negative
a = torch.ones(na) / na

# b: source measure (nb,), must sum to 1 and be non-negative
b = torch.ones(nb) / nb

# C: cost matrix (na, nb)
C = torch.randn(na, nb).abs()

# warm_start: optional dict with 'u' and 'v' keys
warm_start = {
    'u': torch.ones(na) / na,
    'v': torch.ones(nb) / nb
}

ARGS = {
    'a': a,
    'b': b,
    'C': C,
    'reg': 0.1,
    'maxIter': 100,
    'stopThr': 1e-9,
    'verbose': False,
    'log': True,
    'warm_start': warm_start,
    'eval_freq': 10,
    'print_freq': 50,
}
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 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
sinkhorn_stabilized Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cvlab-stonybrook/DM-Count/losses/ot_loss.py
code served (permissive licence) · get_code("7d7ce732072ce0e3")
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

torch.manual_seed(0)

# Create small tensors for the OT problem
na = 3  # number of samples in target domain
nb = 2  # number of samples in source domain

# a: target measure (probability distribution over na samples)
a = torch.tensor([0.6, 0.3, 0.1], dtype=torch.float32)

# b: source measure (probability distribution over nb samples)
b = torch.tensor([0.4, 0.6], dtype=torch.float32)

# C: cost matrix (na x nb)
C = torch.tensor([
    [1.0, 2.0],
    [3.0, 1.5],
    [2.0, 2.5]
], dtype=torch.float32)

# warm_start dict with alpha and beta tensors
warm_start = {
    'alpha': torch.zeros(na, dtype=torch.float32),
    'beta': torch.zeros(nb, dtype=torch.float32)
}

ARGS = {
    'a': a,
    'b': b,
    'C': C,
    'reg': 0.1,
    'maxIter': 100,
    'tau': 1000.0,
    'stopThr': 1e-9,
    'verbose': False,
    'log': True,
    'warm_start': warm_start,
    'eval_freq': 10,
    'print_freq': 50
}
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 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
OT_Loss Not yet run
unverified (harvested, no recorded run)
cvlab-stonybrook/DM-Count/losses/ot_loss.py
code served (permissive licence) · get_code("71d906d461c4d5cd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
sinkhorn
brick of this paper's assembly: loss
1 other paper
1 later
Yang_Unifying_Top-down_and_Bottom-up_Scanpath_Prediction_Using_Transformers_CVPR_2024_paper (2024 (year only))
Unifying Top-down and Bottom-up Scanpath Prediction Using Transformers
sinkhorn_knopp
brick of this paper's assembly: helper
1 other paper
1 later
Yang_Unifying_Top-down_and_Bottom-up_Scanpath_Prediction_Using_Transformers_CVPR_2024_paper (2024 (year only))
Unifying Top-down and Bottom-up Scanpath Prediction Using Transformers
sinkhorn_stabilized
brick of this paper's assembly: loss
1 other paper
1 later
Yang_Unifying_Top-down_and_Bottom-up_Scanpath_Prediction_Using_Transformers_CVPR_2024_paper (2024 (year only))
Unifying Top-down and Bottom-up Scanpath Prediction Using 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

In crowd counting, each training image contains multiple people, where each person is annotated by a dot. Existing crowd counting methods need to use a Gaussian to smooth each annotated dot or to estimate the likelihood of every pixel given the annotated point. In this paper, we show that imposing Gaussians to annotations hurts generalization performance. Instead, we propose to use Distribution Matching for crowd COUNTing (DM-Count). In DM-Count, we use Optimal Transport (OT) to measure the similarity between the normalized predicted density map and the normalized ground truth density map. To stabilize OT computation, we include a Total Variation loss in our model. We show that the generalization error bound of DM-Count is tighter than that of the Gaussian smoothed methods. In terms of Mean Absolute Error, DM-Count outperforms the previous state-of-the-art methods by a large margin on two large-scale counting datasets, UCF-QNRF and NWPU, and achieves the state-of-the-art results on the ShanghaiTech and UCF-CC50 datasets. DM-Count reduced the error of the state-of-the-art published result by approximately 16%. Code is available at https://github.com/cvlab-stonybrook/DM-Count.

For agents

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

get_harvested_code_for_paper("2009.13077")
get_code_for_paper("2009.13077")
have("2009.13077")

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

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

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

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

Connect an agent — have() is free.