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 9, 2024
2 parents 25153da + f20fd13 commit 72440ab
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
13 changes: 8 additions & 5 deletions simba/data_processors/cuda/data.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import math
import time
from typing import Tuple

from simba.utils.checks import check_int, check_valid_array
import numpy as np
from typing import Tuple
from simba.utils.errors import InvalidInputError
from numba import cuda

from simba.data_processors.cuda.utils import (_cuda_2d_transpose, _cuda_add_2d,
_cuda_matrix_multiplication,
_cuda_subtract_2d)
from simba.utils.checks import check_int, check_valid_array
from simba.utils.enums import Formats
from simba.utils.errors import InvalidInputError
from simba.utils.read_write import read_df
from numba import cuda
from simba.data_processors.cuda.utils import _cuda_matrix_multiplication, _cuda_2d_transpose, _cuda_subtract_2d, _cuda_add_2d

THREADS_PER_BLOCK = 1024

Expand Down
1 change: 0 additions & 1 deletion simba/data_processors/cuda/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from numba import cuda, float64, guvectorize



@cuda.jit(device=True)
def _cuda_sum(x: np.ndarray):
s = 0
Expand Down
13 changes: 10 additions & 3 deletions simba/data_processors/egocentric_aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
import numpy as np
import pandas as pd

from simba.utils.checks import (check_if_dir_exists, check_if_valid_rgb_tuple, check_int, check_str, check_valid_dataframe, check_valid_tuple, check_valid_boolean)
from simba.utils.checks import (check_if_dir_exists, check_if_valid_rgb_tuple,
check_int, check_str, check_valid_boolean,
check_valid_dataframe, check_valid_tuple)
from simba.utils.data import egocentrically_align_pose_numba
from simba.utils.enums import Formats, Options
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.read_write import (bgr_to_rgb_tuple, find_core_cnt, find_files_of_filetypes_in_directory, find_video_of_file, get_fn_ext, read_df, write_df)
from simba.video_processors.egocentric_video_rotator import EgocentricVideoRotator
from simba.utils.read_write import (bgr_to_rgb_tuple, find_core_cnt,
find_files_of_filetypes_in_directory,
find_video_of_file, get_fn_ext, read_df,
write_df)
from simba.video_processors.egocentric_video_rotator import \
EgocentricVideoRotator


class EgocentricalAligner():

Expand Down
25 changes: 18 additions & 7 deletions simba/video_processors/egocentric_video_rotator.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
import os
from typing import Union, Tuple, Optional
import numpy as np
import functools
import multiprocessing
import os
from typing import Optional, Tuple, Union

import cv2
import numpy as np

from simba.utils.checks import check_if_valid_rgb_tuple, check_valid_boolean, check_int, check_file_exist_and_readable, check_if_dir_exists, check_valid_array, check_valid_tuple
from simba.utils.enums import Formats, Defaults
from simba.utils.read_write import get_video_meta_data, get_fn_ext, find_core_cnt, remove_a_folder, read_frm_of_video, concatenate_videos_in_folder, read_df, read_img_batch_from_video_gpu, create_directory
from simba.utils.checks import (check_file_exist_and_readable,
check_if_dir_exists, check_if_valid_rgb_tuple,
check_int, check_valid_array,
check_valid_boolean, check_valid_tuple)
from simba.utils.data import (align_target_warpaffine_vectors,
center_rotation_warpaffine_vectors,
egocentrically_align_pose)
from simba.utils.enums import Defaults, Formats
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.data import egocentrically_align_pose, center_rotation_warpaffine_vectors, align_target_warpaffine_vectors
from simba.utils.read_write import (concatenate_videos_in_folder,
create_directory, find_core_cnt,
get_fn_ext, get_video_meta_data, read_df,
read_frm_of_video,
read_img_batch_from_video_gpu,
remove_a_folder)


def egocentric_video_aligner(frm_range: np.ndarray,
Expand Down

0 comments on commit 72440ab

Please sign in to comment.