google-research / multinerf

A Code Release for Mip-NeRF 360, Ref-NeRF, and RawNeRF
Apache License 2.0
3.57k stars 338 forks source link

[Query] on Installation #64

Closed innat closed 11 months ago

innat commented 1 year ago

I'm trying to test multi-nerf. I am using GCP instance to set up working environments. As mentioned, I place some image in the following directory dataset / images / ....

multinerf
   - dataset 
   -  - images # [contains image files]
   - config
   - internal
   - scripts
   - test
train.py
requirements.txt
...

Then to generate camera poses, I run the following command.

# Set to 0 if you do not have a GPU.
USE_GPU=0 
# Path to a directory `base/` with images in `base/images/`.
# DATASET_PATH=$1
DATASET_PATH='/home/jupyter/work/nerf/multinerf/dataset'
# Recommended CAMERA values: OPENCV for perspective, OPENCV_FISHEYE for fisheye.
CAMERA=${2:-OPENCV}
bash scripts/local_colmap_and_resize.sh 

But after some progress, I got

....
  98  1.466397e+01    7.68e-03    1.77e+02   3.07e+00   6.32e-01  4.97e+05        1    3.06e-04    3.26e-02
  99  1.465639e+01    7.58e-03    1.76e+02   3.06e+00   6.33e-01  5.06e+05        1    2.75e-04    3.29e-02
 100  1.464891e+01    7.48e-03    1.75e+02   3.05e+00   6.33e-01  5.16e+05        1    2.70e-04    3.32e-02

Bundle adjustment report
------------------------
    Residuals : 128
   Parameters : 107
   Iterations : 101
         Time : 0.0331967 [s]
 Initial cost : 0.437215 [px]
   Final cost : 0.338297 [px]
  Termination : No convergence

  => Filtered observations: 0
  => Filtered images: 0
  => No good initial image pair found.

Elapsed time: 0.228 [minutes]
~/work/nerf/multinerf/dataset/images_2 ~/work/nerf/multinerf
xargs: mogrify: No such file or directory
~/work/nerf/multinerf
jonbarron commented 1 year ago

mogrify is a command that will resize images, it looks like you don't have it installed, so images_2 isn't being made.

innat commented 1 year ago

Thanks. I installed it as follows

!sudo apt install imagemagick

# and check
!convert --version

Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP 
Delegates (built-in): bzlib djvu fftw fontconfig freetype 
heic jbig jng jp2 jpeg lcms lqr ltdl lzma 
openexr pangocairo png tiff webp wmf x xml zlib

And now, when I run the colmap using bash scripts/local_colmap_and_resize.sh, it ends something like as follows. Plus, I also had to comment out this line to make it run.

image

My folder fomats are as follows. Here, sparse folder is empty. Is it Ok? and what about the database.db representing?

multinerf
   - dataset 
   -  - images # [contains image files]
   - - images_2 # [contains image files]
   - - images_4 # [contains image files]
   - - images_8 # [contains image files]
   - - sparse 
   - - database.db
   - config
   - internal
   - scripts
   - test
train.py
requirements.txt
...

Should it be like this? Because, when I try to run train.py

DATA_DIR='/home/jupyter/work/nerf/multinerf/dataset'

python -m train \
  --gin_configs=configs/360.gin \
  --gin_bindings="Config.data_dir = '${DATA_DIR}'" \
  --gin_bindings="Config.checkpoint_dir = '${DATA_DIR}/checkpoints'" \
  --logtostderr
FileNotFoundError: [Errno 2] No such file or directory:
 '/home/jupyter/work/nerf/multinerf/dataset/transforms.json'
wangchaofan2018 commented 1 year ago

I have the same problem!

wangchaofan2018 commented 1 year ago

I know the crux of the problem. The directory DATA_DIR should be only the directory name.