Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple camera rigs triggers assertion error in get_camera_ids() #229

Open
bugByteMe opened this issue Apr 25, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@bugByteMe
Copy link

Describe the bug

Cameras are not correctly organized when camera rigs are set more than one, which triggers assertion error.

I have added the following debug code for get_camera_ids() in camera.py

def get_cameras_ids() -> list[tuple]:

    res = []
    col = bpy.data.collections[CAMERA_RIGS_DIRNAME]
    print(col.objects)
    for i, root in enumerate(col.objects):
        print("[root] i = ", i)
        print("       name = ", root.name)
        print("        loc = ", root.location)
        for j, subcam in enumerate(root.children):
            print("  [child] j = ", j)
            print("          name = ", subcam.name)
            print("           loc = ", subcam.location)
            assert subcam.name == camera_name(i, j)
            res.append((i, j))
                       
    return res

and found incorrect camera organization which triggers assertion error. (shown below)

Steps to Reproduce

Override the configs with

camera.spawn_camera_rigs.n_camera_rigs = 4

camera.spawn_camera_rigs.camera_rig_config = [
    {'loc': (0, 0, 0), 'rot_euler': (0, 0, 0)}
]

change monocular_video.gin to:

iterate_scene_tasks.frame_range = [1, 2]
iterate_scene_tasks.view_block_size = 2
iterate_scene_tasks.cam_block_size = 2
iterate_scene_tasks.cam_id_ranges = [4, 1]

Call get_camera_ids() after pose_cameras.
I actually found this bug in rendering stage. But for quicker reproduce, call this function in generate_scene().

    p.run_stage(
        'pose_cameras', 
        lambda: cam_util.configure_cameras(camera_rigs, bbox, scene_preprocessed), 
        use_chance=False
    )
    camera_ids=cam_util.get_cameras_ids()

This will triggers assertion error, with the following debug info I print:

[root] i =  0
       name =  CameraRigs/0
        loc =  <Vector (-51.2120, -26.3052, -15.5964)>
  [child] j =  0
          name =  CameraRigs/0/0
           loc =  <Vector (0.0000, 0.0000, 0.0000)>
[root] i =  1
       name =  CameraRigs/0/0
        loc =  <Vector (0.0000, 0.0000, 0.0000)>
[root] i =  2
       name =  CameraRigs/1
        loc =  <Vector (70.1523, 20.7909, -15.3666)>
  [child] j =  0
          name =  CameraRigs/1/0
           loc =  <Vector (0.0000, 0.0000, 0.0000)>

This seems not a correct organization of a camera. Camera names are disordered and some camera rig has no children.

What version of the code were you using?

Tell us the commit & commit hash from git log

commit 18be26c9b4a7b375442d23569b737d8e2169e372 (HEAD -> main, origin/main, origin/HEAD)
Author: Zeyu Ma <31351547+mazeyu@users.noreply.github.com>
Date:   Tue Apr 2 11:16:34 2024 -0700

    Bugfix v1.2.5 - Terrain bugfix for multi-task command; Terrain.bounds and Terrain.populated_bounds parameter
    
    * fix reinitializing terrain
    
    * add bounds and populated_bounds for terrain

What command did you run?

python -m infinigen.datagen.manage_jobs --output_folder /home/guojiarui/gen/under_water_syn_monot2 --num_scenes 1 \
--configs under_water.gin simple.gin base_simple.gin \
--pipeline_configs local_32GB.gin monocular_video.gin \
--pipeline_overrides LocalScheduleHandler.use_gpu=False \
-p compose_scene.max_fish_schools=5 compose_scene.animate_cameras_enabled=False

in which base_simple.gin overrides:

camera.spawn_camera_rigs.n_camera_rigs = 4

camera.spawn_camera_rigs.camera_rig_config = [
    {'loc': (0, 0, 0), 'rot_euler': (0, 0, 0)}
]

monocular_video.gin has been changed to:

iterate_scene_tasks.frame_range = [1, 2]
iterate_scene_tasks.view_block_size = 2
iterate_scene_tasks.cam_block_size = 2
iterate_scene_tasks.cam_id_ranges = [4, 1]

What are your FULL output logs?

Provide the FULL output logs from your command as a txt file.
coarse_error.txt

If this is your first time running Infinigen, what are the full install logs?**

Run pip install -vv -e . > logs.txt 2>&1 and send logs.txt as an attachment.

Not first time.

Platform

  • OS & OS Version: Ubuntu 22.04.4 LTS (GNU/Linux 6.5.0-27-generic x86_64)
  • GPU (?) : Not using GPU
  • GPU Driver Version (?) :
  • RAM (GB): 126

Additional context

Add any other context about the problem here.

@bugByteMe bugByteMe added the bug Something isn't working label Apr 25, 2024
@araistrick
Copy link
Contributor

Hello, apologies for the issue, i will patch it ASAP. In the meantime I believe you can just remove this assert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants