crowdcount-mcnn icon indicating copy to clipboard operation
crowdcount-mcnn copied to clipboard

explaining dataset .mat files

Open norahik opened this issue 6 years ago • 10 comments

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 avatar Jun 26 '18 12:06 norahik

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]]

norahik avatar Jul 25 '18 08:07 norahik

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?

BlakeRainey avatar Oct 06 '18 04:10 BlakeRainey

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

xiqisz avatar Apr 14 '19 16:04 xiqisz

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 avatar Sep 27 '19 10:09 tongpinmo

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 avatar Sep 27 '19 10:09 tongpinmo

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

tongpinmo avatar Sep 27 '19 10:09 tongpinmo

I have solved it

tongpinmo avatar Oct 09 '19 03:10 tongpinmo

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

ft-z avatar Apr 09 '20 07:04 ft-z

我已经解决了

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

w-x-j00 avatar Mar 08 '22 01:03 w-x-j00

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: @.***>

norahik avatar Mar 08 '22 04:03 norahik