All models

P2PNet

A crowd counting model that predicts a point for each head and matches points to annotations one-to-one.

Detection and tracking · 74 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (25 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
21.6M
Operations
74
Framework
PyTorch
Recurrent
No
Published
ICCV 2021
Cited by
409 (as of 26 October 2026)
Authors
Qingyu Song, Changan Wang, Zhengkai Jiang and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m19028
Graph hash
8d1e87fe624c9e26618b2386caa2bd406a612b9617faab87800c35615f241612
Skeleton hash
4a3c9467431e68eee85739f5988502cb72fa68c35d9587009983d78324149b48
Architecture hash
0543d2d61cb67255282da665aa9f1d33be3b3df87020a8e17863edd6e9f4e55f
Diagram SHA-256
5b21bc51f97bd68cf4a2a5dd6d39e1ed7c1671833170216f0dcdeec92f19a742
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

P2PNet (Point to Point Network) counts and locates people in crowd images by directly predicting a set of point proposals that represent the heads in an image. The paper argues that locating individuals serves later crowd analysis better than counting alone, and that earlier localization methods, which learn from density maps or pseudo boxes, are counter-intuitive and error-prone.

The network takes the first 13 convolutional layers of VGG-16 bn, upsamples the resulting feature map by a factor of 2 and merges it with an earlier feature map through a lateral connection. Two parallel branches then work on the merged map: one regresses point coordinates as offsets from fixed reference points, and the other outputs a confidence score for each proposal. Each branch is three stacked convolutions interleaved with ReLU activations. During training each annotated point is matched to one proposal with the Hungarian algorithm, and the unmatched proposals are labeled as negatives.

The paper also proposes a metric, density Normalized Average Precision (nAP), meant to evaluate localization and counting errors together. Its experiments cover ShanghaiTech PartA and PartB, UCF CC 50, UCF-QNRF and NWPU-Crowd, with 4 reference points per feature-map location (8 for QNRF). On ShanghaiTech PartA the official repository lists a counting error of 52.74 MAE and 85.06 MSE for P2PNet.

Key idea. P2PNet directly predicts a set of point proposals for the heads in a crowd image and matches them one-to-one to annotated points with the Hungarian algorithm.

  • p2pnet
  • point to point network
  • crowd counting
  • crowd localization
  • head localization
  • point proposals
  • hungarian matching
  • density normalized average precision

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{song2021rethinkingcountinglocalizationcrowdsa,
      title={Rethinking Counting and Localization in Crowds:A Purely Point-Based Framework}, 
      author={Qingyu Song and Changan Wang and Zhengkai Jiang and Yabiao Wang and Ying Tai and Chengjie Wang and Jilin Li and Feiyue Huang and Yang Wu},
      year={2021},
      eprint={2107.12746},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2107.12746}, 
}