simba-uw-tf-dev 4.6.1__py3-none-any.whl → 4.6.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simba/SimBA.py +2 -2
- simba/assets/icons/frames_2.png +0 -0
- simba/data_processors/agg_clf_counter_mp.py +52 -53
- simba/data_processors/cuda/image.py +3 -1
- simba/data_processors/cue_light_analyzer.py +5 -9
- simba/mixins/geometry_mixin.py +14 -28
- simba/mixins/image_mixin.py +10 -14
- simba/mixins/train_model_mixin.py +2 -2
- simba/plotting/ROI_feature_visualizer_mp.py +3 -5
- simba/plotting/clf_validator_mp.py +4 -5
- simba/plotting/cue_light_visualizer.py +6 -7
- simba/plotting/directing_animals_visualizer_mp.py +2 -3
- simba/plotting/distance_plotter_mp.py +378 -378
- simba/plotting/frame_mergerer_ffmpeg.py +137 -137
- simba/plotting/gantt_creator_mp.py +59 -31
- simba/plotting/geometry_plotter.py +270 -272
- simba/plotting/heat_mapper_clf_mp.py +2 -4
- simba/plotting/heat_mapper_location_mp.py +2 -2
- simba/plotting/light_dark_box_plotter.py +2 -2
- simba/plotting/path_plotter_mp.py +26 -29
- simba/plotting/plot_clf_results_mp.py +455 -454
- simba/plotting/pose_plotter_mp.py +27 -32
- simba/plotting/probability_plot_creator_mp.py +288 -288
- simba/plotting/roi_plotter_mp.py +29 -30
- simba/plotting/single_run_model_validation_video_mp.py +427 -427
- simba/plotting/spontaneous_alternation_plotter.py +2 -3
- simba/plotting/yolo_pose_track_visualizer.py +31 -27
- simba/plotting/yolo_pose_visualizer.py +32 -34
- simba/plotting/yolo_seg_visualizer.py +2 -3
- simba/roi_tools/roi_aggregate_stats_mp.py +4 -3
- simba/roi_tools/roi_clf_calculator_mp.py +3 -3
- simba/sandbox/cuda/egocentric_rotator.py +374 -0
- simba/sandbox/get_cpu_pool.py +5 -0
- simba/ui/pop_ups/clf_add_remove_print_pop_up.py +3 -1
- simba/ui/pop_ups/egocentric_alignment_pop_up.py +6 -3
- simba/ui/pop_ups/multiple_videos_to_frames_popup.py +10 -11
- simba/ui/pop_ups/single_video_to_frames_popup.py +10 -10
- simba/ui/pop_ups/video_processing_pop_up.py +63 -63
- simba/ui/tkinter_functions.py +7 -1
- simba/utils/data.py +89 -12
- simba/utils/enums.py +1 -0
- simba/utils/printing.py +9 -8
- simba/utils/read_write.py +3726 -3721
- simba/video_processors/clahe_ui.py +65 -22
- simba/video_processors/egocentric_video_rotator.py +6 -9
- simba/video_processors/video_processing.py +21 -10
- simba/video_processors/videos_to_frames.py +3 -2
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/METADATA +1 -1
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/RECORD +53 -50
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/LICENSE +0 -0
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/WHEEL +0 -0
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/entry_points.txt +0 -0
- {simba_uw_tf_dev-4.6.1.dist-info → simba_uw_tf_dev-4.6.3.dist-info}/top_level.txt +0 -0
simba/plotting/roi_plotter_mp.py
CHANGED
|
@@ -24,7 +24,7 @@ from simba.utils.checks import (check_file_exist_and_readable, check_float,
|
|
|
24
24
|
check_valid_boolean, check_valid_lst,
|
|
25
25
|
check_video_and_data_frm_count_align)
|
|
26
26
|
from simba.utils.data import (create_color_palettes, detect_bouts,
|
|
27
|
-
slice_roi_dict_for_video)
|
|
27
|
+
slice_roi_dict_for_video, terminate_cpu_pool, get_cpu_pool)
|
|
28
28
|
from simba.utils.enums import ROI_SETTINGS, Formats, Keys, Paths, TextOptions
|
|
29
29
|
from simba.utils.errors import (BodypartColumnNotFoundError, DuplicationError,
|
|
30
30
|
NoFilesFoundError, NoROIDataError,
|
|
@@ -32,7 +32,7 @@ from simba.utils.errors import (BodypartColumnNotFoundError, DuplicationError,
|
|
|
32
32
|
from simba.utils.printing import SimbaTimer, stdout_success
|
|
33
33
|
from simba.utils.read_write import (concatenate_videos_in_folder,
|
|
34
34
|
find_core_cnt, get_video_meta_data,
|
|
35
|
-
read_df)
|
|
35
|
+
read_df, get_current_time)
|
|
36
36
|
from simba.utils.warnings import (DuplicateNamesWarning, FrameRangeWarning,
|
|
37
37
|
GPUToolsWarning)
|
|
38
38
|
|
|
@@ -117,7 +117,7 @@ def _roi_plotter_mp(data: Tuple[int, pd.DataFrame],
|
|
|
117
117
|
|
|
118
118
|
writer.write(img)
|
|
119
119
|
current_frm += 1
|
|
120
|
-
if verbose: print(f"Multi-processing video frame {current_frm}
|
|
120
|
+
if verbose: print(f"[{get_current_time()}] Multi-processing video frame {current_frm}/{video_meta_data['frame_count']} (core batch: {group_cnt}, video: {video_meta_data['video_name']})...")
|
|
121
121
|
else:
|
|
122
122
|
FrameRangeWarning(msg=f'Could not read frame {current_frm} in video {video_meta_data["video_name"]}', source=_roi_plotter_mp.__name__)
|
|
123
123
|
break
|
|
@@ -363,34 +363,33 @@ class ROIPlotMultiprocess(ConfigReader):
|
|
|
363
363
|
del self.data_df
|
|
364
364
|
del self.roi_analyzer.logger
|
|
365
365
|
if self.verbose: print(f"Creating ROI images, multiprocessing (chunksize: {self.multiprocess_chunksize}, cores: {self.core_cnt})...")
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
366
|
+
self.pool = get_cpu_pool(core_cnt=self.core_cnt, maxtasksperchild=self.maxtasksperchild, source=self.__class__.__name__, verbose=True)
|
|
367
|
+
constants = functools.partial(_roi_plotter_mp,
|
|
368
|
+
loc_dict=self.loc_dict,
|
|
369
|
+
font_size=self.font_size,
|
|
370
|
+
circle_sizes=self.circle_sizes,
|
|
371
|
+
save_temp_directory=self.temp_folder,
|
|
372
|
+
body_part_dict=self.bp_dict,
|
|
373
|
+
input_video_path=self.video_path,
|
|
374
|
+
roi_dfs_dict=self.sliced_roi_dict,
|
|
375
|
+
roi_dict = self.roi_dict_,
|
|
376
|
+
video_shape_names=self.shape_names,
|
|
377
|
+
bp_colors=self.color_lst,
|
|
378
|
+
show_animal_name=self.show_animal_name,
|
|
379
|
+
show_pose=self.show_pose,
|
|
380
|
+
animal_ids=self.animal_names,
|
|
381
|
+
threshold=self.threshold,
|
|
382
|
+
outside_roi=self.outside_roi,
|
|
383
|
+
verbose=self.verbose,
|
|
384
|
+
border_bg_clr=self.border_bg_clr,
|
|
385
|
+
animal_bp_dict=self.animal_bp_dict,
|
|
386
|
+
show_bbox=self.show_bbox)
|
|
387
|
+
|
|
388
|
+
for cnt, batch_cnt in enumerate(self.pool.imap(constants, data, chunksize=self.multiprocess_chunksize)):
|
|
389
|
+
print(f'Image batch {batch_cnt+1} / {self.core_cnt} complete...')
|
|
390
390
|
print(f"Joining {self.video_name} multi-processed ROI video...")
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
pool.join()
|
|
391
|
+
concatenate_videos_in_folder(in_folder=self.temp_folder, save_path=self.save_path, video_format="mp4", remove_splits=True, gpu=self.gpu)
|
|
392
|
+
terminate_cpu_pool(pool=self.pool, force=False, source=self.__class__.__name__)
|
|
394
393
|
video_timer.stop_timer()
|
|
395
394
|
stdout_success(msg=f"Video {self.video_name} created. ROI video saved at {self.save_path}", elapsed_time=video_timer.elapsed_time_str, source=self.__class__.__name__, )
|
|
396
395
|
|