title
stringclasses
1 value
text
stringlengths
30
426k
id
stringlengths
27
30
ultralytics/trackers/bot_sort.py/BOTSORT/get_kalmanfilter class BOTSORT: def get_kalmanfilter(self): """Returns an instance of KalmanFilterXYWH for predicting and updating object states in the tracking process.""" return KalmanFilterXYWH()
negative_train_query659_01666
ultralytics/trackers/bot_sort.py/BOTSORT/init_track class BOTSORT: def init_track(self, dets, scores, cls, img=None): """Initialize object tracks using detection bounding boxes, scores, class labels, and optional ReID features.""" if len(dets) == 0: return [] if self.args.with_reid a...
negative_train_query659_01667
ultralytics/trackers/bot_sort.py/BOTSORT/get_dists class BOTSORT: def get_dists(self, tracks, detections): """Calculates distances between tracks and detections using IoU and optionally ReID embeddings.""" dists = matching.iou_distance(tracks, detections) dists_mask = dists > self.proximity_thre...
negative_train_query659_01668
ultralytics/trackers/bot_sort.py/BOTSORT/multi_predict class BOTSORT: def multi_predict(self, tracks): """Predicts the mean and covariance of multiple object tracks using a shared Kalman filter.""" BOTrack.multi_predict(tracks)
negative_train_query659_01669
ultralytics/trackers/bot_sort.py/BOTSORT/reset class BOTSORT: def reset(self): """Resets the BOTSORT tracker to its initial state, clearing all tracked objects and internal states.""" super().reset() self.gmc.reset_params()
negative_train_query659_01670
ultralytics/trackers/basetrack.py/BaseTrack/__init__ class BaseTrack: def __init__(self): """ Initializes a new track with a unique ID and foundational tracking attributes. Examples: Initialize a new track >>> track = BaseTrack() >>> print(track.track_id) ...
negative_train_query659_01671
ultralytics/trackers/basetrack.py/BaseTrack/end_frame class BaseTrack: def end_frame(self): """Returns the ID of the most recent frame where the object was tracked.""" return self.frame_id
negative_train_query659_01672
ultralytics/trackers/basetrack.py/BaseTrack/next_id class BaseTrack: def next_id(): """Increment and return the next unique global track ID for object tracking.""" BaseTrack._count += 1 return BaseTrack._count
negative_train_query659_01673
ultralytics/trackers/basetrack.py/BaseTrack/activate class BaseTrack: def activate(self, *args): """Activates the track with provided arguments, initializing necessary attributes for tracking.""" raise NotImplementedError
negative_train_query659_01674
ultralytics/trackers/basetrack.py/BaseTrack/predict class BaseTrack: def predict(self): """Predicts the next state of the track based on the current state and tracking model.""" raise NotImplementedError
negative_train_query659_01675
ultralytics/trackers/basetrack.py/BaseTrack/update class BaseTrack: def update(self, *args, **kwargs): """Updates the track with new observations and data, modifying its state and attributes accordingly.""" raise NotImplementedError
negative_train_query659_01676
ultralytics/trackers/basetrack.py/BaseTrack/mark_lost class BaseTrack: def mark_lost(self): """Marks the track as lost by updating its state to TrackState.Lost.""" self.state = TrackState.Lost
negative_train_query659_01677
ultralytics/trackers/basetrack.py/BaseTrack/mark_removed class BaseTrack: def mark_removed(self): """Marks the track as removed by setting its state to TrackState.Removed.""" self.state = TrackState.Removed
negative_train_query659_01678
ultralytics/trackers/basetrack.py/BaseTrack/reset_id class BaseTrack: def reset_id(): """Reset the global track ID counter to its initial value.""" BaseTrack._count = 0
negative_train_query659_01679
ultralytics/trackers/utils/gmc.py/GMC/__init__ class GMC: def __init__(self, method: str = "sparseOptFlow", downscale: int = 2) -> None: """ Initialize a Generalized Motion Compensation (GMC) object with tracking method and downscale factor. Args: method (str): The method used for t...
negative_train_query659_01680
ultralytics/trackers/utils/gmc.py/GMC/apply class GMC: def apply(self, raw_frame: np.array, detections: list = None) -> np.array: """ Apply object detection on a raw frame using the specified method. Args: raw_frame (np.ndarray): The raw frame to be processed, with shape (H, W, C). ...
negative_train_query659_01681
ultralytics/trackers/utils/gmc.py/GMC/applyEcc class GMC: def applyEcc(self, raw_frame: np.array) -> np.array: """ Apply the ECC (Enhanced Correlation Coefficient) algorithm to a raw frame for motion compensation. Args: raw_frame (np.ndarray): The raw frame to be processed, with sha...
negative_train_query659_01682
ultralytics/trackers/utils/gmc.py/GMC/applyFeatures class GMC: def applyFeatures(self, raw_frame: np.array, detections: list = None) -> np.array: """ Apply feature-based methods like ORB or SIFT to a raw frame. Args: raw_frame (np.ndarray): The raw frame to be processed, with shape ...
negative_train_query659_01683
ultralytics/trackers/utils/gmc.py/GMC/applySparseOptFlow class GMC: def applySparseOptFlow(self, raw_frame: np.array) -> np.array: """ Apply Sparse Optical Flow method to a raw frame. Args: raw_frame (np.ndarray): The raw frame to be processed, with shape (H, W, C). Returns...
negative_train_query659_01684
ultralytics/trackers/utils/gmc.py/GMC/reset_params class GMC: def reset_params(self) -> None: """Reset the internal parameters including previous frame, keypoints, and descriptors.""" self.prevFrame = None self.prevKeyPoints = None self.prevDescriptors = None self.initializedFirs...
negative_train_query659_01685
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/__init__ class KalmanFilterXYAH: def __init__(self): """ Initialize Kalman filter model matrices with motion and observation uncertainty weights. The Kalman filter is initialized with an 8-dimensional state space (x, y, a, h, vx, vy, ...
negative_train_query659_01686
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/initiate class KalmanFilterXYAH: def initiate(self, measurement: np.ndarray) -> tuple: """ Create a track from an unassociated measurement. Args: measurement (ndarray): Bounding box coordinates (x, y, a, h) with center pos...
negative_train_query659_01687
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/predict class KalmanFilterXYAH: def predict(self, mean: np.ndarray, covariance: np.ndarray) -> tuple: """ Run Kalman filter prediction step. Args: mean (ndarray): The 8-dimensional mean vector of the object state at the pr...
negative_train_query659_01688
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/project class KalmanFilterXYAH: def project(self, mean: np.ndarray, covariance: np.ndarray) -> tuple: """ Project state distribution to measurement space. Args: mean (ndarray): The state's mean vector (8 dimensional array)...
negative_train_query659_01689
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/multi_predict class KalmanFilterXYAH: def multi_predict(self, mean: np.ndarray, covariance: np.ndarray) -> tuple: """ Run Kalman filter prediction step for multiple object states (Vectorized version). Args: mean (ndarray):...
negative_train_query659_01690
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/update class KalmanFilterXYAH: def update(self, mean: np.ndarray, covariance: np.ndarray, measurement: np.ndarray) -> tuple: """ Run Kalman filter correction step. Args: mean (ndarray): The predicted state's mean vector (8...
negative_train_query659_01691
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYAH/gating_distance class KalmanFilterXYAH: def gating_distance( self, mean: np.ndarray, covariance: np.ndarray, measurements: np.ndarray, only_position: bool = False, metric: str = "maha", ) -> np.ndarray: ...
negative_train_query659_01692
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYWH/initiate class KalmanFilterXYWH: def initiate(self, measurement: np.ndarray) -> tuple: """ Create track from unassociated measurement. Args: measurement (ndarray): Bounding box coordinates (x, y, w, h) with center position...
negative_train_query659_01693
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYWH/predict class KalmanFilterXYWH: def predict(self, mean, covariance) -> tuple: """ Run Kalman filter prediction step. Args: mean (ndarray): The 8-dimensional mean vector of the object state at the previous time step. ...
negative_train_query659_01694
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYWH/project class KalmanFilterXYWH: def project(self, mean, covariance) -> tuple: """ Project state distribution to measurement space. Args: mean (ndarray): The state's mean vector (8 dimensional array). covariance...
negative_train_query659_01695
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYWH/multi_predict class KalmanFilterXYWH: def multi_predict(self, mean, covariance) -> tuple: """ Run Kalman filter prediction step (Vectorized version). Args: mean (ndarray): The Nx8 dimensional mean matrix of the object stat...
negative_train_query659_01696
ultralytics/trackers/utils/kalman_filter.py/KalmanFilterXYWH/update class KalmanFilterXYWH: def update(self, mean, covariance, measurement) -> tuple: """ Run Kalman filter correction step. Args: mean (ndarray): The predicted state's mean vector (8 dimensional). covarianc...
negative_train_query659_01697
ultralytics/trackers/utils/matching.py/linear_assignment def linear_assignment(cost_matrix: np.ndarray, thresh: float, use_lap: bool = True) -> tuple: """ Perform linear assignment using either the scipy or lap.lapjv method. Args: cost_matrix (np.ndarray): The matrix containing cost values for assi...
negative_train_query659_01698
ultralytics/trackers/utils/matching.py/iou_distance def iou_distance(atracks: list, btracks: list) -> np.ndarray: """ Compute cost based on Intersection over Union (IoU) between tracks. Args: atracks (list[STrack] | list[np.ndarray]): List of tracks 'a' or bounding boxes. btracks (list[STra...
negative_train_query659_01699
ultralytics/trackers/utils/matching.py/embedding_distance def embedding_distance(tracks: list, detections: list, metric: str = "cosine") -> np.ndarray: """ Compute distance between tracks and detections based on embeddings. Args: tracks (list[STrack]): List of tracks, where each track contains embe...
negative_train_query659_01700
ultralytics/trackers/utils/matching.py/fuse_score def fuse_score(cost_matrix: np.ndarray, detections: list) -> np.ndarray: """ Fuses cost matrix with detection scores to produce a single similarity matrix. Args: cost_matrix (np.ndarray): The matrix containing cost values for assignments, with shape...
negative_train_query659_01701
ultralytics/cfg/__init__.py/cfg2dict def cfg2dict(cfg): """ Converts a configuration object to a dictionary. Args: cfg (str | Path | Dict | SimpleNamespace): Configuration object to be converted. Can be a file path, a string, a dictionary, or a SimpleNamespace object. Returns: ...
negative_train_query659_01702
ultralytics/cfg/__init__.py/get_cfg def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, overrides: Dict = None): """ Load and merge configuration data from a file or dictionary, with optional overrides. Args: cfg (str | Path | Dict | SimpleNamespace): Configuration data sou...
negative_train_query659_01703
ultralytics/cfg/__init__.py/check_cfg def check_cfg(cfg, hard=True): """ Checks configuration argument types and values for the Ultralytics library. This function validates the types and values of configuration arguments, ensuring correctness and converting them if necessary. It checks for specific key...
negative_train_query659_01704
ultralytics/cfg/__init__.py/get_save_dir def get_save_dir(args, name=None): """ Returns the directory path for saving outputs, derived from arguments or default settings. Args: args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task', 'mode', ...
negative_train_query659_01705
ultralytics/cfg/__init__.py/_handle_deprecation def _handle_deprecation(custom): """ Handles deprecated configuration keys by mapping them to current equivalents with deprecation warnings. Args: custom (Dict): Configuration dictionary potentially containing deprecated keys. Examples: >...
negative_train_query659_01706
ultralytics/cfg/__init__.py/check_dict_alignment def check_dict_alignment(base: Dict, custom: Dict, e=None): """ Checks alignment between custom and base configuration dictionaries, handling deprecated keys and providing error messages for mismatched keys. Args: base (Dict): The base configurat...
negative_train_query659_01707
ultralytics/cfg/__init__.py/merge_equals_args def merge_equals_args(args: List[str]) -> List[str]: """ Merges arguments around isolated '=' in a list of strings and joins fragments with brackets. This function handles the following cases: 1. ['arg', '=', 'val'] becomes ['arg=val'] 2. ['arg=', 'val'...
negative_train_query659_01708
ultralytics/cfg/__init__.py/handle_yolo_hub def handle_yolo_hub(args: List[str]) -> None: """ Handles Ultralytics HUB command-line interface (CLI) commands for authentication. This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a script with...
negative_train_query659_01709
ultralytics/cfg/__init__.py/handle_yolo_settings def handle_yolo_settings(args: List[str]) -> None: """ Handles YOLO settings command-line interface (CLI) commands. This function processes YOLO settings CLI commands such as reset and updating individual settings. It should be called when executing a sc...
negative_train_query659_01710
ultralytics/cfg/__init__.py/handle_yolo_solutions def handle_yolo_solutions(args: List[str]) -> None: """ Processes YOLO solutions arguments and runs the specified computer vision solutions pipeline. Args: args (List[str]): Command-line arguments for configuring and running the Ultralytics YOLO ...
negative_train_query659_01711
ultralytics/cfg/__init__.py/handle_streamlit_inference def handle_streamlit_inference(): """ Open the Ultralytics Live Inference Streamlit app for real-time object detection. This function initializes and runs a Streamlit application designed for performing live object detection using Ultralytics model...
negative_train_query659_01712
ultralytics/cfg/__init__.py/parse_key_value_pair def parse_key_value_pair(pair: str = "key=value"): """ Parses a key-value pair string into separate key and value components. Args: pair (str): A string containing a key-value pair in the format "key=value". Returns: (tuple): A tuple con...
negative_train_query659_01713
ultralytics/cfg/__init__.py/smart_value def smart_value(v): """ Converts a string representation of a value to its appropriate Python type. This function attempts to convert a given string into a Python object of the most appropriate type. It handles conversions to None, bool, int, float, and other typ...
negative_train_query659_01714
ultralytics/cfg/__init__.py/entrypoint def entrypoint(debug=""): """ Ultralytics entrypoint function for parsing and executing command-line arguments. This function serves as the main entry point for the Ultralytics CLI, parsing command-line arguments and executing the corresponding tasks such as train...
negative_train_query659_01715
ultralytics/cfg/__init__.py/copy_default_cfg def copy_default_cfg(): """ Copies the default configuration file and creates a new one with '_copy' appended to its name. This function duplicates the existing default configuration file (DEFAULT_CFG_PATH) and saves it with '_copy' appended to its name in t...
negative_train_query659_01716