Skip to content

Fix UnboundLocalError: focal_length_y not initialized for SIMPLE_RADIAL#16

Open
Ryanshuai wants to merge 1 commit intodenghilbert:mainfrom
Ryanshuai:fix/simple-radial-bug
Open

Fix UnboundLocalError: focal_length_y not initialized for SIMPLE_RADIAL#16
Ryanshuai wants to merge 1 commit intodenghilbert:mainfrom
Ryanshuai:fix/simple-radial-bug

Conversation

@Ryanshuai
Copy link

Problem

Training fails with UnboundLocalError: local variable 'focal_length_y' referenced before assignment when using SIMPLE_RADIAL camera model from COLMAP.

Solution

Initialize focal_length_y = None before camera model branches in readColmapCameras().

The SIMPLE_RADIAL model uses a single focal length and doesn't define focal_length_y, but the code later references it at line 207. The existing else branch correctly handles this by using focal_length_x as a fallback when focal_length_y is None.

Testing

Tested with COLMAP SIMPLE_RADIAL camera model, training now runs successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant