ayaanzhaque / instruct-nerf2nerf

Instruct-NeRF2NeRF: Editing 3D Scenes with Instructions (ICCV 2023)
https://instruct-nerf2nerf.github.io/
MIT License
769 stars 64 forks source link

how to debug in2n #22

Closed jianglh-WHU closed 1 year ago

jianglh-WHU commented 1 year ago

Hi~, thanks for your excellent work!

I wanna know how to debug in2n in nerfstudio. Because I found that nerfstudio is a package, which makes it very inconvenient for us to debug. Is there any solution for this?

ayaanzhaque commented 1 year ago

What parts of Nerfstudio would you like to debug? Anything from the main Nerfstudio code can be overwritten if you create your own custom class, which would allow you to change the code nad debug it easily.

tancik commented 1 year ago

Instead of installing the pip package from pypi, you can install from the github in an editable way,

git clone git@github.com:nerfstudio-project/nerfstudio.git
cd nerfstudio
pip install --upgrade pip setuptools
pip install -e .
jianglh-WHU commented 1 year ago

yeah, but I want to know how to debug in2n, because in2n and nerfstudio are in two different repos.

lukasHoel commented 1 year ago

@jianglh-WHU I copied the train.py from the nerfstudio repo and placed it in the in2n folder. Then I could start the process from there via python train.py in2n ..., which allowed me to set breakpoints and debug from within this repository.

ayaanzhaque commented 1 year ago

Thanks @lukasHoel! In the more recent version of the code, we have provided an in2n_trainer.py file that inherits the trainer file that Lukas is talking about. You can then edit the code to overwrite the functions from the original train.py file and then add your breakpoints in python directly. Hopefully that helps!

yoker5262 commented 1 year ago

我只想用in2n,用它去训练我的数据,然后做推理。改变数据来源是需要从in2n_datamanager.py中setup_train方法中的self.train_dataset改变成我自己的数据吗?

ayaanzhaque commented 1 year ago

@yoker5262 No you don't have to change the code at all. Simply use ns-process-data, which is explained in the README, to process your data. Then train the nerfacto model for your dataset, and then you can train the in2n model for your dataset.

aiyb1314 commented 1 month ago

@jianglh-WHU I copied the train.py from the nerfstudio repo and placed it in the in2n folder. Then I could start the process from there via python train.py in2n ..., which allowed me to set breakpoints and debug from within this repository. ModuleNotFoundError: No module named 'in2n.in2n_config'; 'in2n' is not a package