Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Dec 2, 2024
2 parents 16a0875 + dedb46c commit 18b87c2
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
5 changes: 4 additions & 1 deletion simba/data_processors/agg_clf_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
from typing_extensions import Literal

from simba.mixins.config_reader import ConfigReader
from simba.utils.checks import (check_all_file_names_are_represented_in_video_log, check_file_exist_and_readable, check_if_filepath_list_is_empty, check_valid_dataframe)
from simba.utils.checks import (
check_all_file_names_are_represented_in_video_log,
check_file_exist_and_readable, check_if_filepath_list_is_empty,
check_valid_dataframe)
from simba.utils.data import detect_bouts
from simba.utils.enums import Options, TagNames
from simba.utils.errors import InvalidInputError
Expand Down
4 changes: 2 additions & 2 deletions simba/data_processors/blob_location_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from simba.utils.read_write import (find_all_videos_in_directory, get_fn_ext,
get_video_meta_data, remove_files,
write_df)
from simba.video_processors.video_processing import (video_bg_subtraction_mp,
video_bg_subtraction)
from simba.video_processors.video_processing import (video_bg_subtraction,
video_bg_subtraction_mp)


class BlobLocationComputer(object):
Expand Down
23 changes: 15 additions & 8 deletions simba/data_processors/cuda/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import math
import os
from typing import Optional, Union, Tuple
from typing import Optional, Tuple, Union

try:
from typing import Literal
Expand All @@ -17,28 +17,35 @@
import numpy as cp
from scipy.ndimage import rotate

import warnings
from copy import deepcopy

import cv2
import numpy as np
from numba import cuda
from numba.core.errors import NumbaPerformanceWarning

from simba.data_processors.cuda.utils import _cuda_mse, _cuda_available, _cuda_luminance_pixel_to_grey
from simba.data_processors.cuda.utils import (_cuda_available,
_cuda_luminance_pixel_to_grey,
_cuda_mse)
from simba.mixins.image_mixin import ImageMixin
from simba.utils.checks import (check_file_exist_and_readable, check_float,
check_if_dir_exists,
check_if_string_value_is_valid_video_timestamp,
check_if_valid_img, check_instance, check_int,
check_if_valid_img, check_if_valid_rgb_tuple,
check_instance, check_int,
check_nvidea_gpu_available,
check_that_hhmmss_start_is_before_end,
check_valid_array, check_valid_boolean, check_if_valid_rgb_tuple, is_video_color)
check_valid_array, check_valid_boolean,
is_video_color)
from simba.utils.data import find_frame_numbers_from_time_stamp
from simba.utils.enums import Formats
from simba.utils.errors import FFMPEGCodecGPUError, InvalidInputError, SimBAGPUError
from simba.utils.errors import (FFMPEGCodecGPUError, InvalidInputError,
SimBAGPUError)
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.read_write import (check_if_hhmmss_timestamp_is_valid_part_of_video, get_fn_ext, get_video_meta_data, read_img_batch_from_video_gpu)
from numba.core.errors import NumbaPerformanceWarning
import warnings
from simba.utils.read_write import (
check_if_hhmmss_timestamp_is_valid_part_of_video, get_fn_ext,
get_video_meta_data, read_img_batch_from_video_gpu)

warnings.simplefilter('ignore', category=NumbaPerformanceWarning)

Expand Down
4 changes: 3 additions & 1 deletion simba/model/inference_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

from simba.mixins.config_reader import ConfigReader
from simba.mixins.train_model_mixin import TrainModelMixin
from simba.utils.checks import (check_all_file_names_are_represented_in_video_log, check_if_dir_exists, check_if_keys_exist_in_dict, check_float)
from simba.utils.checks import (
check_all_file_names_are_represented_in_video_log, check_float,
check_if_dir_exists, check_if_keys_exist_in_dict)
from simba.utils.data import plug_holes_shortest_bout
from simba.utils.enums import TagNames
from simba.utils.errors import NoFilesFoundError
Expand Down
2 changes: 1 addition & 1 deletion simba/ui/pop_ups/video_processing_pop_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
superimpose_elapsed_time, superimpose_frame_count, superimpose_freetext,
superimpose_overlay_video, superimpose_video_names,
superimpose_video_progressbar, temporal_concatenation, upsample_fps,
video_bg_subtraction_mp, video_bg_subtraction, video_concatenator,
video_bg_subtraction, video_bg_subtraction_mp, video_concatenator,
video_to_bw, video_to_greyscale, watermark_video)

sys.setrecursionlimit(10**7)
Expand Down
2 changes: 2 additions & 0 deletions simba/utils/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import subprocess
from pathlib import Path
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union

try:
import cupy as cp
except ModuleNotFoundError:
import numpy as cp

import cv2
import numpy as np
import pandas as pd
Expand Down

0 comments on commit 18b87c2

Please sign in to comment.