Skip to content

Commit

Permalink
shallow copy instead of deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
ralwing committed Oct 30, 2024
1 parent f35dae9 commit c7d6a50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from perception_eval.common.transform import TransformDict
from perception_eval.evaluation import DynamicObjectWithPerceptionResult
from perception_eval.evaluation.matching import MatchingMode

from copy import copy

def filter_object_results(
object_results: List[DynamicObjectWithPerceptionResult],
Expand Down Expand Up @@ -123,7 +123,7 @@ def filter_object_results(
is_target = False

if is_target:
filtered_object_results.append(object_result)
filtered_object_results.append(copy(object_result))

return filtered_object_results

Expand Down Expand Up @@ -198,7 +198,7 @@ def filter_objects(
transforms=transforms,
)
if is_target:
filtered_objects.append(object_)
filtered_objects.append(copy(object_))
return filtered_objects


Expand Down
4 changes: 2 additions & 2 deletions perception_eval/perception_eval/tool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from __future__ import annotations

from copy import deepcopy
from copy import deepcopy, copy
from enum import Enum
from typing import Any
from typing import Dict
Expand Down Expand Up @@ -475,7 +475,7 @@ def filter_frame_by_distance(
Returns:
PerceptionFrameResult: Filtered frame results.
"""
ret_frame = deepcopy(frame)
ret_frame = copy(frame)

if min_distance is not None:
min_distance_list = [min_distance] * len(ret_frame.target_labels)
Expand Down

0 comments on commit c7d6a50

Please sign in to comment.