用图片自己训练nerf | instant-ngp | colmap 出坑记录

nerf需要colmap先解出每张图片中的相机位姿和相机的内参。
我在跑instant-ngp的colmap2nerf.py时,会出现如下报错:

1. WARNING: Your current options use the maximum number of threads on the machine to extract features. Exracting SIFT features on the CPU can consume a lot of RAM per thread for large images. Consider reducing the maximum image size and/or the first octave or manually limit the number of extraction threads. Ignore this warning, if your machine has sufficient memory for the current settings

==============================================================================
Feature extraction
FATAL: command failed`

导致这个问题的原因,如warning’中所示,
我参考了github issue 中给出的解决方案,成功解决了这个问题:

将该代码的123、124行替换为:

do_system(f"{colmap_binary} feature_extractor --ImageReader.camera_model {args.colmap_camera_model} --ImageReader.camera_params \"{args.colmap_camera_params}\" --ImageReader.single_camera 1 --database_path {db} --image_path {images}")
match_cmd = f"{colmap_binary} {args.colmap_matcher}_matcher --SiftMatching.guided_matching=true --database_path {db}"

2. [ WARN:0@20.410] global loadsave.cpp:248 findDecoder imread_(‘./train/36_231015-0329190652.png’): can’t open/read file: check file path/integrity Traceback (most recent call last): File “…/…/…/scripts/colmap2nerf.py”, line 344, in

后来发现这大概率是因为我的图片名字中有空格导致的。

可以使用下面这个免费的图片批量重命名网站,快速给图片改名
https://webrename.cn/

去掉名字中的空格后,问题解决。

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值