From 9f6088da0d7b6d13dd8d44482d7a21ceca84cc77 Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Tue, 21 Oct 2025 11:20:56 -0400 Subject: [PATCH 1/3] Skip out_file writing if out_file is None --- .../pytorch_inference/fecal_boli.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mouse_tracking/pytorch_inference/fecal_boli.py b/src/mouse_tracking/pytorch_inference/fecal_boli.py index 0b22ed1f..a89e5661 100644 --- a/src/mouse_tracking/pytorch_inference/fecal_boli.py +++ b/src/mouse_tracking/pytorch_inference/fecal_boli.py @@ -163,12 +163,13 @@ def infer_fecal_boli_pytorch(args): ) final_fecal_boli_detections = fecal_boli_results.get_results() final_fecal_boli_counts = fecal_boli_counts.get_results() - write_fecal_boli_data( - args.out_file, - final_fecal_boli_detections, - final_fecal_boli_counts, - args.frame_interval, - model_definition["model-name"], - model_definition["model-checkpoint"], - ) + if args.aout_file is not None: + write_fecal_boli_data( + args.out_file, + final_fecal_boli_detections, + final_fecal_boli_counts, + args.frame_interval, + model_definition["model-name"], + model_definition["model-checkpoint"], + ) performance_accumulator.print_performance() From a7c49a7aa4eb9b9174d404329d969d1b397c3b93 Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Tue, 21 Oct 2025 11:22:04 -0400 Subject: [PATCH 2/3] Skip out_file writing if out_file is None --- src/mouse_tracking/tfs_inference/arena_corners.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mouse_tracking/tfs_inference/arena_corners.py b/src/mouse_tracking/tfs_inference/arena_corners.py index 8314d2ad..cc9c98b3 100644 --- a/src/mouse_tracking/tfs_inference/arena_corners.py +++ b/src/mouse_tracking/tfs_inference/arena_corners.py @@ -113,7 +113,8 @@ def infer_arena_corner_model(args): model_definition["model-checkpoint"], ) px_per_cm = get_px_per_cm(filtered_corners) - write_pixel_per_cm_attr(args.out_file, px_per_cm, "corner_detection") + if args.out_file is not None: + write_pixel_per_cm_attr(args.out_file, px_per_cm, "corner_detection") if args.out_image is not None: render = plot_keypoints(filtered_corners, frame) imageio.imwrite(args.out_image, render) From 5872ccb6333bb2afdb879854c4b2c455022ba3de Mon Sep 17 00:00:00 2001 From: Alexander Berger Date: Tue, 21 Oct 2025 11:23:40 -0400 Subject: [PATCH 3/3] Fix typo 'aout_file' --> 'out_file' --- src/mouse_tracking/pytorch_inference/fecal_boli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mouse_tracking/pytorch_inference/fecal_boli.py b/src/mouse_tracking/pytorch_inference/fecal_boli.py index a89e5661..b169457d 100644 --- a/src/mouse_tracking/pytorch_inference/fecal_boli.py +++ b/src/mouse_tracking/pytorch_inference/fecal_boli.py @@ -163,7 +163,7 @@ def infer_fecal_boli_pytorch(args): ) final_fecal_boli_detections = fecal_boli_results.get_results() final_fecal_boli_counts = fecal_boli_counts.get_results() - if args.aout_file is not None: + if args.out_file is not None: write_fecal_boli_data( args.out_file, final_fecal_boli_detections,