Giter VIP home page Giter VIP logo

context-aware_crowd_counting-pytorch's Introduction

Context-Aware_Crowd_Counting-pytorch

This is an simple and clean unoffical implemention of CVPR 2019 paper "Context-Aware Crowd Counting".

Installation

 1. Install pytorch 1.0.0 later and python 3.6 later
 2. Install visdom

pip install visdom

 3. Install tqdm

pip install tqdm

 4. Clone this repository

git clone https://github.com/CommissarMa/Context-Aware_Crowd_Counting-pytorch.git

We'll call the directory that you cloned Context-Aware_Crowd_Counting-pytorch as ROOT.

Data Setup

 1. Download ShanghaiTech Dataset from Dropbox: link or Baidu Disk: link
 2. Put ShanghaiTech Dataset in ROOT and use "data_preparation/k_nearest_gaussian_kernel.py" to generate ground truth density-map. (Mind that you need modify the root_path in the main function of "data_preparation/k_nearest_gaussian_kernel.py")

Training

 1. Modify the root path in "train.py" according to your dataset position.
 2. In command line:

python -m visdom.server

 3. Run train.py

Testing

 1. Modify the root path in "test.py" according to your dataset position.
 2. Run test.py for calculate MAE of test images or just show an estimated density-map.

Other notes

we got the comparable MAE at the 353 epoch BaiduDisk download with Extraction code: yfwb or Dropbox Link which is reported in paper. Thanks for the author's(Weizhe Liu) response by email. His mainpage is link.

context-aware_crowd_counting-pytorch's People

Contributors

commissarma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

context-aware_crowd_counting-pytorch's Issues

求问网盘上的模型是 Part_A的吗?

"MAE at the 353 epoch BaiduDisk download with Extraction code: yfwb". 求问这个模型是part_A的吗? 我直接用这个测试part_A, 得到 mae:413.119863447

Pretrained model and training on Part B

Hello! Thanks for your implementation of the network. Unfortunately for non - chinese people it's hard to download from pan.baidu so could you please upload your pretrained model on another cloud like dropbox or google drive? Because I've been training on Shanghai Part A but can't get lower than 66 MAE even after 600 epochs.
I've also been training on Shanghai Part B and convergence of the model seems to be much much slower. At 600 epochs MAE is around 28, much worse than the 7.8 reported in the paper. Even using the model trained on Part A for testing on Part B gives better results (something like 23 MAE). For training on Part B I just switched the optimizer to Adam instead of SGD and set batch size to 4 (because any more than that and a "cuda out of memory error" occurs, even though I'm training on a RTX 2080 Ti with 11GB of memory). Should I stick with it and just train for more epochs or change some other hyper parameters of the optimizer to train faster?

Problem about 'auxiliary networks' said in the paper!

The paper sain'We therefore exploit them as input to auxiliary networks with weights θjsa that compute the weights ωj assigned to each one of the S different scales we use.',But I didn't see 'auxiliary networks with weights θjsa' in your code ,Is that a normal conv?Can you help me?

密度图

如何将测试生成的密度图和GT输出出来?

About MSE

Hello, I would like to ask if this code can calculate MSE. It seems that only MAE is calculated in test and train.

CPU is enough?

Is CPU enough for this project? I see there is no CUDA required.

about result

thanks for your code. but when i run ,i cant got same result as you say mae=62.3,at epoch 353.
image
can you give me some advice.
all code not change expect the path of data.

Get result from model output

I am creating an algorithm that counts people in real time, and I am interested in using your repository, however, I have a question. When performing an inference with the command

et_dmap = model (img)
the result of the amount of people in the image would be

et_dmap.data.sum() ?
I was in doubt because I am using the .pth provided by you and I'm having a bit strange results.

problem

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
在生成.npy的时候,生成不了

mae

你好,为什么我用的你的代码,跑了352个epoch(shanghaiTech Part_A),mae81左右,没有达到论文说的62.3

Thank you

image
cannnet.py第75行,谢谢你帮我解决除0错误

Some problem of k_nearest_gaussian_kernel.py

I found that if I use this method to generate the density maps, the count of the density map is different from the original .mat file. Is there something wrong? For example, the IMG_2 in ShanghaiTechA train data, the count of GT_IMG_2.mat is 707. But the count of the density map generated by your code is 698.
Thanks!

你好,我发现用你的代码生成的密度图和原始的.mat文件里的数目有些偏差,比如ShanghaiTech A里第二张图,原始的.mat文件中的label数是707,但用你的code生成的密度图sum之后是698。不知道是否有什么问题呢?还有你尝试过别的sigma和k取值的影响吗。
感谢!

no .npy

FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
image

训练过程大概需要多久呢?SHTech_PartA

第一次接触这类程序,请不要介意我的小白问题。.npy文件已成功生成,显卡是gtx1080,直接跑的代码里的数据集。在训练过程,每次读满两个进度条之后就出现[Errno 111] Connection refused的错误,然后又重新开始读两个进度条。不知道是我哪里的设置有问题,还是说本来这个训练的过程就需要一天以上的时间。
1571834256

Model Difference

Hello, thank you for your implements for Part_A dataset. I notice that there are some little differences between your model(cannet.py) and the official https://github.com/weizheliu/Context-Aware-Crowd-Counting/blob/master/model.py
The official code add one convolution layer to reduce channel numbers from 1024 to 512 before sending feature maps into backend, but you input it without any other operations.
I wonder if this way works better or for some other reasons. Thank you!

FileNotFoundError about'IMG_1.npy'

When using data_preparation / k_nearest_gaussian_kernel.py, I can't find 'IMG_1.npy'. Has anyone encountered this problem? Thanks for answering.

How to see the person count?

I am sorry if it comes out wrong. I have run the project successfully and tested on images from Shanghai dataset. I would like to see the number of person predicted. Is it possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.