maturk / dn-splatter

DN-Splatter: Depth and Normal Priors for Gaussian Splatting and Meshing
https://maturk.github.io/dn-splatter/
Apache License 2.0
305 stars 17 forks source link

how can i get transforms.json #8

Open yang1hu opened 2 months ago

yang1hu commented 2 months ago

hello,this is a great project. however! I wanna use my custom dataset, the dataset is from a video and convert with colmap, i can not get the transfroms,json,how can i get it ,thank you very much

XuqianRen commented 2 months ago

@yang1hu Hi, thank you. You can get the colmap pose with transfrom.json through nerfstudio data process script: https://docs.nerf.studio/quickstart/custom_dataset.html#processing-data If you already get colmap pose and want to transfer it to transform.json, you can skip colmap by adding --skip-colmap

StevenssW commented 2 months ago

I also encountered this problem, when I do data conversion through nerfstudio in ubuntu, camera.txt and image.txt are generated instead of camera.bin and image.bin, which causes transform.json generation to fail

yang1hu commented 2 months ago

@yang1hu Hi, thank you. You can get the colmap pose with transfrom.json through nerfstudio data process script: https://docs.nerf.studio/quickstart/custom_dataset.html#processing-data If you already get colmap pose and want to transfer it to transform.json, you can skip colmap by adding --skip-colmap

thanks for your tips. I have handle the problem.

yang1hu commented 2 months ago

@yang1hu Hi, thank you. You can get the colmap pose with transfrom.json through nerfstudio data process script: https://docs.nerf.studio/quickstart/custom_dataset.html#processing-data If you already get colmap pose and want to transfer it to transform.json, you can skip colmap by adding --skip-colmap

I did get the transforms.json, however , i use the dataset to train ,when i execute the train command i get the problem in the picture ,the command is: ns-train dn-splatter --data /root/autodl-tmp/dn-splatter/poster --pipeline.model.use-depth-smooth-loss True --pipeline.model.use-sparse-loss True --pipeline.model.use-binary-opacities True question

maturk commented 2 months ago

@yang1hu , this issue is caused by changes in the main branch of nerfstudio within the last week. Thanks for pointing this out.

So the problem is that dn-splatter inherits from the base splatfacto model upstream in nerfstudio. However, the nerfstudio repo changes quite often, so I set the nerfstudio requirement in the pyproject.toml as >=1.0.2. But looks like some breaking changes have occurred in a recent verison so I need to update this project to account for this. Mainy @oseiskar added pose optimization and currently this project does not support it. Give me a few moments and I can fix this issue.

maturk commented 2 months ago

@yang1hu this should be fixed by #12. Let me know if you find any more bugs.

pablovela5620 commented 2 months ago

@yang1hu this should be fixed by #12. Let me know if you find any more bugs.

This latest addition has broken things for me

File "/home/pablo/0Dev/personal/forked-repos/dn-splatter/dn_splatter/dn_model.py", line 245, in populate_modules
    self.camera_optimizer: CameraOptimizer = self.config.camera_optimizer.setup(
AttributeError: 'DNSplatterModelConfig' object has no attribute 'camera_optimizer'

is there a specific version of nerfstudio I should be installing to ensure camera_optimizer is in splatfacto? or should I also be adding the camera_optimizer to DNSplatterModelConfig

maturk commented 2 months ago

@yang1hu this should be fixed by #12. Let me know if you find any more bugs.

This latest addition has broken things for me

File "/home/pablo/0Dev/personal/forked-repos/dn-splatter/dn_splatter/dn_model.py", line 245, in populate_modules
    self.camera_optimizer: CameraOptimizer = self.config.camera_optimizer.setup(
AttributeError: 'DNSplatterModelConfig' object has no attribute 'camera_optimizer'

is there a specific version of nerfstudio I should be installing to ensure camera_optimizer is in splatfacto? or should I also be adding the camera_optimizer to DNSplatterModelConfig

I see, so the unfortunate thing is that nerfstudio version 1.0.3 from before last week worked fine, but a recent merge to enable camera optimization with the splatfacto model has been merged which is essentially a "breaking" change for any model subclassing splatfacto, also the version has not been updated. My suggestion is to simply git pull the latest main from nerfstudio. I will see if I can hack something that allows both previous and the most latest nerfstudio version to work simultaneously. Sorry about this, this is a good learning experience for me trying to ship any code xD Another solution would be to put a stricter version of nerfstudio as a project dependency for dn-splatter.

EDIT: should be addressed here: #14

pablovela5620 commented 2 months ago

@maturk so basically I would want to replace in pyproject.toml nerfstudio>=1.0.3 with nerfstudio@https://github.com/nerfstudio-project/nerfstudio so that I have the latest main branch, I do think this means that anyone that hasn't read this issue and tries to run the project will come up on this issue. It may be worthwhile making a PR just for that for now (since the current version of 1.0.3 doesn't include the optimization code)

edit: I realized that the build system for this isn't with poetry so the only way is to either do it manually in the conda environment or with the pixi.toml for now by adding

[pypi-dependencies]
nerfstudio = { git = "https://github.com/nerfstudio-project/nerfstudio.git", rev = "a64026f8db23a4233327a1d0303e6082bf5b9805" }
dn-splatter = { path = ".", editable = true}

and removing

nerfstudio>=1.0.3

from the pyproject.toml