Skip to content

Commit

Permalink
ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin de La Gorce committed Oct 23, 2024
1 parent 4714c11 commit eb62bcb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions deodr/examples/depth_image_hand_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from deodr import ColoredTriMesh
from deodr.mesh_fitter import MeshDepthFitter
from deodr.pytorch import MeshDepthFitter as PytorchMeshDepthFitter

# from deodr.tensorflow import MeshDepthFitter as TensorFlowMeshDepthFitter


Expand Down
4 changes: 2 additions & 2 deletions deodr/examples/eigen_faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def fun(points_deformed: np.ndarray, pca_coefs: np.ndarray) -> Tuple[float, Dict
for niter in range(nb_iter):
energy, grads = fun(**variables)
print(f"iter{niter} E={energy}")
for name in variables:
variables[name] = variables[name] - lambdas[name] * grads[name]
for name, variable in variables.items():
variables[name] = variable - lambdas[name] * grads[name]

variables["points_deformed"][on_border] = points[on_border]

Expand Down
1 change: 1 addition & 0 deletions deodr/examples/rgb_image_hand_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from deodr.mesh_fitter import MeshRGBFitterWithPose
from deodr.meshlab_io import export_meshlab
from deodr.pytorch import MeshRGBFitterWithPose as PyTorchMeshRGBFitterWithPose

# from deodr.tensorflow import (
# MeshRGBFitterWithPose as TensorflowTorchMeshRGBFitterWithPose,
# )
Expand Down
2 changes: 2 additions & 0 deletions deodr/opengl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Module to render deodr scenes using OpenGL using moderngl or pyrender."""

__all__ = ["moderngl", "pyrender"]

from deodr.opengl import moderngl, pyrender
5 changes: 4 additions & 1 deletion deodr/tensorflow/differentiable_renderer_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
from .. import differentiable_renderer_cython # type: ignore
from ..differentiable_renderer import Camera, Scene3D

raise NotImplementedError("Tensorflow support has been dropped starting from version 0.2.3 until tensorflow-intel support numpy 2.0")
raise NotImplementedError(
"Tensorflow support has been dropped starting from version 0.2.3 until tensorflow-intel support numpy 2.0"
)


class CameraTensorflow(Camera):
"""Tensorflow implementation of the camera class."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_depth_image_hand_fitting.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Test using depth image hand fitting."""

import numpy as np
import pytest

from deodr.examples.depth_image_hand_fitting import run
import pytest


def test_depth_image_hand_fitting_pytorch() -> None:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_rgb_image_hand_fitting.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Test using rgb_image hand fitting."""

import numpy as np

import pytest

from deodr.examples.rgb_image_hand_fitting import run
import pytest


def test_rgb_image_hand_fitting_pytorch() -> None:
Expand Down

0 comments on commit eb62bcb

Please sign in to comment.