nerfstudio icon indicating copy to clipboard operation
nerfstudio copied to clipboard

nerfacto: Weird circular crops and ripples (when using no scene contraction and no render crop)

Open f-dy opened this issue 2 years ago • 11 comments

Describe the bug When using no scene contraction, I get weird empty discs (no rgb, no accumulation, no depth) in renders, unless I enable "crop viewport" or enable scene contraction. This happens even if the camera is inside the crop box. Those are always perfect discs in 3D (ellipses in 2D), which are aligned and centered on the 3 axes. crop may happen inside or outside the disc (see screenshots)

Also ripples appear in normals when not cropping (see images in comment below)

No issue with tensorf.

To Reproduce Steps to reproduce the behavior:

dataset="blender/lego"
model=nerfacto
model_opts=(--pipeline.model.predict-normals True) # for mesh extraction
model_opts+=(--experiment-name "${dataset}")
viewer_opts=(--vis viewer --viewer.websocket-port=7007)
data_opts=(blender-data --data data/"${dataset}")

# Disable camera optimization
model_opts+=(--pipeline.datamanager.camera-optimizer.mode off)
# For white-background images
model_opts+=(--pipeline.model.background-color white)
model_opts+=(--pipeline.model.proposal-initial-sampler uniform)
#model_opts+=(--pipeline.model.near-plane 2. --pipeline.model.far-plane 6.)
# All images in a 360 have the same exposure etc.:
model_opts+=(--pipeline.model.use-average-appearance-embedding False)
# Distortion loss from mipnerf360, prevents floaters:
model_opts+=(--pipeline.model.distortion-loss-mult 0)
# Disable scene contraction,since the scene is bounded:
model_opts+=(--pipeline.model.disable-scene-contraction True)

# Train with blender lego dataset:
timestamp=$(date "+%Y-%m-%d_%H%M%S")
ns-train "${model}" "${model_opts[@]}" --timestamp "${timestamp}" "${viewer_opts[@]}" "${data_opts[@]}"
  • launch training
  • move around until the discs appear. They often appear when moving close.
  • all the maps have the same holes (depth, accumulation, rgb)
  • all holes disappear when cropping.

Expected behavior no holes

Screenshots without "crop viewport": image with crop viewport: image

without crop: image with crop: image

you can get two discs if you look along a diagonal: image

or even three: image with crop: image

 nvidia-smi
Wed Jun 21 23:56:30 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.12    Driver Version: 525.85.12    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla V100-SXM2...  On   | 00000000:00:1E.0 Off |                    0 |
| N/A   42C    P0    26W / 300W |      0MiB / 16384MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

f-dy avatar Jun 21 '23 23:06 f-dy

I think there's more. Here's a render of the pred_normals without cropping. Notice the ripples. image Same with crop viewport, I get much less ripples: image Looks like the no-crop render path has an issue

f-dy avatar Jun 21 '23 23:06 f-dy

I would tend to think that _intersect_with_sphere is the culprid, but the math looks ok

f-dy avatar Jun 22 '23 00:06 f-dy

Hi @f-dy , have you had any success with Nerfacto on the object-centric datasets, without contraction, since posting?

gafniguy avatar Aug 07 '23 16:08 gafniguy

nope

f-dy avatar Aug 09 '23 15:08 f-dy

@f-dy I am having similar problem. For example Splatfacto renders images perfectly. However, when I train nerfacto it fails to render any guidance? @tancik , @jb-ye @jkulhanek

Left-> Splatfacto Right-> Nerfacto

This is my ns-train run_command(f"ns-train nerfacto " f"--data {SCENE_DIR} " f"--vis viewer+tensorboard " f"--max-num-iterations 30000 " f"--pipeline.model.background_color 'random' " f"--pipeline.model.disable-scene-contraction 'True' " f"--pipeline.model.camera-optimizer.mode off " f"--steps-per-eval-image 100000000000000 " f"--steps-per-eval-batch 100000000000000 " f"--steps-per-eval-all-images 60000 " f"--output-dir {OUTPUT_DIR} "

Image

engrmusawarali avatar Jul 13 '25 21:07 engrmusawarali

@tancik , @jb-ye @jkulhanek

engrmusawarali avatar Jul 14 '25 12:07 engrmusawarali

I am also having major issues with object-centric dataset (images without any background features), even when ground truth COLMAP data is available. I've been working hard to isolate the cause of the issue, but no success. Does someone have any starting points or tips? Looks like this has been a long-standing issue

ncan33 avatar Jul 14 '25 22:07 ncan33

@ncan33 this works for some objects but for some it does not work. There is something wrong here.

@tancik @jb-ye @jkulhanek kindly help on this.

engrmusawarali avatar Jul 15 '25 12:07 engrmusawarali

@ncan33 for me it works for alot of objects, for few it does not work.

You could add --pipeline.model.disable-scene-contraction True, if you are not adding already

engrmusawarali avatar Jul 21 '25 12:07 engrmusawarali

Likewise here, works for all of my objects if the pose estimation is correct. For me, this made all the difference: --pipeline.model.background_color "random"

ncan33 avatar Jul 25 '25 00:07 ncan33

I think think this pipeline.model.background_color "random" is suggested practice for alpha transparency carving. Yet, after this some issues happen.

engrmusawarali avatar Jul 25 '25 07:07 engrmusawarali