oppo-us-research / SpacetimeGaussians

[CVPR 2024] Spacetime Gaussian Feature Splatting for Real-Time Dynamic View Synthesis
https://oppo-us-research.github.io/SpacetimeGaussians-website/
Other
616 stars 45 forks source link

Filenotfound error colmap #9

Closed Caquita-beep closed 5 months ago

Caquita-beep commented 10 months ago

Hello

When running train.py, I'm getting:

Traceback (most recent call last): File "./thirdparty/gaussian_splatting\scene\dataset_readers.py", line 768, in readColmapSceneInfo cam_extrinsics = read_extrinsics_binary(cameras_extrinsic_file) File "./thirdparty/gaussian_splatting\scene\colmap_loader.py", line 175, in read_extrinsics_binary with open(path_to_model_file, "rb") as fid: FileNotFoundError: [Errno 2] No such file or directory: 'C:\SpacetimeGaussians\data\cut_roasted_beef\colmap_0\sparse/0\images.bin'

Same with "sparse/0/images.txt"

The colmap_0 (and the rest of) folders r generated by pre_n3d.py. There is no "0" folder within colmap_0 and "sparse" folders is generated within distorted and it's empty.

Not sure what is going on. Any ideas?

lizhan17 commented 10 months ago

Hi, training, testing and preprocessing are tested on Ubuntu 20.04. More efforts are needed for windows. (like slash in windows..). I recommend that you can use Ubuntu for training. (scripts use Ubuntu file path convention )

Caquita-beep commented 10 months ago

Hello. Yeah I noticed. Had errors with pre_n3d.py becuase of the "slash" and as soon as I changed to / it worked hehe but I guess it didn't as it's giving the wrong output...

lizhan17 commented 10 months ago

Hello. Yeah I noticed. Had errors with pre_n3d.py becuase of the "slash" and as soon as I changed to / it worked hehe but I guess it didn't as it's giving the wrong output...

you may need be carefull with other parts like...

https://github.com/oppo-us-research/SpacetimeGaussians/blob/2f56210489ca115dc006c3400cc54750b2d38622/script/pre_n3d.py#L79

and somecodes in the https://github.com/oppo-us-research/SpacetimeGaussians/blob/2f56210489ca115dc006c3400cc54750b2d38622/thirdparty/gaussian_splatting/helper3dg.py#L181

Caquita-beep commented 10 months ago

Hello. Turns out for some reason Colmap installation with conda is having issues and so the "getcolmapsinglen3d" function in helper3dg.py was exiting prematurelly. So I run colmap from another env (which is not installed in the env lol but on the machine) and colmap is wokring this time. However, I'm getting error on triangulation :

============================================================================== Loading model

============================================================================== Loading database

Loading cameras... 21 in 0.000s Loading matches... 0 in 0.000s Loading images... 21 in 0.000s (connected 0) Building correspondence graph... in 0.000s (ignored 0) ... ...

Bundle adjustment

F20240104 14:56:36.840480 42368 sfm.cc:473] Check failed: bundle_adjuster.Solve(&reconstruction) Check failure stack trace: @ 00007FFAB66F6E5B public: void cdecl google::LogMessage::Flush(void) ptr64 @ 00007FFAB66F5739 public: cdecl google::LogMessageFatal::~LogMessageFatal(void) ptr64 @ 00007FF64F621E37 (unknown) @ 00007FF64F621360 (unknown) @ 00007FF64F5D65E6 (unknown) @ 00007FF64F5D7DEB (unknown) @ 00007FF64FBC43B4 (unknown) @ 00007FFADA4A257D BaseThreadInitThunk @ 00007FFADABEAA58 RtlUserThreadStart

Any clues?

lizhan17 commented 10 months ago

Hello,

Training, Testing and preprocessing have been tested on Ubuntu 20.04. While our efforts have been focused on this system, much more efforts are need for other system.

We recommend that you use colmap with conda-forge.

lizhan17 commented 10 months ago

For compatibility with Windows, we are busy dealing with other issues, and will try to adapt to Windows later. Please stay tuned for that.

YimjuneLiu commented 10 months ago

Hello. Yeah I noticed. Had errors with pre_n3d.py becuase of the "slash" and as soon as I changed to / it worked hehe but I guess it didn't as it's giving the wrong output...

you may need be carefull with other parts like...

https://github.com/oppo-us-research/SpacetimeGaussians/blob/2f56210489ca115dc006c3400cc54750b2d38622/script/pre_n3d.py#L79

and somecodes in the

https://github.com/oppo-us-research/SpacetimeGaussians/blob/2f56210489ca115dc006c3400cc54750b2d38622/thirdparty/gaussian_splatting/helper3dg.py#L181

def convertdynerftocolmapdb(path, offset=0):
    originnumpy = os.path.join(path, "poses_bounds.npy")
    video_paths = sorted(glob.glob(os.path.join(path, 'cam*.mp4')))
    projectfolder = os.path.join(path, "colmap_" + str(offset))
    #sparsefolder = os.path.join(projectfolder, "sparse/0")
    manualfolder = os.path.join(projectfolder, "manual")

    # if not os.path.exists(sparsefolder):
    #     os.makedirs(sparsefolder)

In this code block, is the commented-out part the reason why the sparse is not found?

lizhan17 commented 10 months ago

No, the sparse folder will be created by colmap

If colmap cannot produce the sparse model, the sparse folder will not be found.

what is your python version for colmap ?

YimjuneLiu commented 10 months ago

No, the sparse folder will be created by colmap

If colmap cannot produce the sparse model, the sparse folder will not be found.

what is your python version for colmap

It's the same as yours. python 3.8.18, pytorch 1.12.1, cudatoolkit 11.6.0.

lizhan17 commented 10 months ago

First you can confirm that colmap is installed with colmap -h if there is issue with mpir

# for windows run colmap 
conda install conda-forge::mpir

after that, you can change the code https://github.com/oppo-us-research/SpacetimeGaussians/blob/a977e11cc52a56ac670046049c9d76c151000984/script/pre_n3d.py#L79 to imagesavepath = os.path.join(savedir, os.path.basename(os.path.dirname(folder)) + ".png")

the command in the command prompt should be like

python script\pre_n3d.py --videopath C:\Users\xxxx\coffee_martini

python should handle the cross platform.

YimjuneLiu commented 10 months ago

Thank you for your reply!

But this problem still exists. It did not generate the sparse folder.

Otherwise, python can use

python script/pre_n3d.py --videopath ../xxxx/cook_spinach

for windows.

lizhan17 commented 10 months ago
python script\pre_n3d.py --videopath C:\Users\xxxx\coffee_martini

can you try this one python script\pre_n3d.py --videopath C:\Users\xxxx\coffee_martini

as python will handle the slash

YimjuneLiu commented 10 months ago

But it still hasn't generated the sparse folder.

lizhan17 commented 10 months ago

But it still hasn't generated the sparse folder.

1) can you remove all the colmap_x folders and rerun the code ? (also I recommend recloen the repo and only change one line that i posted ) 2) can you help me verify that each input folder under the colmap_x folder contains the same number of frames as the number of cameras ?

lizhan17 commented 5 months ago

We have an update for WSL (Windows Subsystem for Linux) available for Windows users. If you encounter any issues with WSL, please feel free to reopen or open an issue.