Skip to content

Commit

Permalink
v0.3.12 sort video files by name before concatenation & get precise I…
Browse files Browse the repository at this point in the history
…PI start frame
  • Loading branch information
bartulem committed Aug 31, 2024
1 parent 0daa801 commit b8038d0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# usv-playpen v0.3.11
# usv-playpen v0.3.12

<br>
<div align="center">
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='usv-playpen',
version='0.3.11',
version='0.3.12',
author='@bartulem',
author_email='mimica.bartul@gmail.com',
classifiers=[
Expand Down
6 changes: 3 additions & 3 deletions src/file_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ def concatenate_audio_files(self):

for audio_file_type in self.input_parameter_dict['concatenate_audio_files']['concat_dirs']:

all_audio_files = glob.glob(f"{self.root_directory}{os.sep}audio{os.sep}{audio_file_type}{os.sep}"
f"*.{self.input_parameter_dict['concatenate_audio_files']['audio_format']}")
all_audio_files = sorted(glob.glob(f"{self.root_directory}{os.sep}audio{os.sep}{audio_file_type}{os.sep}"
f"*.{self.input_parameter_dict['concatenate_audio_files']['audio_format']}"))

if len(all_audio_files) > 1:

Expand Down Expand Up @@ -621,7 +621,7 @@ def concatenate_video_files(self):

vid_name = f"{self.input_parameter_dict['concatenate_video_files']['concatenated_video_name']}_{sub_directory.split('.')[-1]}"
vid_extension = self.input_parameter_dict['concatenate_video_files']['video_extension']
all_video_files = glob.glob(f"{current_working_dir}{os.sep}*.{vid_extension}")
all_video_files = sorted(glob.glob(f"{current_working_dir}{os.sep}*.{vid_extension}"))

if len(all_video_files) > 1:

Expand Down
4 changes: 2 additions & 2 deletions src/synchronize_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,11 @@ def find_video_sync_trains(self, camera_fps, total_frame_number):
if even_event_durations.sum() > odd_event_durations.sum():
ipi_durations_frames = even_event_durations - 1
if type(ipi_start_frames) is int:
temp_ipi_start_frames = np.array(significant_events[::2]) + 1
temp_ipi_start_frames = np.array(significant_events[::2]) + 2
else:
ipi_durations_frames = odd_event_durations - 1
if type(ipi_start_frames) is int:
temp_ipi_start_frames = np.array(significant_events[1::2]) + 1
temp_ipi_start_frames = np.array(significant_events[1::2]) + 2

# compute IPI durations in milliseconds
ipi_durations_ms = np.round(ipi_durations_frames * (1000 / camera_fps[sync_cam_idx]))
Expand Down
4 changes: 2 additions & 2 deletions src/usv_playpen_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
my_app_id = 'mycompany.myproduct.subproduct.version'
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(my_app_id)

app_name = 'USV Playpen v0.3.11'
app_name = 'USV Playpen v0.3.12'
experimenter_id = 'bartulem'
cup_directory_name = 'Bartul'
email_list_global = ''
Expand Down Expand Up @@ -451,7 +451,7 @@ def record_two(self):
'display': '2', 'total_mic_number': '24', 'total_device_num': '2',
'used_mics': '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23',
'cpu_priority': 'high',
'cpu_affinity': '5'}
'cpu_affinity': '6'}

row_start_position_label = 5
row_start_position_line_edit = 120
Expand Down

0 comments on commit b8038d0

Please sign in to comment.