From 0724080d614a21ac825702a07927ec15bc352f23 Mon Sep 17 00:00:00 2001 From: Alex Liberzon Date: Sun, 22 Dec 2024 23:01:38 +0200 Subject: [PATCH] fixed names of _targets --- pyptv/ptv.py | 11 ++++++----- pyptv/pyptv_gui.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyptv/ptv.py b/pyptv/ptv.py index 79c6266..d5f7c9f 100644 --- a/pyptv/ptv.py +++ b/pyptv/ptv.py @@ -137,7 +137,9 @@ def py_correspondences_proc_c(exp): # Save targets only after they've been modified: for i_cam in range(exp.n_cams): - exp.detections[i_cam].write(exp.spar.get_img_base_name(i_cam), frame) + base_name = exp.spar.get_img_base_name(i_cam).decode() + filename = base_name.split('%')[0] + base_name.split('d')[-1] + exp.detections[i_cam].write(filename.encode(), frame) print("Frame " + str(frame) + " had " + repr([s.shape[1] for s in sorted_pos]) + " correspondences.") @@ -284,10 +286,9 @@ def py_sequence_loop(exp): # Save targets only after they've been modified: # this is a workaround of the proper way to construct _targets name for i_cam in range(n_cams): - detections[i_cam].write( - spar.get_img_base_name(i_cam), - frame - ) + base_name = spar.get_img_base_name(i_cam).decode() + filename = base_name.split('%')[0] + base_name.split('d')[-1] + detections[i_cam].write(filename.encode(), frame) print("Frame " + str(frame) + " had " + repr([s.shape[1] for s in sorted_pos]) + " correspondences.") diff --git a/pyptv/pyptv_gui.py b/pyptv/pyptv_gui.py index e88ca1b..6154546 100644 --- a/pyptv/pyptv_gui.py +++ b/pyptv/pyptv_gui.py @@ -1524,7 +1524,7 @@ def main(): # exp_path = software_path.parent / "test_cavity" # exp_path = Path('/home/user/Downloads/one-dot-example/working_folder') # exp_path = Path('/home/user/Downloads/test_crossing_particle') - exp_path = Path('/home/user/Documents/repos/multiplane_example_2') + exp_path = Path('../test_cavity') print(f"Without input, PyPTV fallbacks to a default {exp_path} \n") if not exp_path.is_dir() or not exp_path.exists():