waczjoan / gaussian-mesh-splatting

Other
274 stars 12 forks source link

'BasicPointCloud' object has no attribute 'triangles' #11

Open weihuazhang8 opened 3 months ago

weihuazhang8 commented 3 months ago

Thank you very much for your excellent work,When I train directly with the sparse folder, the following error is thrown: image I checked the code and found that the BasicPointCloud object really doesn't have the attribute 'triangles'.I don't know how to go about solving this.I would be very grateful if you could provide me with a solution to the problem image

waczjoan commented 3 months ago

Hi! Thank you!

Indeed, I guess different object (for example: https://github.com/waczjoan/gaussian-mesh-splatting/blob/7a16646828e9d43bb738ef92ba498838c755db66/games/mesh_splatting/utils/graphics_utils.py#L19) should be used.

Can you show us how you run train.py script?

Please check tutorial in READ.me there is step by step shown how to add arguments with train.py. Maybe extra flag is needed, for example gs_type: train.py --eval -s /data/hotdog -m output/hotdog_gs_mesh --gs_type gs_mesh Or train.py --eval -s /data/hotdog -m output/hotdog_gs_flat --gs_type gs_flat -w

weihuazhang8 commented 3 months ago

Thank you very much for your prompt reply.I use the text below for training: python train.py --eval --source_path /home/zwh/project/task9/gaussian-mesh-splatting/data/0223 --model_path /home/zwh/project/task9/gaussian-mesh-splatting/data/0223/output --resolution 2 --data_device cuda --iterations 10000 --gs_type gs_mesh -w When I manually added the triangles attribute to BasicPointCloud, I found that the program still could not be run, and the following error was thrown: image image But I tried to change the gs_type to gs_flat, and found that the program ran successfully, and at this point, I need to remove the triangles attribute that I manually added to BasicPointCloud, otherwise the program will not run successfully. The image below shows the contents of the sparse/0 folder: image But I still don't know why the program doesn't run when gs_type is gs_mesh.Thank you very much for your reply.

waczjoan commented 3 months ago

Hmmm... One more guess, do you have mesh.obj in your dataset? Can yous show us how datasets looks like ?

Can you debug this code: https://github.com/waczjoan/gaussian-mesh-splatting/blob/7a16646828e9d43bb738ef92ba498838c755db66/scene/__init__.py#L50 More specific: do you get Found transforms_train.json file, assuming Blender_Mesh data set! information?

If you use gs_mesh pcd should be created here: https://github.com/waczjoan/gaussian-mesh-splatting/blob/7a16646828e9d43bb738ef92ba498838c755db66/games/mesh_splatting/scene/dataset_readers.py#L87 Hence MeshPointCloud should be used instead of BasicPointCloud, and that is where triangles is created, which is used later (self.point_cloud.triangles)

weihuazhang8 commented 3 months ago

Because these days are holidays, I don't want to disturb your holiday life, and I am very sorry that I did not reply to you in time.Here's my data folder: image If my folder has mesh.obj files and transforms_train.json files, the program works, but the rendering results are not very good. The data folder and rendering effects are as follows: image image One folder in the training data looks like this: image I don't get Found transforms_train.json file, assuming Blender_Mesh data set! information. I debugged the code and found an interesting result: image In the declaration of the create_from_pcd function, the pcd is indeed a MeshPointCloud object, but it is actually a BasicPointCloud object.I think the problem is in the scene_info object. image I will continue to debug the remaining code and give feedback on the subsequent results and issues.

weihuazhang8 commented 3 months ago

Hello, I went ahead and debugged the rest of the code and found the following issues: image scene_info object is obtained by calling the sceneLoadTypeCallbacks["Colmap"](args.source_path, args.images, args.eval)function(readColmapSceneInfo). The readColmapSceneInfo function is in the scene/dataset_readers.py file, but this file only has a BasicPointCloud object, not a MeshPointCloud object. And there is no mention of the triangles attribute. image Now I don't know how to rewrite the code.I would be very grateful if you could give me a little bit of an idea.

waczjoan commented 3 months ago

Hi, I will be available after Wednesday, but if you use Colmap objects/functions it seems you don't use mesh.obj and in result, you don't run gs_mesh model.

"If my folder has mesh.obj files and transforms_train.json files, the program works, but the rendering results are not very good. " Here it seems maybe it is everything correct with settings (please confirm if you use MeshPointCloud) but parameters are unfitted, can you tell us how you create transformation.json and mesh.obj file? There is parameter c https://github.com/waczjoan/gaussian-mesh-splatting/blob/7a16646828e9d43bb738ef92ba498838c755db66/games/mesh_splatting/scene/dataset_readers.py#L33 which is used to scale dataset, in default it is set to used NeRF Synthetic blender dataset (for example example hotdog). Maybe your objects are smaller or bigger?