From 09366266803ee499db9963537860f2ce41a895a9 Mon Sep 17 00:00:00 2001 From: sronilsson Date: Sun, 27 Oct 2024 16:41:38 +0000 Subject: [PATCH] cleaned --- simba/data_processors/egocentric_aligner.py | 27 +++++++++++++++------ simba/mixins/train_model_mixin.py | 8 +++--- simba/plotting/geometry_plotter.py | 2 +- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/simba/data_processors/egocentric_aligner.py b/simba/data_processors/egocentric_aligner.py index 4c8ea1cab..8fb68dfc6 100644 --- a/simba/data_processors/egocentric_aligner.py +++ b/simba/data_processors/egocentric_aligner.py @@ -1,16 +1,27 @@ +import functools +import multiprocessing import os -import numpy as np +from typing import List, Optional, Tuple, Union + import cv2 -import multiprocessing -import functools +import numpy as np import pandas as pd -from typing import Union, Optional, Tuple, List -from simba.utils.read_write import find_files_of_filetypes_in_directory, get_fn_ext,read_df, find_video_of_file, write_df, get_video_meta_data, read_frm_of_video, find_core_cnt, remove_a_folder, concatenate_videos_in_folder -from simba.utils.checks import check_all_file_names_are_represented_in_video_log, check_valid_dataframe, check_int -from simba.utils.enums import Formats + from simba.mixins.config_reader import ConfigReader -from simba.utils.warnings import FrameRangeWarning +from simba.utils.checks import ( + check_all_file_names_are_represented_in_video_log, check_int, + check_valid_dataframe) +from simba.utils.enums import Formats from simba.utils.printing import SimbaTimer +from simba.utils.read_write import (concatenate_videos_in_folder, + find_core_cnt, + find_files_of_filetypes_in_directory, + find_video_of_file, get_fn_ext, + get_video_meta_data, read_df, + read_frm_of_video, remove_a_folder, + write_df) +from simba.utils.warnings import FrameRangeWarning + def _egocentric_aligner(frm_range: np.ndarray, video_path: Union[str, os.PathLike], diff --git a/simba/mixins/train_model_mixin.py b/simba/mixins/train_model_mixin.py index 00bcfb103..e6013e12b 100644 --- a/simba/mixins/train_model_mixin.py +++ b/simba/mixins/train_model_mixin.py @@ -32,7 +32,8 @@ from sklearn.inspection import partial_dependence, permutation_importance from sklearn.metrics import classification_report, precision_recall_curve from sklearn.model_selection import ShuffleSplit, learning_curve -from sklearn.preprocessing import (MinMaxScaler, QuantileTransformer, StandardScaler) +from sklearn.preprocessing import (MinMaxScaler, QuantileTransformer, + StandardScaler) from sklearn.tree import export_graphviz from sklearn.utils import parallel_backend from tabulate import tabulate @@ -75,8 +76,9 @@ from simba.utils.lookups import get_meta_data_file_headers from simba.utils.printing import SimbaTimer, stdout_success from simba.utils.read_write import (find_core_cnt, get_fn_ext, - get_memory_usage_of_df, read_config_entry, - read_df, read_meta_file, str_2_bool, get_pkg_version) + get_memory_usage_of_df, get_pkg_version, + read_config_entry, read_df, read_meta_file, + str_2_bool) from simba.utils.warnings import (MissingUserInputWarning, MultiProcessingFailedWarning, NoModuleWarning, NotEnoughDataWarning, diff --git a/simba/plotting/geometry_plotter.py b/simba/plotting/geometry_plotter.py index a15f00064..705f68539 100644 --- a/simba/plotting/geometry_plotter.py +++ b/simba/plotting/geometry_plotter.py @@ -20,7 +20,7 @@ from simba.utils.printing import SimbaTimer, stdout_success from simba.utils.read_write import (concatenate_videos_in_folder, find_core_cnt, find_video_of_file, - get_video_meta_data, get_fn_ext) + get_fn_ext, get_video_meta_data) from simba.utils.warnings import FrameRangeWarning ACCEPTED_TYPES = [Polygon, LineString, MultiPolygon, MultiLineString, Point]