diff --git a/simba/pose_importers/sleap_h5_importer.py b/simba/pose_importers/sleap_h5_importer.py index a04eb8d59..dc76517d1 100644 --- a/simba/pose_importers/sleap_h5_importer.py +++ b/simba/pose_importers/sleap_h5_importer.py @@ -1,7 +1,8 @@ #### MODIFIED FROM @Toshea111 - https://github.com/Toshea111/sleap/blob/develop/docs/notebooks/Convert_HDF5_to_CSV_updated.ipynb -from typing import Union, List, Dict, Any import io import os +from typing import Any, Dict, List, Union + import h5py import numpy as np import pandas as pd @@ -9,13 +10,16 @@ from simba.data_processors.interpolation_smoothing import Interpolate, Smooth from simba.mixins.config_reader import ConfigReader from simba.mixins.pose_importer_mixin import PoseImporterMixin -from simba.utils.enums import Methods, TagNames, Options +from simba.utils.checks import (check_file_exist_and_readable, + check_if_dir_exists, + check_if_keys_exist_in_dict, check_str) +from simba.utils.enums import Methods, Options, TagNames from simba.utils.errors import BodypartColumnNotFoundError -from simba.utils.printing import (SimbaTimer, log_event, stdout_success, stdout_warning) +from simba.utils.printing import (SimbaTimer, log_event, stdout_success, + stdout_warning) from simba.utils.read_write import (clean_sleap_file_name, find_all_videos_in_project, get_fn_ext, get_video_meta_data, write_df) -from simba.utils.checks import check_file_exist_and_readable, check_if_dir_exists, check_str, check_if_keys_exist_in_dict class SLEAPImporterH5(ConfigReader, PoseImporterMixin): diff --git a/simba/video_processors/video_processing.py b/simba/video_processors/video_processing.py index 721ab8697..f7204c146 100644 --- a/simba/video_processors/video_processing.py +++ b/simba/video_processors/video_processing.py @@ -8,11 +8,11 @@ import shutil import subprocess import time +from copy import deepcopy from datetime import datetime from pathlib import Path from tkinter import * from typing import List, Optional, Tuple, Union -from copy import deepcopy import cv2 import numpy as np @@ -36,6 +36,7 @@ check_nvidea_gpu_available, check_str, check_that_hhmmss_start_is_before_end, check_valid_lst, check_valid_tuple) +from simba.utils.data import find_frame_numbers_from_time_stamp from simba.utils.enums import OS, ConfigKey, Formats, Options, Paths from simba.utils.errors import (CountError, DirectoryExistError, FFMPEGCodecGPUError, FFMPEGNotFoundError, @@ -43,14 +44,14 @@ InvalidFileTypeError, InvalidInputError, InvalidVideoFileError, NoDataError, NoFilesFoundError, NotDirectoryError) -from simba.utils.lookups import (get_ffmpeg_crossfade_methods, percent_to_crf_lookup, percent_to_qv_lk) +from simba.utils.lookups import (get_ffmpeg_crossfade_methods, + percent_to_crf_lookup, percent_to_qv_lk) from simba.utils.printing import SimbaTimer, stdout_success from simba.utils.read_write import ( check_if_hhmmss_timestamp_is_valid_part_of_video, find_all_videos_in_directory, find_core_cnt, find_files_of_filetypes_in_directory, get_fn_ext, get_video_meta_data, read_config_entry, read_config_file, read_frm_of_video) -from simba.utils.data import find_frame_numbers_from_time_stamp from simba.utils.warnings import (FileExistWarning, InValidUserInputWarning, SameInputAndOutputWarning) from simba.video_processors.extract_frames import video_to_frames