-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better colmap2nerf script #1051
base: master
Are you sure you want to change the base?
Conversation
Without this, colmap will use up all available resources. This results in the system freezing due to no resources available. Adding this argument caps the resources and allows the system to function as normal.
Before you had to specify the path with "transform.json" at the end, else the script went in error. Now "transform.json" will be appended to the path resulting in it being created without specifying it every time.
All path locations are handled to put the transforms.json in the right location and populate the frames-object with the right image file_path. Also wrapped them is a os.normpath to ensure cross platform functionallity. This might not be necesarry but is a good assurance.
Hi there; thank you for the PR & thorough description! Just a few minor comments:
|
Good point about the portability, didn't think of that! Regarding the appending of transforms.json, I could certainly write a check if for if the path links to a folder or a file. |
Agree on all accounts. I'm with you RE |
Sorry for the silence, was quite occupied the last few weeks. So I went and implemented the requested changes. The --out flag functions like before but is now optional. When empty, it will default to my implementation. |
b04280e
to
c1bd002
Compare
Since I'm not that familiar with GitHub, I'd like to ask a question about the modified program from an end-user perspective and not as a programmer. Is that acceptable? -JW: |
@TanOneDeg is that a question for me? If so, go ahead I'd say. |
Finding help is difficult, so I appreciate your time. I hope you can help me out here. I am not saying that my workflow is the correct protocol. My o/s is Windows 10. My super old Linux laptops aren't capable of running instant-ngp. So, I downloaded instant-ngp binaries based on my RTX 3070 graphics card and installed the program on my D: drive. Oh, and I did not install anaconda and know nothing about it. In my workflow, I make a temporary work directory on my desktop, for example, G9Test, and place my A.mp4 video there, cd to that directory, then run the python example below from the Windows command prompt. python D:\InstantNGPv1\scripts/colmap2nerf.py --video_in A.mp4 --video_fps 1 --run_colmap --aabb_scale 16 Once that's completed, I create a directory inside my work directory called data and place the image directory and transforms.json file into the data directory. I have a shortcut on my desktop to run Instant-ngp and drag the data directory into instand-ngp. So that's been working for me. I would like to use individual images taken with my DSLR instead of a video. I am trying to understand what the process would be to accomplish that with my workflow. |
You would use the |
Thanks for taking the time to respond. I figured it out late last night after reading the documentation more carefully. |
colmap2nerf overhaul
Today I was about to train my own dataset. For this you need to pass it through the colmap2nerf script but I encountered some problems with generating these.
File path handling
From what I understand you are able to run the script either:
The first one works like expected, but the problem here is that you need to run the script from the actual image parent directory, linking to the script by defining the absolute path. This is far from ideal.
The second one does not function like expected, because it fills the transforms.json file with incorrect file paths. These are also partly in the UNIX format and this messes things up in Windows. Another problem with this, is that you always need to end the --out flag with "transforms.json". If not, Python goes in error because it is trying to access a directory instead of a file.
Another problem I encountered was that colmap defaulted to use all threads, resulting in the system freezing due to using way to much resources. This was easily fixed by adding an argument defining the amount of threads.
What was fixed
Example usage:
When using the script, colmap generates some files inside the root directory. I don't think these are ment for version control so I added a patern to ignore these.
Fantastic project by the way! ;)