Instant-angelo icon indicating copy to clipboard operation
Instant-angelo copied to clipboard

Instant-angelo fails to initialize the colmap dataset correctly in dense mode

Open hazy-sky opened this issue 2 years ago • 1 comments

When processing a dataset with Mapper.multiple_models=1, Instant-angelo dense fails to initialize the scene correctly. It seems like the generated vis-mvsnet fused model isn't aligned with the actual colmap model. I have tried to test the code with 4 different datasets and all of them have the same problem.

An example of how it looks: it10000-1

hazy-sky avatar Nov 08 '23 11:11 hazy-sky

Apologies for any inconvenience caused. To address the issue related to a too narrow reconstruction cube radius, please follow the steps below:

  1. Locate the configs/neuralangelo-colmap_dense.yaml file.
  2. Open the file and find the center_est_method parameter.
  3. Change the value from lookat to point.
  4. Next, locate the radius parameter.
  5. Increase the value from 1.5 to a larger number, such as 2.5 or 3.

An example config is shown as below:

name: neuralangelo-colmap_plus_dense-${basename:${dataset.root_dir}}
tag: ""
seed: 42

dataset:
  name: colmap
  root_dir: ???
  img_downscale: 2 # specify training image size by either img_wh or img_downscale
  up_est_method: ground # if true, use estimated ground plane normal direction as up direction
  center_est_method: point
  n_test_traj_steps: 30
  apply_mask: false
  load_data_on_gpu: false
  dense_pcd_path: dense/fused.ply

model:
  name: neus
  radius: 3
  num_samples_per_ray: 1024
  train_num_rays: 128
  max_train_num_rays: 8192
  grid_prune: true
  grid_prune_occ_thre: 0.001
  dynamic_ray_sampling: true
  batch_image_sampling: true
  randomized: true
  ray_chunk: 2048
  cos_anneal_end: 20000
  learned_background: true
  background_color: random
  variance:
    init_val: 0.3
    modulate: false
  geometry:
    name: volume-sdf
    radius: ${model.radius}
    feature_dim: 13
    grad_type: analytic
    finite_difference_eps: progressive
    isosurface:
      method: mc
      resolution: 512
      chunk: 2097152
      threshold: 0.
    xyz_encoding_config:
      otype: ProgressiveBandHashGrid
      n_levels: 16
      n_features_per_level: 2
      log2_hashmap_size: 19
      base_resolution: 32
      per_level_scale: 1.3195079107728942
      include_xyz: true
      start_level: 4
      start_step: 5000
      update_steps: 1000
    mlp_network_config:
      otype: VanillaMLP
      activation: ReLU
      output_activation: none
      n_neurons: 64
      n_hidden_layers: 1
      sphere_init: true
      sphere_init_radius: 0.5
      weight_norm: true
  texture:
    name: volume-dual-color
    input_feature_dim: ${add:${model.geometry.feature_dim},3} # surface normal as additional input
    dir_encoding_config:
      otype: SphericalHarmonics
      degree: 4
    mlp_network_config:
      otype: VanillaMLP
      activation: ReLU
      output_activation: none
      n_neurons: 64
      n_hidden_layers: 2
    color_activation: sigmoid
  # background model configurations
  num_samples_per_ray_bg: 256
  geometry_bg:
    name: volume-density
    radius: ${model.radius}
    feature_dim: 8
    density_activation: trunc_exp
    density_bias: -1
    isosurface: null
    xyz_encoding_config:
      otype: ProgressiveBandHashGrid
      n_levels: 16
      n_features_per_level: 2
      log2_hashmap_size: 19
      base_resolution: 32
      per_level_scale: 1.3195079107728942
      include_xyz: true
      start_level: 4
      start_step: 5000
      update_steps: 1000
    mlp_network_config:
      otype: VanillaMLP
      activation: ReLU
      output_activation: none
      n_neurons: 64
      n_hidden_layers: 1
  texture_bg:
    name: volume-dual-color
    input_feature_dim: ${model.geometry_bg.feature_dim}
    dir_encoding_config:
      otype: SphericalHarmonics
      degree: 4
    mlp_network_config:
      otype: VanillaMLP
      activation: ReLU
      output_activation: none
      n_neurons: 64
      n_hidden_layers: 2
    color_activation: sigmoid

system:
  name: neus-system
  loss:
    lambda_sdf_l1: [0, 1., 0.1, 20000]
    # lambda_sdf_l1: [0, 1., 0.01, 20000]
    lambda_rgb_mse: 10.
    lambda_rgb_l1: 0.
    lambda_mask: 0.0
    lambda_eikonal: 0.1
    lambda_curvature: [0, 0, 5.e-1, 5000]
    lambda_sparsity: 0.0
    lambda_distortion: 0.0
    lambda_distortion_bg: 0.0
    lambda_opaque: 0.0
    sparsity_scale: 1.
  optimizer:
    name: AdamW
    args:
      lr: 0.01
      betas: [0.9, 0.99]
      eps: 1.e-15
    params:
      geometry:
        lr: 0.01
      texture:
        lr: 0.01
      geometry_bg:
        lr: 0.01
      texture_bg:
        lr: 0.01
      variance:
        lr: 0.001
  warmup_steps: 500
  scheduler:
    name: SequentialLR
    interval: step
    milestones:
      - ${system.warmup_steps}
    schedulers:
      - name: LinearLR # linear warm-up in the first system.warmup_steps steps
        args:
          start_factor: 0.01
          end_factor: 1.0
          total_iters: ${system.warmup_steps}
      - name: ExponentialLR
        args:
          gamma: ${calc_exp_lr_decay_rate:0.1,${sub:${trainer.max_steps},${system.warmup_steps}}}

checkpoint:
  save_top_k: -1
  every_n_train_steps: ${trainer.max_steps}

export:
  chunk_size: 2097152
  export_vertex_color: True

trainer:
  max_steps: 20000
  log_every_n_steps: 100
  num_sanity_val_steps: 0
  val_check_interval: 5000
  limit_train_batches: 1.0
  limit_val_batches: 2
  enable_progress_bar: true
  precision: 16

hugoycj avatar Nov 08 '23 17:11 hugoycj