Fyusion / LLFF

Code release for Local Light Field Fusion at SIGGRAPH 2019
https://fyusion.com/LLFF
GNU General Public License v3.0
1.5k stars 243 forks source link

Recover camera poses ERROR running `python img2poses.py $your-images-folder` #55

Closed asbeg closed 2 years ago

asbeg commented 2 years ago

Hello i am trying to run python img2poses.py $your-images-folder to get camera poses for training (Neural Radiance Fields) and get this ERROR. Hardware: MacOS M1 Can you explain what the problem might be and how to fix it

Need to run COLMAP
[option_manager.cc:811] Check failed: ExistsDir(*image_path)
ERROR: Invalid options provided.
Traceback (most recent call last):
  File "imgs2poses.py", line 18, in <module>
    gen_poses(args.scenedir, args.match_type)
  File "/Users/ab/ProjectTest/LLFF/llff/poses/pose_utils.py", line 268, in gen_poses
    run_colmap(basedir, match_type)
  File "/Users/ab/ProjectTest/LLFF/llff/poses/colmap_wrapper.py", line 35, in run_colmap
    feat_output = ( subprocess.check_output(feature_extractor_args, universal_newlines=True) )
  File "/opt/anaconda3/envs/nerf_pl/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/opt/anaconda3/envs/nerf_pl/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['colmap', 'feature_extractor', '--database_path', '/Users/ab/ProjectTest/imgs_nerf/database.db', '--image_path', '/Users/ab/ProjectTest/imgs_nerf/images', '--ImageReader.single_camera', '1']' returned non-zero exit status 1.
syguan96 commented 2 years ago

Hi @asbeg, have you figured it out?

mm23mm commented 2 years ago

hi, same error, have you solved it?

WBrandes commented 2 years ago

I had the same error, I fixed it by manually running the colmap command in the error to see what was wrong. In my case I tried running python3 imgs2poses.py testscene/images/

and got an error message ending with subprocess.CalledProcessError: Command '['colmap', 'feature_extractor', '--database_path', 'testscene/images/database.db', '--image_path', 'testscene/images/images', '--ImageReader.single_camera', '1']' returned non-zero exit status 1. So I copied each piece out of that list and tried running the command manually from my terminal: colmap feature_extractor --database_path testscene/images/database.db --image_path testscene/images/images --ImageReader.single_camera 1

Which then gave this error:

[option_manager.cc:748] Check failed: ExistsDir(*image_path)
ERROR: Invalid options provided.

It was then that I realized I had just put in the directory wrong... it should have been

python3 imgs2poses.py testscene/, as you're supposed to give it main directory for your scene.

I don't know if for you theimgs_nerf directory is where your images are actually held, but if it is you should change that directory to images and then just give the imgs2poses script the ProjectTest directory.

A very silly mistake on my part so I don't know if it's the same problem on your end, but hopefully running the colmap command that's causing the error like I did might shed some light on what's going wrong.