autonomousvision / sdfstudio

A Unified Framework for Surface Reconstruction
Apache License 2.0
1.95k stars 182 forks source link

Need advice on custom data with poor result #51

Open HungNgoCT opened 1 year ago

HungNgoCT commented 1 year ago

Hi, Thank you for amazing work. I have used instant-ngp, nerfstudio to generate mesh. However, sdfstudio impress me by mesh generation. When I use sample data, I always get good render and mesh. However, when I use custom data, results were always poor although I have done experiments and follow all discussions in this page.

Could you give me advice to process with this data: https://drive.google.com/file/d/1hLnwXon29bc4SiyuxiV32VAfQnZY2gTd/view?usp=share_link As screen shot of above shared data like this: Screenshotelephant

The steps I have done as followings:

I have checked very careful discussion in #2 (https://github.com/autonomousvision/sdfstudio/issues/2), and #49 (https://github.com/autonomousvision/sdfstudio/issues/49), but rendering result is very poor like #49.

Below videos are rendering with instant-ngp Video 1: https://user-images.githubusercontent.com/110378166/222356933-3112bdb8-3c96-4c30-a516-fc3af3e88706.mp4

And rendering with sdfstudio video 2: https://user-images.githubusercontent.com/110378166/222357045-c8175d1c-f59c-49db-82ab-1f9c5b81f6fa.mp4

The mesh I got from sdfstudio like this: ScreenshotElephantMesh

Highly appreciate with any help.

niujinshuchong commented 1 year ago

Hi, I don't have access permission to your data, could you update your link?

HungNgoCT commented 1 year ago

Hi, I don't have access permission to your data, could you update your link?

Thank you in advance @niujinshuchong , I have corrected the link. Please help download again. Note that if I use ns-process-data and process_nerfstudio_to_sdfstudio.py, cannot see anything at rendering.

niujinshuchong commented 1 year ago

Hi, the main object in your scene is not centered after nerfstudio-data parser. You could try to add the code here https://github.com/autonomousvision/sdfstudio/blob/master/nerfstudio/data/dataparsers/nerfstudio_dataparser.py#L196 to roughly center the object

# center the objects
poses[:, 0, 3] += 1.0        

And you could run with following command

ns-train volsdf --pipeline.model.sdf-field.use-grid-feature False --pipeline.model.sdf-field.hidden-dim 256 --pipeline.model.sdf-field.num-layers 2 --pipeline.model.sdf-field.num-layers-color 2 --pipeline.model.sdf-field.use-appearance-embedding False --pipeline.model.sdf-field.geometric-init True --pipeline.model.sdf-field.inside-outside False  --pipeline.model.sdf-field.bias 0.5 --pipeline.model.sdf-field.beta-init 0.1 --pipeline.datamanager.train-num-rays-per-batch 2048 --pipeline.model.background-model mlp --pipeline.model.near-plane 0.1 --pipeline.model.far-plane 2.0 --pipeline.model.overwrite-near-far-plane True --vis wandb --experiment-name volsdf-dtu106 nerfstudio-data --data  data/PNG_colmap/

I run it for 10k iterations and got something like this Screenshot from 2023-03-02 10-49-21

Maybe you could try to tune the network architecture/batch size/image resolutions to get better results.

HungNgoCT commented 1 year ago

Hi, the main object in your scene is not centered after nerfstudio-data parser. You could try to add the code here https://github.com/autonomousvision/sdfstudio/blob/master/nerfstudio/data/dataparsers/nerfstudio_dataparser.py#L196 to roughly center the object

# center the objects
poses[:, 0, 3] += 1.0        

And you could run with following command

ns-train volsdf --pipeline.model.sdf-field.use-grid-feature False --pipeline.model.sdf-field.hidden-dim 256 --pipeline.model.sdf-field.num-layers 2 --pipeline.model.sdf-field.num-layers-color 2 --pipeline.model.sdf-field.use-appearance-embedding False --pipeline.model.sdf-field.geometric-init True --pipeline.model.sdf-field.inside-outside False  --pipeline.model.sdf-field.bias 0.5 --pipeline.model.sdf-field.beta-init 0.1 --pipeline.datamanager.train-num-rays-per-batch 2048 --pipeline.model.background-model mlp --pipeline.model.near-plane 0.1 --pipeline.model.far-plane 2.0 --pipeline.model.overwrite-near-far-plane True --vis wandb --experiment-name volsdf-dtu106 nerfstudio-data --data  data/PNG_colmap/

I run it for 10k iterations and got something like this Screenshot from 2023-03-02 10-49-21

Maybe you could try to tune the network architecture/batch size/image resolutions to get better results.

So wonderful! Thank you for your help, @niujinshuchong I will try to follow your guidance and update my result.

suptimq commented 1 year ago

Hi, the main object in your scene is not centered after nerfstudio-data parser. You could try to add the code here https://github.com/autonomousvision/sdfstudio/blob/master/nerfstudio/data/dataparsers/nerfstudio_dataparser.py#L196 to roughly center the object

# center the objects
poses[:, 0, 3] += 1.0        

And you could run with following command

ns-train volsdf --pipeline.model.sdf-field.use-grid-feature False --pipeline.model.sdf-field.hidden-dim 256 --pipeline.model.sdf-field.num-layers 2 --pipeline.model.sdf-field.num-layers-color 2 --pipeline.model.sdf-field.use-appearance-embedding False --pipeline.model.sdf-field.geometric-init True --pipeline.model.sdf-field.inside-outside False  --pipeline.model.sdf-field.bias 0.5 --pipeline.model.sdf-field.beta-init 0.1 --pipeline.datamanager.train-num-rays-per-batch 2048 --pipeline.model.background-model mlp --pipeline.model.near-plane 0.1 --pipeline.model.far-plane 2.0 --pipeline.model.overwrite-near-far-plane True --vis wandb --experiment-name volsdf-dtu106 nerfstudio-data --data  data/PNG_colmap/

I run it for 10k iterations and got something like this Screenshot from 2023-03-02 10-49-21

Maybe you could try to tune the network architecture/batch size/image resolutions to get better results.

I wondered how you determined if the scene is centered or not.

f-dy commented 1 year ago

This would fix the centering issue ("focus" method) https://github.com/nerfstudio-project/nerfstudio/pull/1543

niujinshuchong commented 1 year ago

@suptimq I manually checked the camera poses in the viewer with --vis viewer. Thanks @f-dy for the suggestion. It would be great to have an automatic pose centering method.

f-dy commented 1 year ago

I just submitted a PR.

a1445605672 commented 10 months ago

image Is this what the code looks like?