ranahanocka / point2mesh

Reconstruct Watertight Meshes from Point Clouds [SIGGRAPH 2020]
MIT License
1.05k stars 121 forks source link

read .ply file using read_pts function #9

Closed pengsongyou closed 3 years ago

pengsongyou commented 4 years ago

Hi Rana,

First of all, this is really amazing work!!

When I tried to test your method on my own .ply file, your read_pts function at this line gave me an error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbe in position 210: invalid start byte

Apparently, it is because I have a different way of saving the ply file from yours. I am wondering if you could let me know or provide scripts on how you save sampled points + normals to the .ply files? In this way, I could generate my own ply files :)

Many thanks in advance!

Songyou

ranahanocka commented 4 years ago

Hi @pengsongyou ,

This error is because your .ply is saved using a binary encoding .

Any .ply can be converted to a non-ascii format via meshlab (export mesh as -> some_name.ply), then make sure that "binary encoding" is not checked, and also make sure that normal are checked. image

I also added a script here 48ae6dd532b6efe5412788d50e020d9e14ad73c5 to sample meshes from an input .obj file.

Hope that helps -Rana

pengsongyou commented 4 years ago

Hi Rana,

Thanks so much for your response! Using the provided script, I can now run the code with my own meshes :)

There is one quick following up question: now after running for 300 iterations, I encounter the out of memory issues. I guess it is because my object has a bit more details than your demo objects. Could you please provide some suggestions on this? What parameters should I tune in order to run it without OOT?

Many thanks in advance!

monajalal commented 5 months ago

@ranahanocka Thank you so much Rana. I had the following issue and your solution solved it.

(clean-pvnet) mona@ada:~/clean-pvnet$ python run.py --type custom
Traceback (most recent call last):
  File "/home/mona/clean-pvnet/run.py", line 276, in <module>
    globals()['run_'+args.type]()
  File "/home/mona/clean-pvnet/run.py", line 222, in run_custom
    handle_custom_dataset.custom_to_coco(data_root)
  File "/home/mona/clean-pvnet/tools/handle_custom_dataset.py", line 91, in custom_to_coco
    renderer = OpenGLRenderer(model_path)
  File "/home/mona/clean-pvnet/lib/utils/linemod/opengl_renderer.py", line 21, in __init__
    self.model = self.load_ply(self.ply_path)
  File "/home/mona/clean-pvnet/lib/utils/linemod/opengl_renderer.py", line 42, in load_ply
    line = f.readline().rstrip('\n').rstrip('\r') # Strip the newline character(s)
  File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 201: invalid continuation byte