-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
# Conflicts: # simba/data_processors/cuda/convex_hull.py
- Loading branch information
Showing
11 changed files
with
71 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
from numba import cuda | ||
import math | ||
|
||
import numpy as np | ||
from numba import cuda | ||
|
||
from simba.utils.read_write import read_df | ||
import math | ||
|
||
THREADS_PER_BLOCK = 256 | ||
@cuda.jit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
__email__ = "[email protected]" | ||
|
||
|
||
from numba import cuda | ||
import numpy as np | ||
from numba import cuda | ||
|
||
THREADS_PER_BLOCK = 256 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,24 @@ | |
__email__ = "[email protected]" | ||
|
||
|
||
from typing import Union, Optional | ||
import os | ||
from typing import Optional, Union | ||
|
||
import cupy as cp | ||
import cv2 | ||
import numpy as np | ||
import cupy as cp | ||
|
||
from simba.utils.errors import InvalidInputError, FFMPEGCodecGPUError | ||
from simba.utils.checks import check_file_exist_and_readable, check_int, check_if_string_value_is_valid_video_timestamp, check_that_hhmmss_start_is_before_end,check_if_dir_exists, check_nvidea_gpu_available | ||
from simba.utils.read_write import get_video_meta_data, check_if_hhmmss_timestamp_is_valid_part_of_video, get_fn_ext, read_img_batch_from_video_gpu | ||
from simba.utils.checks import (check_file_exist_and_readable, | ||
check_if_dir_exists, | ||
check_if_string_value_is_valid_video_timestamp, | ||
check_int, check_nvidea_gpu_available, | ||
check_that_hhmmss_start_is_before_end) | ||
from simba.utils.data import find_frame_numbers_from_time_stamp | ||
from simba.utils.errors import FFMPEGCodecGPUError, InvalidInputError | ||
from simba.utils.printing import 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) | ||
|
||
|
||
def create_average_frm(video_path: Union[str, os.PathLike], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
from typing import Union, Optional | ||
import os | ||
from typing import Optional, Union | ||
|
||
import cupy as cp | ||
import cv2 | ||
import numpy as np | ||
import cupy as cp | ||
from numba import cuda | ||
|
||
from simba.utils.errors import InvalidInputError, FFMPEGCodecGPUError | ||
from simba.utils.checks import check_file_exist_and_readable, check_int, check_if_string_value_is_valid_video_timestamp, \ | ||
check_that_hhmmss_start_is_before_end, check_if_dir_exists, check_nvidea_gpu_available, check_instance, check_if_valid_img | ||
from simba.utils.read_write import get_video_meta_data, check_if_hhmmss_timestamp_is_valid_part_of_video, get_fn_ext, \ | ||
read_img_batch_from_video_gpu | ||
from simba.utils.checks import (check_file_exist_and_readable, | ||
check_if_dir_exists, | ||
check_if_string_value_is_valid_video_timestamp, | ||
check_if_valid_img, check_instance, check_int, | ||
check_nvidea_gpu_available, | ||
check_that_hhmmss_start_is_before_end) | ||
from simba.utils.data import find_frame_numbers_from_time_stamp | ||
from simba.utils.errors import FFMPEGCodecGPUError, InvalidInputError | ||
from simba.utils.printing import stdout_success | ||
from numba import cuda | ||
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) | ||
|
||
|
||
def average_3d_stack_cupy(image_stack: np.ndarray) -> np.ndarray: | ||
num_frames, height, width, _ = image_stack.shape | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
import math | ||
|
||
import numpy as np | ||
from numba import cuda | ||
import math | ||
|
||
THREADS_PER_BLOCK = 1024 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
from numba import cuda | ||
import math | ||
|
||
import numpy as np | ||
from simba.utils.read_write import read_df | ||
from numba import cuda | ||
|
||
from simba.mixins.feature_extraction_mixin import FeatureExtractionMixin | ||
import math | ||
from simba.utils.read_write import read_df | ||
|
||
THREADS_PER_BLOCK = 128 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
import math | ||
|
||
import numpy as np | ||
from numba import cuda | ||
import math | ||
|
||
THREADS_PER_BLOCK = 1024 | ||
@cuda.jit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
import numpy as np | ||
import cupy | ||
from typing import Optional | ||
|
||
import cupy | ||
import numpy as np | ||
|
||
|
||
def sliding_circular_mean(x: np.ndarray, | ||
time_window: float, | ||
sample_rate: int, | ||
|
6 changes: 4 additions & 2 deletions
6
simba/data_processors/cuda/sliding_resultant_vector_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
import numpy as np | ||
import cupy | ||
from typing import Optional | ||
|
||
import cupy | ||
import numpy as np | ||
|
||
|
||
def sliding_resultant_vector_length(x: np.ndarray, | ||
time_window: float, | ||
sample_rate: int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
import numpy as np | ||
import cupy as cp | ||
from typing import Optional | ||
|
||
import cupy as cp | ||
import numpy as np | ||
|
||
|
||
def sliding_spearmans_rank(x: np.ndarray, | ||
y: np.ndarray, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
__author__ = "Simon Nilsson" | ||
__email__ = "[email protected]" | ||
|
||
from typing import List, Tuple | ||
import os | ||
from typing import Union, Optional | ||
from typing import List, Optional, Tuple, Union | ||
|
||
import numpy as np | ||
|
||
try: | ||
from typing import Literal | ||
except: | ||
from typing_extensions import Literal | ||
from simba.utils.read_write import find_all_videos_in_directory, get_fn_ext, remove_files, get_video_meta_data, find_core_cnt, concatenate_videos_in_folder | ||
from simba.utils.checks import check_if_dir_exists, check_valid_boolean, check_int, check_nvidea_gpu_available, check_str, check_if_valid_rgb_tuple | ||
from simba.utils.enums import Options, TextOptions, Defaults | ||
from simba.utils.printing import stdout_success, SimbaTimer | ||
from simba.utils.errors import InvalidInputError, FFMPEGCodecGPUError | ||
from simba.data_processors.blob_location_computer import BlobLocationComputer | ||
from simba.mixins.plotting_mixin import PlottingMixin | ||
import multiprocessing | ||
|
||
import functools | ||
import multiprocessing | ||
|
||
from numba import jit | ||
|
||
from simba.data_processors.blob_location_computer import BlobLocationComputer | ||
from simba.mixins.plotting_mixin import PlottingMixin | ||
from simba.utils.checks import (check_if_dir_exists, check_if_valid_rgb_tuple, | ||
check_int, check_nvidea_gpu_available, | ||
check_str, check_valid_boolean) | ||
from simba.utils.enums import Defaults, Options, TextOptions | ||
from simba.utils.errors import FFMPEGCodecGPUError, InvalidInputError | ||
from simba.utils.printing import SimbaTimer, stdout_success | ||
from simba.utils.read_write import (concatenate_videos_in_folder, | ||
find_all_videos_in_directory, | ||
find_core_cnt, get_fn_ext, | ||
get_video_meta_data, remove_files) | ||
|
||
|
||
class BlobPlotter(PlottingMixin): | ||
""" | ||
|