Skip to content

Commit 7381ffa

Browse files
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent 569d520 commit 7381ffa

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

trackers/dataset/core.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ def get_sequence_info(self, sequence_name: str) -> Dict[str, Any]:
4747
pass
4848

4949
@abc.abstractmethod
50-
def get_frame_iterator(
51-
self, sequence_name: str
52-
) -> Iterator[Dict[str, Any]]:
50+
def get_frame_iterator(self, sequence_name: str) -> Iterator[Dict[str, Any]]:
5351
"""
5452
Returns an iterator over frame information dictionaries for a sequence.
5553
@@ -320,9 +318,7 @@ def get_sequence_info(self, sequence_name: str) -> Dict[str, Any]:
320318
print(f"Error parsing {seq_info_path}: {e}")
321319
return {}
322320

323-
def get_frame_iterator(
324-
self, sequence_name: str
325-
) -> Iterator[Dict[str, Any]]:
321+
def get_frame_iterator(self, sequence_name: str) -> Iterator[Dict[str, Any]]:
326322
"""
327323
Returns an iterator yielding information about each frame in a sequence.
328324

trackers/eval/eval.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ def get_detections(
154154
)
155155

156156
def _process_tracking(
157-
detections: sv.Detections, frame: Optional[np.ndarray], frame_info: Dict[str, Any]
157+
detections: sv.Detections,
158+
frame: Optional[np.ndarray],
159+
frame_info: Dict[str, Any],
158160
) -> sv.Detections:
159161
sequence_name = frame_info.get("sequence_name")
160162
frame_idx = frame_info.get("frame_idx")
@@ -493,7 +495,7 @@ def evaluate_tracks(
493495
print("Warning: No sequences found in the dataset to load tracks for.")
494496
return {"per_sequence": {}, "overall": {}}
495497

496-
tracks = load_tracks_from_disk(tracks_path or ".", sequence_names) # type: ignore
498+
tracks = load_tracks_from_disk(tracks_path or ".", sequence_names) # type: ignore
497499

498500
# Compute metrics for each sequence
499501
results: Dict[str, Dict[str, Any]] = {

trackers/eval/metrics/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from .clear import CLEARMetric
1212
from .count import CountMetric
1313

14-
1514
# --- Available Metrics Registry ---
1615
# Maps metric names (lowercase for consistency) to their class implementation.
1716
# The name() method of the class should ideally return the key used here,
@@ -49,8 +48,8 @@ def get_metric_instance(name: str) -> Optional[TrackingMetric]:
4948
__all__ = [
5049
"AVAILABLE_METRICS",
5150
"PLACEHOLDER_METRIC_NAMES",
52-
"CountMetric",
5351
"CLEARMetric", # Added CLEARMetric to __all__
52+
"CountMetric",
5453
"TrackingMetric",
5554
"get_metric_instance",
5655
"instantiate_metrics", # Added instantiate_metrics to __all__

trackers/eval/metrics/base_tracking_metric.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,3 @@ def aggregate(
107107
aggregated[key] = 0.0 # Or some other default/indicator
108108

109109
return aggregated
110-

trackers/eval/metrics/clear.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ def compute(
158158
A dictionary containing computed CLEAR metric components and final
159159
derived metrics (MOTA, MOTP, etc.) for the sequence.
160160
"""
161-
res: Dict[str, float] = {
162-
field: 0.0 for field in [*self.fields, "MOTP_sum"]
163-
}
161+
res: Dict[str, float] = {field: 0.0 for field in [*self.fields, "MOTP_sum"]}
164162

165163
# --- Input Validation ---
166164
if "frame_idx" not in ground_truth.data:

0 commit comments

Comments
 (0)