Pixel2Mesh icon indicating copy to clipboard operation
Pixel2Mesh copied to clipboard

About the train .dat file

Open Lordores opened this issue 4 years ago • 7 comments

I can't read .dat file I downloaded,either with encode ‘UTF-8’ or ‘gbk’.

Here I use generate_data.py generate .xyz file,but how can I get .dat file? Just change .xyz formet to .dat ???

Lordores avatar Oct 23 '19 09:10 Lordores

I think the problem may be related to wrong encoding format. Please load .dat files using pickle.

If you are using python3 to read .dat file, you can add encoding args when load pickle files.

f = pickle.load(open("xxx.dat", 'rb') , encoding="bytes") 

As for generate .dat file please check our recently updated code https://github.com/nywang16/Pixel2Mesh/blob/master/GenerateData/4_make_auxiliary_dat_file.ipynb for more details.

I will temporarily close this issue. If you require any further information, feel free to repoen it.

walsvid avatar Nov 08 '19 16:11 walsvid

Hello, I want to ask some questions about 4_make_auxiliary_dat_file.ipynb

I can get .xyz files from generate_data.py or 3_camera_transform.py with .obj file and its multi-view image.

How to use these .xyz files in 4_make_auxiliary_dat_file.ipynb ? And I also confuse about generate_data.py and 1_sample_points.txt,2_generate_normal.py,3_camera_transform.py , which is really used?

Lordores avatar Nov 28 '19 08:11 Lordores

All those files are used during data preparation, the number indicate the order of steps.

We first (1) sample the points, then (2) calculate the normal, then (3) perform a coordinate transformation on the point cloud with the normal, and then (4) generate auxiliary data. Finally, generate a dat file using generate_data.py.

walsvid avatar Nov 30 '19 05:11 walsvid

But I find generate_data.py do # 1 sampling # 2 tranform to camera view #### project for sure and only save a .xyz file for each view; So the xyz file is the dat file you said in Finally, generate a dat file using generate_data.py.?

And the work in generate_data.py is same like first (1) sample the points, then (2) calculate the normal, then (3) perform a coordinate transformation on the point cloud with the normal

(4) generate auxiliary data is just for ellipsoid or each model in ShapeNet data?

Lordores avatar Dec 02 '19 06:12 Lordores

<1> Yes, .dat files dump using pickle from .xyz files generated by generate_data.py. You can read in the .dat file and using pickle to load it, you will find that it is just a binary wrapper for xyz and corresponding image.

<2> generate auxiliary data is just for ellipsoid.

walsvid avatar Dec 02 '19 12:12 walsvid

@walsvid About the original data from shapenetcore.v1, are they all resized to be put in a unit cube, which are of size (-0.5,0.5)^3? And why would you choose ellipsoid with a size of (0.2,0.2,0.4) radius?

And you use your rendering_metacamera.txt annotations to transform 3d object to camera coordinates?

KnightOfTheMoonlight avatar Feb 09 '20 11:02 KnightOfTheMoonlight

But I find generate_data.py do # 1 sampling # 2 tranform to camera view #### project for sure and only save a .xyz file for each view; So the xyz file is the dat file you said in Finally, generate a dat file using generate_data.py.?

And the work in generate_data.py is same like first (1) sample the points, then (2) calculate the normal, then (3) perform a coordinate transformation on the point cloud with the normal

(4) generate auxiliary data is just for ellipsoid or each model in ShapeNet data? Do you know the difference between the generate_data.py and ( 1_sample_points.txt, 2_generate_normal.py, 3_camera_transform.py ), both of them can generate .xyz file, but their sizes are different

Michaelwjh avatar Aug 18 '23 06:08 Michaelwjh