Code Monkey home page Code Monkey logo

sfanet-crowd-counting's Introduction

SFANet-crowd-counting

This is an unofficial implement of the arXiv paper Dual Path Multi-Scale Fusion Networks with Attention for Crowd Counting by PyTorch.

Prerequisite

Python 3.7

Pytorch 1.1.0

Code structure

density_map.py To generate the density map and attention map.

dataset.py and transforms.py For data preprocess and augmentation.

models.py The structure of the network.

train.py To train the model.

eval.py To test the model.

Train & Test

For training, run

python train.py --dataset="SHA" --data_path="path to dataset" --save_path="path to save checkpoint"

For testing, run

python eval.py --dataset="SHA" --data_path="path to dataset" --save_path="path to checkpoint"

Result

ShanghaiTech part A: epoch367 MAE 60.43 MSE 98.24

ShanghaiTech part B: epoch432 MAE 6.38 MSE 10.99

sfanet-crowd-counting's People

Contributors

pxq0312 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

Watchers

 avatar

sfanet-crowd-counting's Issues

Error Indexing

I am getting this error , I am unable to figure out the issue

Traceback (most recent call last):
File "train.py", line 57, in
for i, (images, density, att) in enumerate(train_loader):
File "/home/hiramustafa/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/hiramustafa/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/home/hiramustafa/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/hiramustafa/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/hiramustafa/Downloads/Thesis_new/dataset.py", line 32, in getitem
label = h5py.File(self.label_list[index], 'r')
IndexError: list index out of range

关于计算MSE

请问在计算mse时,为什么要做一个开方操作呢? 【在train.py的第90行】 这不是计算RMSE的方式吗?
image

Density map generation

Hi thanks for this wonderful code, How to generate density maps? I have run density_map.py but it does not generate any density map I can see it also does not take any test results as well . Please any help or clue will be appreciated.

Data Agumentation

Hi, thanks for your excellent work! I just ran your code directly without any changes(except the path to data).

But I only got MAE7.58 on ShanghaiTech Part B. Can you please give me some suggestions? Any data augmentation plz? I really want to reproduce the 6.38 MAE. Thanks for your help.

Thank you and have a good day. @pxq0312

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.