zhengpeng7 / csrnet-keras Goto Github PK
View Code? Open in Web Editor NEWAn unofficial implementation of CSRNet for crowd counting.
An unofficial implementation of CSRNet for crowd counting.
Hello, have you ever tried CSRNet on WorldExpo Dataset. I have tried many times but still can't get same results as the same results in CSRNet.
Using TensorFlow backend.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-977e988b1777> in <module>
6 import numpy as np
7 from tqdm import tqdm
**----> 8 from utils_gen import gen_density_map_gaussian**
9 import matplotlib.pyplot as plt
10 get_ipython().run_line_magic('matplotlib', 'inline')
~\3. CSRNet-Keras - ZhengPeng7 - An unofficial implementation of CSRNet for crowd counting in Keras-Tensorflow\utils_gen.py in <module>
4 import scipy
5 import numpy as np
----> 6 from keras.preprocessing.image import ImageDataGenerator
7 from utils_imgproc import smallize_density_map, fix_singular_shape
8
~\anaconda3\envs\baseV2\lib\site-packages\keras\__init__.py in <module>
1 from __future__ import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications
~\anaconda3\envs\baseV2\lib\site-packages\keras\utils\__init__.py in <module>
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7 from . import losses_utils
8 from . import metrics_utils
~\anaconda3\envs\baseV2\lib\site-packages\keras\utils\conv_utils.py in <module>
7 from six.moves import range
8 import numpy as np
----> 9 from .. import backend as K
10
11
~\anaconda3\envs\baseV2\lib\site-packages\keras\backend\__init__.py in <module>
----> 1 from .load_backend import epsilon
2 from .load_backend import set_epsilon
3 from .load_backend import floatx
4 from .load_backend import set_floatx
5 from .load_backend import cast_to_floatx
~\anaconda3\envs\baseV2\lib\site-packages\keras\backend\load_backend.py in <module>
88 elif _BACKEND == 'tensorflow':
89 sys.stderr.write('Using TensorFlow backend.\n')
---> 90 from .tensorflow_backend import *
91 else:
92 # Try and load external backend.
~\anaconda3\envs\baseV2\lib\site-packages\keras\backend\tensorflow_backend.py in <module>
10 from tensorflow.python.ops import math_ops as tf_math_ops
11 from tensorflow.python.ops import state_ops as tf_state_ops
---> 12 from tensorflow.python.keras import backend as tf_keras_backend
13 from tensorflow.python.keras.utils import tf_utils
14 from tensorflow.python.ops import functional_ops
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\__init__.py in <module>
25
26 # See b/110718070#comment18 for more details about this import.
---> 27 from tensorflow.python.keras import models
28
29 from tensorflow.python.keras.engine.input_layer import Input
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\models.py in <module>
24 from tensorflow.python.keras import optimizers
25 from tensorflow.python.keras.engine import network
---> 26 from tensorflow.python.keras.engine import sequential
27 from tensorflow.python.keras.engine import training
28 from tensorflow.python.keras.engine.base_layer import AddMetric
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\engine\sequential.py in <module>
26 from tensorflow.python.keras.engine import base_layer_utils
27 from tensorflow.python.keras.engine import input_layer
---> 28 from tensorflow.python.keras.engine import training
29 from tensorflow.python.keras.engine import training_utils
30 from tensorflow.python.keras.saving.saved_model import model_serialization
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\engine\training.py in <module>
49 from tensorflow.python.keras.engine import training_generator
50 from tensorflow.python.keras.engine import training_utils
---> 51 from tensorflow.python.keras.engine import training_v2
52 from tensorflow.python.keras.engine import training_v2_utils
53 from tensorflow.python.keras.mixed_precision.experimental import loss_scale_optimizer
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py in <module>
33 from tensorflow.python.keras import callbacks as cbks
34 from tensorflow.python.keras.distribute import distributed_training_utils as dist_utils
---> 35 from tensorflow.python.keras.engine import data_adapter
36 from tensorflow.python.keras.engine import training_utils
37 from tensorflow.python.keras.engine import training_v2_utils
~\anaconda3\envs\baseV2\lib\site-packages\tensorflow_core\python\keras\engine\data_adapter.py in <module>
48
49 try:
---> 50 import pandas as pd # pylint: disable=g-import-not-at-top
51 except ImportError:
52 pd = None
~\anaconda3\envs\baseV2\lib\site-packages\pandas\__init__.py in <module>
191 # GH 27101
192 # TODO: remove Panel compat in 1.0
**--> 193 if pandas.compat.PY37:**
194
195 def __getattr__(name):
Can anybody sikved this? Thanksss
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-28-d8d829185e35> in <module>
22 )
23 # Generate raw images(normalized by imagenet rgb) and density maps
---> 24 test_x, test_y = gen_var_from_paths(test_img_paths[:], unit_len=None), gen_var_from_paths(test_dm_paths[:], stride=8, unit_len=None)
25 test_x = norm_by_imagenet(test_x) # Normalization on raw images in test set, those of training set are in image_preprocessing below.
26 print('Test data size:', test_x.shape[0], test_y.shape[0], len(test_img_paths))
~\3. CSRNet-Keras - ZhengPeng7 - An unofficial implementation of CSRNet for crowd counting in Keras-Tensorflow\utils_gen.py in gen_var_from_paths(paths, stride, unit_len)
41 elif format_suffix == 'jpg':
42 for ph in paths:
---> 43 raw = cv2.cvtColor(cv2.imread(ph), cv2.COLOR_BGR2RGB).astype(np.float32)
44 if unit_len:
45 raw = fix_singular_shape(raw, unit_len=unit_len)
Can anybody fix this?
您好:
我想请教您些问题,自己实在看不出问题在哪了,我用‘Neerajj9’那个KERAS代码跑的时候,什么也没改,训练的loss不对啊,您知道是什么原因吗?
1/700 [..............................] - ETA: 2:54:46 - loss: 0.0024 - mean_squared_error: 4.1646e-05
(96, 128, 1)
2/700 [..............................] - ETA: 2:36:14 - loss: nan - mean_squared_error: nan
(96, 128, 1)
3/700 [..............................] - ETA: 2:29:01 - loss: nan - mean_squared_error: nan
(96, 128, 1)
4/700 [..............................] - ETA: 2:25:56 - loss: nan - mean_squared_error: nan
(96, 128, 1)
5/700 [..............................] - ETA: 2:23:19 - loss: nan - mean_squared_error: nan
谢谢
File "/home/francesco/PycharmProjects/CSRNet-Keras/generate.py", line 46, in <module> DM = gen_density_map_gaussian(k, gt, sigma=sigma)
File "/home/francesco/PycharmProjects/CSRNet-Keras/utils_gen.py", line 93, in gen_density_map_gaussian density_map[
ValueError: operands could not be broadcast together with shapes (47,898) (47,0) (47,898)
How i can resolve it?
您好,我尝试过几次使用您的代码训练模型并且没有改变任何参数,但是每次训练结束后得到的最佳权重的MAE不一致且没有低于70过,请问这种情况正常吗,应该怎么改善呢?
密度图的ground-truth是根据标签生成的,然后根据密度图积分求和得到人数,对吗?
但是如果用一个随便找的图片进行测试的时候,没有标签,那怎么生成的密度图?
能解答一下吗
我换成自己的数据集 再运行generate_datasets时候 报错
ValueError: operands could not be broadcast together with shapes (59,1819) (59,0) (59,1819)
而且 是处理完一批数据之后才报错的
请问一下,在csrnet那篇论文中,最后有psnr和ssim的比较,源网络不是有3次池化吗,那么最后怎么能比较psnr和ssim呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.