diff --git a/skellytracker/process_folder_of_videos.py b/skellytracker/process_folder_of_videos.py index 2ecab4a..8e9b924 100644 --- a/skellytracker/process_folder_of_videos.py +++ b/skellytracker/process_folder_of_videos.py @@ -3,7 +3,6 @@ from multiprocessing import Pool, cpu_count from pathlib import Path from typing import Optional -import numpy as np from pydantic import BaseModel @@ -44,7 +43,7 @@ from skellytracker.trackers.openpose_tracker.openpose_tracker import ( OpenPoseTracker, ) -except: +except ModuleNotFoundError: print("To use openpose_tracker, install skellytracker[openpose]") logger = logging.getLogger(__name__) diff --git a/skellytracker/trackers/base_tracker/base_tracker.py b/skellytracker/trackers/base_tracker/base_tracker.py index ee097e0..b097b36 100644 --- a/skellytracker/trackers/base_tracker/base_tracker.py +++ b/skellytracker/trackers/base_tracker/base_tracker.py @@ -171,8 +171,8 @@ class BaseCumulativeTracker(BaseTracker): def __init__( self, - tracked_object_names: List[str] = [], - recorder: Optional[BaseCumulativeRecorder] = None, + tracked_object_names: List[str], + recorder: BaseCumulativeRecorder, **data: Any, ): super().__init__( diff --git a/skellytracker/trackers/base_tracker/model_info.py b/skellytracker/trackers/base_tracker/model_info.py index 51000d6..f4e2695 100644 --- a/skellytracker/trackers/base_tracker/model_info.py +++ b/skellytracker/trackers/base_tracker/model_info.py @@ -1,4 +1,4 @@ -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union class ModelInfo(dict): @@ -7,7 +7,7 @@ class ModelInfo(dict): landmark_names: List[str] num_tracked_points: int tracked_object_names: Optional[list] = None - virtual_markers_definitions: Optional[Dict[str, Dict[str, List[str | float]]]] = None + virtual_markers_definitions: Optional[Dict[str, Dict[str, List[Union[str, float]]]]] = None segment_connections: Optional[Dict[str, Dict[str, str]]] = None center_of_mass_definitions: Optional[Dict[str, Dict[str, float]]] = None joint_hierarchy: Optional[Dict[str, List[str]]] = None diff --git a/skellytracker/trackers/openpose_tracker/openpose_tracker.py b/skellytracker/trackers/openpose_tracker/openpose_tracker.py index c9bd2e8..8a79df4 100644 --- a/skellytracker/trackers/openpose_tracker/openpose_tracker.py +++ b/skellytracker/trackers/openpose_tracker/openpose_tracker.py @@ -113,7 +113,7 @@ def process_video( # Update the subprocess command to use the unique output directory try: - subprocess.run( + subprocess.run( # noqa: S603 openpose_command, shell=False, cwd=self.openpose_root_folder_path, # Set the current working directory for the subprocess