svishwa / crowdcount-mcnn

Single Image Crowd Counting via MCNN (Unofficial Implementation)
MIT License
504 stars 180 forks source link

explaining dataset .mat files #27

Open norahik opened 6 years ago

norahik commented 6 years ago

good evening, i don't seem to understand the structure and the content of the .mat files. in the dataset. i believe it contains ground truth (counting) for images. i know at some point in CNN we need to calculate the error between the network result and the ground truth we have i try to print one file: {'image_info': array([[array([[(array([[ 855.32345978, 590.49587357], [ 965.5908524 , 472.79472415], [ 937.09478464, 400.93507502], ..., [ 42.5852337 , 359.87860699], [1017.48233659, 8.99748811], [1017.48233659, 23.31916643]]), array([[920]], dtype=uint16))]], dtype=[('location', 'O'), ('number', 'O')])]], dtype=object), '__version__': '1.0', '__header__': 'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Fri Nov 18 20:06:05 2016', '__globals__': []}

can someone explain whats in these files and how or for what that content is used in crowd estimation.

norahik commented 6 years ago

i get the answer, this .mat file contains (or what we are most interested in) two arrays (inside of a dictionary), the contents will be more clear if you open the file in mat lab.

one array is of size N by 2 , the 2 is for the X and Y coordinate for targeted object pixels, and N is the the total number of pixels (hence, ground-truth) this array is the one shown up in the question as : array([[ 855.32345978, 590.49587357], [ 965.5908524 , 472.79472415], [ 937.09478464, 400.93507502], ..., [ 42.5852337 , 359.87860699], [1017.48233659, 8.99748811], [1017.48233659, 23.31916643]])

the other array simple contains the N ( the ground-thruth) which is shown above in the question as: array([[920]]

BlakeRainey commented 5 years ago

I'm trying to generate GT csv files for my own dataset, but I don't have the necessary .mat files. @norahik, any idea how I can generate my own .mat files?

xiqisz commented 5 years ago

please explain two arrays of data in this .mat file in more detail exactly what it is?

tongpinmo commented 5 years ago

i get the answer, this .mat file contains (or what we are most interested in) two arrays (inside of a dictionary), the contents will be more clear if you open the file in mat lab.

one array is of size N by 2 , the 2 is for the X and Y coordinate for targeted object pixels, and N is the the total number of pixels (hence, ground-truth) this array is the one shown up in the question as : array([[ 855.32345978, 590.49587357], [ 965.5908524 , 472.79472415], [ 937.09478464, 400.93507502], ..., [ 42.5852337 , 359.87860699], [1017.48233659, 8.99748811], [1017.48233659, 23.31916643]])

the other array simple contains the N ( the ground-thruth) which is shown above in the question as: array([[920]]

I know the means of two arrays ,now i have my own dataset and point-xy ground truth files ,how to get the same struture like : ('image_info: ', array([[array([[(array([[222.5446098 , 472.86475499], [ 6.63269208, 709.19046582], [ 64.82506957, 694.96566243], ..., [714.76278388, 418.8815984 ], [519.37417249, 234.74573427], [523.46608059, 238.83764236]]), array([[707]], dtype=uint16))]], dtype=[('location', 'O'), ('number', 'O')])]], dtype=object)) the outside array([[array([[(array([[x,y]]),array([[number]],dtype=uint16))]],dtype=[('location','0'],('number','0')])]],dtype = object))
the structure is so unique as is unlike pythonic version,can I modify the dataloader file , maybe somethings is unnecessary? I wonder how you solve the problem ,thank you very much .

tongpinmo commented 5 years ago

good evening, i don't seem to understand the structure and the content of the .mat files. in the dataset. i believe it contains ground truth (counting) for images. i know at some point in CNN we need to calculate the error between the network result and the ground truth we have i try to print one file: {'image_info': array([[array([[(array([[ 855.32345978, 590.49587357], [ 965.5908524 , 472.79472415], [ 937.09478464, 400.93507502], ..., [ 42.5852337 , 359.87860699], [1017.48233659, 8.99748811], [1017.48233659, 23.31916643]]), array([[920]], dtype=uint16))]], dtype=[('location', 'O'), ('number', 'O')])]], dtype=object), '__version__': '1.0', '__header__': 'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Fri Nov 18 20:06:05 2016', '__globals__': []}

can someone explain whats in these files and how or for what that content is used in crowd estimation.

I know the means of two arrays ,now i have my own dataset and point-xy ground truth files ,how to get the same struture like : ('image_info: ', array([[array([[(array([[222.5446098 , 472.86475499], [ 6.63269208, 709.19046582], [ 64.82506957, 694.96566243], ..., [714.76278388, 418.8815984 ], [519.37417249, 234.74573427], [523.46608059, 238.83764236]]), array([[707]], dtype=uint16))]], dtype=[('location', 'O'), ('number', 'O')])]], dtype=object)) the outside array([[array([[(array([[x,y]]),array([[number]],dtype=uint16))]],dtype=[('location','0'],('number','0')])]],dtype = object)) the structure is so unique as we use before, I wonder how you solve the problem ,thank you very much .

tongpinmo commented 5 years ago

@svishwa hi ,how can I generate the GSV gt file for my own dataset , python or matlab ,thank you very much

tongpinmo commented 4 years ago

I have solved it

ft-z commented 4 years ago

I have solved it How do you get a heat map for a new picture? Thank you for your answer

w-x-j00 commented 2 years ago

我已经解决了

你好,请问你用什么工具生成的.mat文件,可以分享一下代码么?

norahik commented 2 years ago

You can use "scipy" library with python to save a "Numpy" array in a matlab format.https://docs.scipy.org/doc/scipy/index.htmlhttps://code-maven.com/slides/python/matlab-saveBest Regards,Norah Alkharashi.-------- Original message --------From: w-x-j00 @.>Date: Tue, Mar 8, 2022, 4:08 AMTo: svishwa/crowdcount-mcnn @.>Cc: norahik @.>, Mention @.>Subject: Re: [svishwa/crowdcount-mcnn] explaining dataset .mat files (#27)

我已经解决了

你好,请问你用什么工具生成的.mat文件,可以分享一下代码么?

—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you were mentioned.Message ID: @.***>