diff --git a/setup.py b/setup.py index 08a55e6bf..609d9fb34 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ # Setup configuration setuptools.setup( name="Simba-UW-tf-dev", - version="2.3.5", + version="2.3.6", author="Simon Nilsson, Jia Jie Choong, Sophia Hwang", author_email="sronilsson@gmail.com", description="Toolkit for computer classification and analysis of behaviors in experimental animals", diff --git a/simba/data_processors/agg_clf_calculator.py b/simba/data_processors/agg_clf_calculator.py index 1e49205cd..2540206d2 100644 --- a/simba/data_processors/agg_clf_calculator.py +++ b/simba/data_processors/agg_clf_calculator.py @@ -235,9 +235,9 @@ def save(self) -> None: ) -# test = AggregateClfCalculator(config_path=r"D:\troubleshooting\mitra\project_folder\project_config.ini", +# test = AggregateClfCalculator(config_path=r"C:\troubleshooting\mitra\project_folder\project_config.ini", # data_measures=["Bout count", "Total event duration (s)", "Mean event bout duration (s)", "Median event bout duration (s)", "First event occurrence (s)", "Mean event bout interval duration (s)", "Median event bout interval duration (s)"], -# classifiers=['lay-on-belly'], +# classifiers=['rearing'], # video_meta_data =['Frame count', "Video length (s)"], # transpose=True) # test.run() diff --git a/simba/data_processors/circling_detector.py b/simba/data_processors/circling_detector.py index f4efe03d5..65f302b56 100644 --- a/simba/data_processors/circling_detector.py +++ b/simba/data_processors/circling_detector.py @@ -27,8 +27,8 @@ class CirclingDetector(ConfigReader): .. important:: - Circling is detected as :underline:`present` when **the circular range of the animal is above the ``circular_range_threshold`` within the preceding ``time_threshold``** AND - **the movement of the animal (defined as the sum of the center movement) is above the ``movement_threshold`` within the preceding ``time_threshold``.** + Circling is detected as `present` when **the circular range of the animal is above the specied circular range threshold within the passed preceding time threshold** AND + **the movement of the animal (defined as the sum of the center movement) is above the specified movement threshold within the passed preceding time threshold.** Circling is detected as :underline:`absent` when not present. @@ -120,8 +120,9 @@ def run(self): agg_results.to_csv(agg_results_path) stdout_success(msg=f'Results saved in {self.save_dir} directory.') - - -# detector = CirclingDetector(data_dir=r'D:\troubleshooting\mitra\project_folder\csv\outlier_corrected_movement_location', config_path=r"D:\troubleshooting\mitra\project_folder\project_config.ini") +# +# +# detector = CirclingDetector(data_dir=r'C:\troubleshooting\mitra\project_folder\csv\outlier_corrected_movement_location', +# config_path=r"C:\troubleshooting\mitra\project_folder\project_config.ini") # detector.run() diff --git a/simba/data_processors/freezing_detector.py b/simba/data_processors/freezing_detector.py index daedd5422..eb2900287 100644 --- a/simba/data_processors/freezing_detector.py +++ b/simba/data_processors/freezing_detector.py @@ -27,10 +27,10 @@ class FreezingDetector(ConfigReader): .. important:: - Freezing is detected as :underline:`present` when ** the velocity (computed from the mean movement of the nape, nose, and tail-base body-parts) falls below - the movement threshold for the duration of the defined time-window or longer. + Freezing is detected as `present` when **the velocity (computed from the mean movement of the nape, nose, and tail-base body-parts) falls below + the movement threshold for the duration (and longer) of the specied time-window. - Freezing is detected as :underline:`absent` when not present. + Freezing is detected as `absent` when not present. :param Union[str, os.PathLike] data_dir: Path to directory containing pose-estimated body-part data in CSV format. :param Union[str, os.PathLike] config_path: Path to SimBA project config file. @@ -90,7 +90,7 @@ def run(self): check_all_file_names_are_represented_in_video_log(video_info_df=self.video_info_df, data_paths=self.data_paths) for file_cnt, file_path in enumerate(self.data_paths): video_name = get_fn_ext(filepath=file_path)[1] - print(f'Analyzing {video_name}...') + print(f'Analyzing {video_name}...({file_cnt+1}/{len(self.data_paths)})') save_file_path = os.path.join(self.save_dir, f'{video_name}.csv') df = read_df(file_path=file_path, file_type='csv').reset_index(drop=True) _, px_per_mm, fps = read_video_info(vid_info_df=self.video_info_df, video_name=video_name) @@ -131,4 +131,4 @@ def run(self): # # FreezingDetector(data_dir=r'C:\troubleshooting\mitra\project_folder\csv\outlier_corrected_movement_location', -# config_path=r"D:\troubleshooting\mitra\project_folder\project_config.ini") \ No newline at end of file +# config_path=r"C:\troubleshooting\mitra\project_folder\project_config.ini") \ No newline at end of file diff --git a/simba/mixins/plotting_mixin.py b/simba/mixins/plotting_mixin.py index f6ed54919..4c397703a 100644 --- a/simba/mixins/plotting_mixin.py +++ b/simba/mixins/plotting_mixin.py @@ -1909,7 +1909,7 @@ def plot_bar_chart(df: pd.DataFrame, check_valid_lst(data=list(df[y]), source=f"{PlottingMixin.plot_bar_chart.__name__} y", valid_dtypes=Formats.NUMERIC_DTYPES.value) fig, ax = plt.subplots(figsize=fig_size) sns.barplot(x=x, y=y, data=df, palette=palette, ax=ax) - ax.set_xticklabels(df[x], rotation=90, fontsize=8) + ax.set_xticklabels(df[x].unique(), rotation=90, fontsize=8) if error is not None: check_str(name=f"{PlottingMixin.plot_bar_chart.__name__} error", value=error, options=tuple(df.columns)) check_valid_lst(data=list(df[error]), source=f"{PlottingMixin.plot_bar_chart.__name__} error",valid_dtypes=Formats.NUMERIC_DTYPES.value) diff --git a/simba/model/inference_batch.py b/simba/model/inference_batch.py index 042b59c18..600b7cd60 100644 --- a/simba/model/inference_batch.py +++ b/simba/model/inference_batch.py @@ -92,6 +92,11 @@ def run(self): self.timer.stop_timer() stdout_success(msg=f"Machine predictions complete. Files saved in {self.save_dir} directory", elapsed_time=self.timer.elapsed_time_str, source=self.__class__.__name__) +# test = InferenceBatch(config_path=r"C:\troubleshooting\mitra\project_folder\project_config.ini") +# test.run() + + + # test = InferenceBatch(config_path=r"D:\troubleshooting\mitra\project_folder\project_config.ini",