hbb1 / 2d-gaussian-splatting

[SIGGRAPH'24] 2D Gaussian Splatting for Geometrically Accurate Radiance Fields
https://surfsplatting.github.io
Other
1.86k stars 114 forks source link

How can I render RGB images results #103

Open torracxiaokeai opened 2 months ago

torracxiaokeai commented 2 months ago

Hello, I'm sorry to bother you again, I wonder that how to render RGB images results, instead of mesh results. I tried the render.py from 2DGS, but the images export has nothing just black. I tried the render.py from origin 3DGS directly for the model I got in 2DGS, but failed too.

my cmd are as follow, using the DTU dataset given in this project provided: python train.py -s ./data/scan24/ -m ./output/scan24/ -r 2 --depth_ratio 1 Optimizing ./output/scan24/ Output folder: ./output/scan24/ [03/07 20:35:57] Tensorboard not available: not logging progress [03/07 20:35:57] Reading camera 49/49 [03/07 20:35:57] Loading Training Cameras [03/07 20:35:57] Loading Test Cameras [03/07 20:36:11] Number of points at initialisation : 31205 [03/07 20:36:11] Training progress: 23%|████████▋ | 7000/30000 [01:06<02:50, 135.26it/s, Loss=nan, distort=0.00000, normal=0.00000, Points=14760] [ITER 7000] Evaluating train: L1 0.5060994505882264 PSNR 4.698128366470337 [03/07 20:37:17]

[ITER 7000] Saving Gaussians [03/07 20:37:17] Training progress: 100%|████████████████████████████████████| 30000/30000 [04:02<00:00, 123.96it/s, Loss=nan, distort=0.00000, normal=0.05000, Points=14760]

[ITER 30000] Evaluating train: L1 0.5060994505882264 PSNR 4.698128366470337 [03/07 20:40:13]

[ITER 30000] Saving Gaussians [03/07 20:40:13]

Training complete. [03/07 20:40:13]

python render.py -s ./data/scan24/ -m ./output/scan24/ --depth_trunc 3 --voxel_size 0.004 -r 2 --depth_ratio 1 Looking for config file in ./output/scan24/cfg_args Config file found: ./output/scan24/cfg_args Rendering ./output/scan24/ Loading trained model at iteration 30000 Reading camera 49/49 Loading Training Cameras Loading Test Cameras export mesh ... reconstruct radiance fields: 49it [00:00, 129.66it/s] The estimated bounding radius is 1.87 Use at least 3.74 for depth_trunc Running tsdf volume integration ... voxel_size: 0.004 sdf_trunc: 0.02 depth_truc: 3.0 TSDF integration progress: 49it [00:00, 83.62it/s] [Open3D WARNING] Write PLY failed: mesh has 0 vertices. mesh saved at ./output/scan24/train/ours_30000/fuse.ply post processing the mesh to have 50 clusterscluster_to_kep [Open3D DEBUG] [ClusterConnectedTriangles] Compute triangle adjacency [Open3D DEBUG] [ClusterConnectedTriangles] Done computing triangle adjacency [Open3D DEBUG] [ClusterConnectedTriangles] Done clustering, #clusters=0 Traceback (most recent call last): File "render.py", line 106, in mesh_post = post_process_mesh(mesh, cluster_to_keep=args.num_cluster) File "/root/project/2d-gaussian-splatting/utils/mesh_utils.py", line 35, in post_process_mesh n_cluster = np.sort(cluster_n_triangles.copy())[-cluster_to_keep] IndexError: index -50 is out of bounds for axis 0 with size 0

hbb1 commented 1 month ago

We have integrated image rendering already. Just omit --skip_train or --skip_test when using render.py.