Skip to content

Commit

Permalink
fix RUF009
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Oct 25, 2024
1 parent fdd7b35 commit 1d0f39d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions happypose/pose_estimators/megapose/evaluation/eval_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""

# Standard Library
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import List, Optional

# MegaPose
Expand Down Expand Up @@ -59,7 +59,7 @@ class EvalConfig:
ds_name: str = "ycbv.bop19"

# Inference
inference: InferenceConfig = InferenceConfig() # noqa RUF009
inference: InferenceConfig = field(default_factory=InferenceConfig)

# Run management
result_id: Optional[str] = None
Expand All @@ -75,7 +75,7 @@ class EvalConfig:

# Infos
global_batch_size: Optional[int] = None
hardware: HardwareConfig = HardwareConfig() # noqa RUF009
hardware: HardwareConfig = field(default_factory=HardwareConfig)

# Debug
debug: bool = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,4 @@ class TrainingConfig(omegaconf.dictconfig.DictConfig):

# Infos
global_batch_size: Optional[int] = None
hardware: HardwareConfig = HardwareConfig() # noqa: RUF009
hardware: HardwareConfig = field(default_factory=HardwareConfig)
10 changes: 7 additions & 3 deletions happypose/toolbox/renderer/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""

# Standard Library
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Callable, Optional, Tuple

# Third Party
Expand All @@ -41,6 +41,10 @@
)


def default_transform() -> Transform:
return Transform((0.0, 0.0, 0.0, 1.0), (0.0, 0.0, 0.0))


@dataclass
class BatchRenderOutput:
"""
Expand Down Expand Up @@ -92,7 +96,7 @@ class CameraRenderingData:
class Panda3dCameraData:
K: np.ndarray
resolution: Tuple[int, int]
TWC: Transform = Transform((0.0, 0.0, 0.0, 1.0), (0.0, 0.0, 0.0)) # noqa: RUF009
TWC: Transform = field(default_factory=default_transform)
z_near: float = 0.1
z_far: float = 10
node_name: str = "camera"
Expand Down Expand Up @@ -153,7 +157,7 @@ class Panda3dLightData:
@dataclass
class Panda3dObjectData:
label: str
TWO: Transform = Transform((0.0, 0.0, 0.0, 1.0), (0.0, 0.0, 0.0)) # noqa: RUF009
TWO: Transform = field(default_factory=default_transform)
color: Optional[RgbaColor] = None
material: Optional[p3d.core.Material] = None
remove_mesh_material: bool = False
Expand Down

0 comments on commit 1d0f39d

Please sign in to comment.