Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
ktro2828 authored and github-actions[bot] committed May 23, 2024
1 parent e9cd756 commit 987c76e
Show file tree
Hide file tree
Showing 38 changed files with 74 additions and 36 deletions.
1 change: 1 addition & 0 deletions perception_eval/perception_eval/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Union

import numpy as np

from perception_eval.common.object2d import DynamicObject2D
from perception_eval.common.object import DynamicObject
from perception_eval.common.point import distance_points
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/perception_eval/common/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
from numpy.typing import NDArray
from nuscenes.nuscenes import NuScenes
from nuscenes.prediction.helper import PredictHelper
from tqdm import tqdm

from perception_eval.common import ObjectType
from perception_eval.common.dataset_utils import _sample_to_frame
from perception_eval.common.dataset_utils import _sample_to_frame_2d
Expand All @@ -37,7 +39,6 @@
from perception_eval.common.transform import TransformDict
from perception_eval.common.transform import TransformDictArgType
from perception_eval.common.transform import TransformKey
from tqdm import tqdm


class FrameGroundTruth:
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/perception_eval/common/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
from typing import Union

import numpy as np
from pyquaternion import Quaternion

from perception_eval.common.object2d import DynamicObject2D
from perception_eval.common.object2d import Roi
from perception_eval.common.object import DynamicObject
from perception_eval.common.object import ObjectState
from perception_eval.common.point import distance_points
from perception_eval.common.point import distance_points_bev
from pyquaternion import Quaternion

# Type aliases
ObjectType = Union[DynamicObject, DynamicObject2D]
Expand Down
5 changes: 3 additions & 2 deletions perception_eval/perception_eval/common/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from typing import Tuple

import numpy as np
from pyquaternion import Quaternion
from shapely.geometry import Polygon

from perception_eval.common.label import Label
from perception_eval.common.point import crop_pointcloud
from perception_eval.common.point import polygon_to_list
Expand All @@ -28,8 +31,6 @@
from perception_eval.common.shape import Shape
from perception_eval.common.shape import ShapeType
from perception_eval.common.transform import TransformDict
from pyquaternion import Quaternion
from shapely.geometry import Polygon


class ObjectState:
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/perception_eval/common/object2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
from typing import Tuple

import numpy as np
from shapely.geometry import Polygon

from perception_eval.common.label import Label
from perception_eval.common.object import ObjectState
from perception_eval.common.schema import FrameID
from perception_eval.common.schema import Visibility
from perception_eval.common.transform import TransformDict
from shapely.geometry import Polygon


class Roi:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
from typing import Optional
from typing import Tuple

from shapely.geometry import Polygon

from perception_eval.common import distance_objects
from perception_eval.common import distance_points_bev
from perception_eval.common import ObjectType
from perception_eval.common.object import DynamicObject
from perception_eval.common.point import get_point_left_right
from perception_eval.common.point import polygon_to_list
from shapely.geometry import Polygon


class MatchingMode(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import matplotlib.pyplot as plt
import numpy as np

from perception_eval.common.label import LabelType
from perception_eval.common.threshold import get_label_threshold
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from math import pi

import numpy as np

from perception_eval.common.schema import FrameID
from perception_eval.common.transform import HomogeneousMatrix
from perception_eval.common.transform import TransformDict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Tuple

import numpy as np

from perception_eval.common import distance_objects
from perception_eval.common import distance_objects_bev
from perception_eval.common import DynamicObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Tuple

import numpy as np

from perception_eval.common.object import DynamicObject
from perception_eval.common.point import crop_pointcloud
from perception_eval.evaluation.sensing.sensing_frame_config import SensingFrameConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Optional

import numpy as np

from perception_eval.common.object import DynamicObject
from perception_eval.common.schema import Visibility

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Tuple

import numpy as np

from perception_eval.common.dataset import FrameGroundTruth
from perception_eval.common.object import DynamicObject
from perception_eval.common.point import crop_pointcloud
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

import numpy as np
import pandas as pd
import yaml

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.object2d import DynamicObject2D
from perception_eval.common.status import MatchingStatus
from perception_eval.config import PerceptionEvaluationConfig
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
import yaml

from .perception_analyzer_base import PerceptionAnalyzerBase
from .utils import PlotAxes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@

import numpy as np
import pandas as pd
import yaml

from perception_eval.common.object import DynamicObject
from perception_eval.common.schema import FrameID
from perception_eval.common.status import MatchingStatus
from perception_eval.common.transform import TransformDict
from perception_eval.common.transform import TransformKey
from perception_eval.config import PerceptionEvaluationConfig
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
import yaml

from .perception_analyzer_base import PerceptionAnalyzerBase
from .utils import extract_area_results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@

import numpy as np
import pandas as pd
import yaml

from perception_eval.common.status import MatchingStatus
from perception_eval.config import PerceptionEvaluationConfig
import yaml

from .perception_analyzer3d import PerceptionAnalyzer3D

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import pandas as pd
from tqdm import tqdm

from perception_eval.common.label import LabelType
from perception_eval.common.object import DynamicObject
from perception_eval.common.schema import FrameID
Expand All @@ -48,7 +50,6 @@
from perception_eval.evaluation.matching.objects_filter import divide_objects
from perception_eval.evaluation.matching.objects_filter import divide_objects_to_num
from perception_eval.evaluation.metrics.metrics import MetricsScore
from tqdm import tqdm

from .utils import get_metrics_info
from .utils import PlotAxes
Expand Down
1 change: 1 addition & 0 deletions perception_eval/perception_eval/tool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

from perception_eval.common.object import DynamicObject
from perception_eval.common.schema import FrameID
from perception_eval.common.transform import TransformDict
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/perception_eval/util/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import numpy as np
from numpy.typing import ArrayLike
from pyquaternion.quaternion import Quaternion

from perception_eval.common.dataset import FrameGroundTruth
from perception_eval.common.label import AutowareLabel
from perception_eval.common.label import Label
Expand All @@ -32,7 +34,6 @@
from perception_eval.common.schema import FrameID
from perception_eval.common.shape import Shape
from perception_eval.common.transform import TransformDict
from pyquaternion.quaternion import Quaternion


def format_class_for_log(
Expand Down
7 changes: 4 additions & 3 deletions perception_eval/perception_eval/visualization/eda_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from plotly import graph_objects as go
from plotly.graph_objs import Figure
from plotly.subplots import make_subplots

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.label import LabelConverter
from perception_eval.common.label import LabelType
Expand All @@ -31,9 +35,6 @@
from perception_eval.evaluation.matching.objects_filter import divide_tp_fp_objects
from perception_eval.evaluation.matching.objects_filter import filter_object_results
from perception_eval.evaluation.matching.objects_filter import get_fn_objects
from plotly import graph_objects as go
from plotly.graph_objs import Figure
from plotly.subplots import make_subplots

try:
import pandas_profiling as pdp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
from matplotlib.patches import Rectangle
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from PIL.Image import Image as PILImage
from tqdm import tqdm
import yaml

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.label import AutowareLabel
from perception_eval.common.label import TrafficLightLabel
Expand All @@ -36,10 +41,6 @@
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
from perception_eval.evaluation import PerceptionFrameResult
from perception_eval.visualization.color import ColorMap
from PIL import Image
from PIL.Image import Image as PILImage
from tqdm import tqdm
import yaml


class PerceptionVisualizer2D:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
from matplotlib.transforms import Affine2D
import numpy as np
from numpy.typing import NDArray
from PIL import Image
from PIL.Image import Image as PILImage
from pyquaternion import Quaternion
from tqdm import tqdm
import yaml

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.object import DynamicObject
from perception_eval.common.schema import FrameID
Expand All @@ -37,11 +43,6 @@
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
from perception_eval.evaluation import PerceptionFrameResult
from perception_eval.visualization.color import ColorMap
from PIL import Image
from PIL.Image import Image as PILImage
from pyquaternion import Quaternion
from tqdm import tqdm
import yaml


class PerceptionVisualizer3D:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import matplotlib.pyplot as plt
import numpy as np

from perception_eval.tool import PerceptionFieldXY


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
import matplotlib.pyplot as plt
from matplotlib.transforms import Affine2D
import numpy as np
from perception_eval.common.object import DynamicObject
from perception_eval.config import SensingEvaluationConfig
from perception_eval.evaluation import DynamicObjectWithSensingResult
from perception_eval.evaluation import SensingFrameResult
from perception_eval.visualization.color import ColorMap
from PIL import Image
from PIL.Image import Image as PILImage
from pyquaternion import Quaternion
from tqdm import tqdm
import yaml

from perception_eval.common.object import DynamicObject
from perception_eval.config import SensingEvaluationConfig
from perception_eval.evaluation import DynamicObjectWithSensingResult
from perception_eval.evaluation import SensingFrameResult
from perception_eval.visualization.color import ColorMap


class SensingVisualizer:
"""The class to visualize sensing results in BEV space.
Expand Down
5 changes: 3 additions & 2 deletions perception_eval/test/common/test_geometry.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import numpy as np
from pyquaternion import Quaternion
import pytest

from perception_eval.common.geometry import interpolate_homogeneous_matrix
from perception_eval.common.geometry import interpolate_list
from perception_eval.common.geometry import interpolate_quaternion
from pyquaternion import Quaternion
import pytest


def test_interpolate_homogeneous_matrix():
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/test/common/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
from typing import List
from typing import Tuple

import pytest

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.label import AutowareLabel
from perception_eval.common.label import LabelConverter
from perception_eval.common.label import LabelType
from perception_eval.common.label import TrafficLightLabel
import pytest

autoware_non_merged_pairs = [
(AutowareLabel.BICYCLE, "bicycle"),
Expand Down
3 changes: 2 additions & 1 deletion perception_eval/test/common/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@
import unittest

import numpy as np
from shapely.geometry import Polygon

from perception_eval.common import distance_objects
from perception_eval.common import distance_objects_bev
from perception_eval.common.object import DynamicObject
from perception_eval.util.debug import get_objects_with_difference
from shapely.geometry import Polygon


class TestObject(unittest.TestCase):
Expand Down
1 change: 1 addition & 0 deletions perception_eval/test/common/test_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import unittest

import numpy as np

from perception_eval.common.point import crop_pointcloud
from perception_eval.common.point import distance_points
from perception_eval.common.point import distance_points_bev
Expand Down
1 change: 1 addition & 0 deletions perception_eval/test/common/test_transform.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from perception_eval.common.schema import FrameID
from perception_eval.common.transform import HomogeneousMatrix
from perception_eval.common.transform import TransformDict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import unittest

import numpy as np

from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.label import AutowareLabel
from perception_eval.common.label import Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import unittest

import numpy as np

from perception_eval.common import DynamicObject
from perception_eval.common.evaluation_task import EvaluationTask
from perception_eval.common.label import AutowareLabel
Expand Down
Loading

0 comments on commit 987c76e

Please sign in to comment.