Skip to content

Commit

Permalink
cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Oct 19, 2024
1 parent ae1e470 commit efe92a0
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 18 deletions.
7 changes: 5 additions & 2 deletions simba/bounding_box_tools/yolo/geometries_to_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
from skimage.draw import polygon

from simba.mixins.geometry_mixin import GeometryMixin
from simba.utils.checks import check_instance, check_int, check_valid_array, check_if_dir_exists
from simba.utils.checks import (check_if_dir_exists, check_instance, check_int,
check_valid_array)
from simba.utils.enums import Formats
from simba.utils.read_write import (get_video_meta_data, read_df, read_frm_of_video, find_files_of_filetypes_in_directory)
from simba.utils.read_write import (find_files_of_filetypes_in_directory,
get_video_meta_data, read_df,
read_frm_of_video)


def geometry_to_rle(geometry: Union[np.ndarray, Polygon], img_size: Tuple[int, int]):
Expand Down
9 changes: 6 additions & 3 deletions simba/data_processors/boolean_conditional_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
import pandas as pd

from simba.mixins.config_reader import ConfigReader
from simba.utils.checks import (check_all_file_names_are_represented_in_video_log, check_if_df_field_is_boolean, check_instance)
from simba.utils.checks import (
check_all_file_names_are_represented_in_video_log,
check_if_df_field_is_boolean, check_instance)
from simba.utils.data import detect_bouts
from simba.utils.errors import MissingColumnsError
from simba.utils.printing import stdout_success
from simba.utils.read_write import (get_fn_ext, read_data_paths, read_df, read_video_info, str_2_bool)
from simba.utils.data import detect_bouts
from simba.utils.read_write import (get_fn_ext, read_data_paths, read_df,
read_video_info, str_2_bool)


class BooleanConditionalCalculator(ConfigReader):
Expand Down
13 changes: 9 additions & 4 deletions simba/mixins/train_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -57,11 +58,15 @@
from simba.plotting.shap_agg_stats_visualizer import \
ShapAggregateStatisticsVisualizer
from simba.ui.tkinter_functions import TwoOptionQuestionPopUp
from simba.utils.checks import (check_file_exist_and_readable, check_float, check_if_dir_exists, check_if_valid_input, check_instance, check_int, check_str, check_that_column_exist, check_valid_dataframe, check_valid_lst)
from simba.utils.checks import (check_file_exist_and_readable, check_float,
check_if_dir_exists, check_if_valid_input,
check_instance, check_int, check_str,
check_that_column_exist, check_valid_dataframe,
check_valid_lst)
from simba.utils.data import (detect_bouts, detect_bouts_multiclass,
get_library_version)
from simba.utils.enums import (OS, ConfigKey, Defaults, Dtypes, Methods,
MLParamKeys, Options, Formats)
from simba.utils.enums import (OS, ConfigKey, Defaults, Dtypes, Formats,
Methods, MLParamKeys, Options)
from simba.utils.errors import (ClassifierInferenceError, ColumnNotFoundError,
CorruptedFileError, DataHeaderError,
FaultyTrainingSetError,
Expand Down
24 changes: 15 additions & 9 deletions simba/third_party_label_appenders/converters.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import base64
import io
import itertools
import json
import os
import itertools
import pandas as pd
import io
from PIL import Image
import base64
from datetime import datetime
from typing import Dict, Optional, Tuple, Union, Any
from typing import Any, Dict, Optional, Tuple, Union

import cv2
import numpy as np
import pandas as pd
from PIL import Image
from pycocotools import mask
from shapely.geometry import Polygon
from skimage.draw import polygon

from simba.mixins.geometry_mixin import GeometryMixin
from simba.mixins.image_mixin import ImageMixin
from simba.utils.checks import check_instance, check_int, check_valid_array, check_if_dir_exists, check_if_keys_exist_in_dict, check_file_exist_and_readable, check_if_valid_img
from simba.utils.checks import (check_file_exist_and_readable,
check_if_dir_exists,
check_if_keys_exist_in_dict,
check_if_valid_img, check_instance, check_int,
check_valid_array)
from simba.utils.enums import Formats
from simba.utils.read_write import get_video_meta_data, read_df, read_frm_of_video, find_files_of_filetypes_in_directory, get_fn_ext
from simba.utils.errors import NoFilesFoundError, InvalidInputError
from simba.utils.errors import InvalidInputError, NoFilesFoundError
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.read_write import (find_files_of_filetypes_in_directory,
get_fn_ext, get_video_meta_data, read_df,
read_frm_of_video)


def geometry_to_rle(geometry: Union[np.ndarray, Polygon], img_size: Tuple[int, int]):
Expand Down

0 comments on commit efe92a0

Please sign in to comment.