Skip to content

Commit df74f48

Browse files
committed
Proto benchmark (WIP)
1 parent e06316b commit df74f48

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/test_unit/test_io/test_load_bboxes.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,3 +744,44 @@ def test_position_numpy_array_from_via_tracks_file(via_file_path):
744744
bboxes_arrays["position_array"], # frames, xy, individuals
745745
np.stack(list_derived_centroids, axis=-1),
746746
)
747+
748+
749+
@pytest.mark.benchmark
750+
@pytest.mark.parametrize(
751+
"via_file_path",
752+
[
753+
pytest.DATA_PATHS.get("VIA_multiple-crabs_5-frames_labels.csv"),
754+
pytest.DATA_PATHS.get("VIA_single-crab_MOCA-crab-1.csv"),
755+
],
756+
)
757+
# @pytest.mark.parametrize("use_frame_numbers_from_file", [True, False])
758+
# small difference
759+
def test_benchmark_from_via_tracks_file(
760+
via_file_path,
761+
use_frame_numbers_from_file,
762+
benchmark,
763+
):
764+
"""Benchmark the loading of a VIA tracks .csv file."""
765+
kwargs = {
766+
"file_path": via_file_path,
767+
"use_frame_numbers_from_file": use_frame_numbers_from_file,
768+
}
769+
benchmark(load_bboxes.from_via_tracks_file, **kwargs)
770+
771+
772+
@pytest.mark.benchmark
773+
@pytest.mark.parametrize(
774+
"via_file_path",
775+
[
776+
pytest.DATA_PATHS.get("VIA_multiple-crabs_5-frames_labels.csv"),
777+
# multiple crabs present in all 5 frames
778+
pytest.DATA_PATHS.get("VIA_single-crab_MOCA-crab-1.csv"),
779+
# single crab present in 35 non-consecutive frames
780+
],
781+
)
782+
def test_benchmark_df_from_via_tracks_file(
783+
via_file_path,
784+
benchmark,
785+
):
786+
"""Benchmark the `_df_from_via_tracks_file` function."""
787+
benchmark(load_bboxes._df_from_via_tracks_file, via_file_path)

0 commit comments

Comments
 (0)