All Projects → embracesource-cv-com → keras-mcnn

embracesource-cv-com / keras-mcnn

Licence: Apache-2.0 license
keras实现的人群密度检测网络"Single Image Crowd Counting via Multi Column Convolutional Neural Network",欢迎试用、关注并反馈问题...

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to keras-mcnn

S-DCNet
Unofficial Pytorch implementation of S-DCNet and SS-DCNet
Stars: ✭ 17 (-26.09%)
Mutual labels:  crowd-counting, crowd-analysis
NWPU-Crowd-Sample-Code
The sample code for a large-scale crowd counting dataset, NWPU-Crowd.
Stars: ✭ 140 (+508.7%)
Mutual labels:  crowd-counting, crowd-analysis
IIM
PyTorch implementations of the paper: "Learning Independent Instance Maps for Crowd Localization"
Stars: ✭ 94 (+308.7%)
Mutual labels:  crowd-counting, crowd-analysis
CrowdFlow
Optical Flow Dataset and Benchmark for Visual Crowd Analysis
Stars: ✭ 87 (+278.26%)
Mutual labels:  crowd-counting, crowd-analysis
Awesome Crowd Counting
Awesome Crowd Counting
Stars: ✭ 1,720 (+7378.26%)
Mutual labels:  crowd-counting, crowd-analysis
PCC-Net
PCC Net: Perspective Crowd Counting via Spatial Convolutional Network
Stars: ✭ 63 (+173.91%)
Mutual labels:  crowd-counting, crowd-analysis
ACSCP cGAN
Code implementation for paper that "ACSCS: Crowd Counting via Adversarial Cross-Scale Consistency Pursuit"; This is method of Crowd counting by conditional generation adversarial networks
Stars: ✭ 36 (+56.52%)
Mutual labels:  crowd-counting
Variations-of-SFANet-for-Crowd-Counting
The official implementation of "Encoder-Decoder Based Convolutional Neural Networks with Multi-Scale-Aware Modules for Crowd Counting"
Stars: ✭ 78 (+239.13%)
Mutual labels:  crowd-counting
PyramidScaleNetwork
To the best of our knowledge, this is the first work to explicitly address feature similarity issue in multi-column design. Extensive experiments on four challenging benchmarks (ShanghaiTech, UCF_CC_50, UCF-QNRF, and Mall) demonstrate the effectiveness of the proposed innovations as well as the superior performance over the state-of-the-art. Mor…
Stars: ✭ 17 (-26.09%)
Mutual labels:  crowd-counting
ailia-models
The collection of pre-trained, state-of-the-art AI models for ailia SDK
Stars: ✭ 1,102 (+4691.3%)
Mutual labels:  crowd-counting
crowd-counting
Image Crowd Counting Using Convolutional Neural Network and Markov Random Field
Stars: ✭ 32 (+39.13%)
Mutual labels:  crowd-counting
W-Net-Keras
An unofficial implementation of W-Net for crowd counting.
Stars: ✭ 20 (-13.04%)
Mutual labels:  crowd-counting
Crowd-Counting-with-MCNNs
Crowd counting on the ShanghaiTech dataset, using multi-column convolutional neural networks.
Stars: ✭ 23 (+0%)
Mutual labels:  crowd-counting
CSRNet-keras
Implementation of the CSRNet paper (CVPR 18) in keras-tensorflow
Stars: ✭ 107 (+365.22%)
Mutual labels:  crowd-counting
MARUNet
Multi-level Attention Refined UNet for crowd counting
Stars: ✭ 30 (+30.43%)
Mutual labels:  crowd-counting
Smart-City-Sample
The smart city reference pipeline shows how to integrate various media building blocks, with analytics powered by the OpenVINO™ Toolkit, for traffic or stadium sensing, analytics and management tasks.
Stars: ✭ 141 (+513.04%)
Mutual labels:  crowd-counting
Dense-Scale-Network-for-Crowd-Counting
An unofficial implement of paper "Dense Scale Network for Crowd Counting", link: https://arxiv.org/abs/1906.09707
Stars: ✭ 25 (+8.7%)
Mutual labels:  crowd-counting
pytorch-ACSCP
Unofficial implementation of "Crowd Counting via Adversarial Cross-Scale Consistency Pursuit" with pytorch - CVPR 2018
Stars: ✭ 18 (-21.74%)
Mutual labels:  crowd-counting

keras-mcnn

keras复现人群数量估计网络"Single Image Crowd Counting via Multi Column Convolutional Neural Network"

参考pytorch版:https://github.com/svishwa/crowdcount-mcnn

安装

  1. Clone

    git clone https://github.com/embracesource-cv-com/keras-mcnn.git
  2. 安装依赖库

    cd keras-mcnn
    pip install -r requirements.txt

数据配置

  1. 下载ShanghaiTech数据集:
    Dropbox or 百度云盘

  2. 创建数据存放目录$ORIGIN_DATA_PATH

    mkdir /opt/dataset/crowd_counting/shanghaitech/original
  3. part_A_finalpart_B_final存放到$ORIGIN_DATA_PATH目录下

  4. 生成测试集的ground truth文件

    python create_gt_test_set_shtech.py [A or B]  # Part_A or Part_B

    生成好的ground-truth文件将会保存在$TEST_GT_PATH/test_data/ground_truth_csv目录下

  5. 生成训练集和验证集

    python create_training_set_shtech.py [A or B]

    生成好的数据保存将会在$TRAIN_PATH、$TRAIN_GT_PATH、$VAL_PATH、$VAL_GT_PATH目录下

  6. 生成热力图
    如果你想生成测试集的ground truth热力图:

    python create_heatmaps.py [A or B]

2~6步均在工程根目录下操作

测试

a)下载训练模型

mcnn-A.160.h5mcnn-B.035.h5

b) 如下命令分别测试A和B

python test.py --dataset A --weight_path /tmp/mcnn-A.160.h5 --output_dir /tmp/mcnn_A
python test.py --dataset B --weight_path /tmp/mcnn-B.035.h5 --output_dir /tmp/mcnn_B

训练

如果你想自己训练模型,很简单:

python train.py [A or B]

结果

|        |  MAE   |  MSE   |
----------------------------
| Part_A |  127.88 |  194.19 |
----------------------------
| Part_B |  30.71  |  46.81  |

改进点

​ 由于GT密度图每个像素点的值都很小(A数据集平均为0.02,B数据集平均为0.002),这样小的值不利于网络优化,因此对GT做了标准化(减去均值,然后除方差);预测时将预测的值先乘方差,再加上均值,就是最终的预测值。这个改进对最终的结果提升明显,使用标准化后,A数据集的MAE127.88没有使用标准化时只有154.7

样例

Part_A
原图:
原图
Ground Truth (1111) & Estimate (1256):
GT Estimate

Part_B
原图:
原图
Ground Truth (252) & Estimate(242):
GT Estimate

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].