4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-10 18:17:31 +08:00

Fix "mutable default" error in render.py (#2825)

This fixes 

```
ValueError: mutable default <class 'nerfstudio.data.scene_box.OrientedBox'> for field obb is not allowed: use default_factory
```
This commit is contained in:
Piotr Sokólski 2024-01-25 23:04:14 +00:00 committed by GitHub
parent f2f4bf55b2
commit 67b1005784
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -364,7 +364,7 @@ class CropData:
background_color: Float[Tensor, "3"] = torch.Tensor([0.0, 0.0, 0.0])
"""background color"""
obb: OrientedBox = OrientedBox(R=torch.eye(3), T=torch.zeros(3), S=torch.ones(3) * 2)
obb: OrientedBox = field(default_factory=lambda: OrientedBox(R=torch.eye(3), T=torch.zeros(3), S=torch.ones(3) * 2))
"""Oriented box representing the crop region"""
# properties for backwards-compatibility interface