The codes is tested with PyTorch 1.5.0. It may not run with other versions.
Visualized demos for P2PNet
The network
The overall architecture of the P2PNet. Built upon the VGG16, it firstly introduce an upsampling path to obtain fine-grained feature map.
Then it exploits two branches to simultaneously predict a set of point proposals and their confidence scores.
Comparison with state-of-the-art methods
The P2PNet achieved state-of-the-art performance on several challenging datasets with various densities.
The overall performance for both counting and localization.
nAP$_{\delta}$
SHTechPartA
SHTechPartB
UCF_CC_50
UCF_QNRF
NWPU_Crowd
$\delta=0.05$
10.9%
23.8%
5.0%
5.9%
12.9%
$\delta=0.25$
70.3%
84.2%
54.5%
55.4%
71.3%
$\delta=0.50$
90.1%
94.1%
88.1%
83.2%
89.1%
$\delta={{0.05:0.05:0.50}}$
64.4%
76.3%
54.3%
53.1%
65.0%
Comparison for the localization performance in terms of F1-Measure on NWPU.
Method
F1-Measure
Precision
Recall
FasterRCNN
0.068
0.958
0.035
TinyFaces
0.567
0.529
0.611
RAZ
0.599
0.666
0.543
Crowd-SDNet
0.637
0.651
0.624
PDRNet
0.653
0.675
0.633
TopoCount
0.692
0.683
0.701
D2CNet
0.700
0.741
0.662
Ours
0.712
0.729
0.695
Installation
Clone this repo into a directory named P2PNET_ROOT
Organize your datasets as required
Install Python dependencies. We use python 3.6.5 and pytorch 1.5.0
pip install -r requirements.txt
Organize the counting dataset
We use a list file to collect all the images and their ground truth annotations in a counting dataset. When your dataset is organized as recommended in the following, the format of this list file is defined as:
DATA_ROOT is your path containing the counting datasets.
Annotations format
For the annotations of each image, we use a single txt file which contains one annotation per line. Note that indexing for pixel values starts at 0. The expected format of each line is:
x1 y1
x2 y2
...
Training
The network can be trained using the train.py script. For training on SHTechPartA, use
We refer to DETR to implement our matching strategy.
Citing P2PNet
If you find P2PNet is useful in your project, please consider citing us:
@inproceedings{song2021rethinking,
title={Rethinking Counting and Localization in Crowds: A Purely Point-Based Framework},
author={Song, Qingyu and Wang, Changan and Jiang, Zhengkai and Wang, Yabiao and Tai, Ying and Wang, Chengjie and Li, Jilin and Huang, Feiyue and Wu, Yang},
journal={Proceedings of the IEEE/CVF International Conference on Computer Vision},
year={2021}
}
Related works from Tencent Youtu Lab
[AAAI2021] To Choose or to Fuse? Scale Selection for Crowd Counting. (paper link & codes)
[ICCV2021] Uniformity in Heterogeneity: Diving Deep into Count Interval Partition for Crowd Counting. (paper link & codes)
请发表评论