SYMBOL INDEX (1992 symbols across 140 files) FILE: app.py function yolov10_inference (line 7) | def yolov10_inference(image, video, model_id, image_size, conf_threshold): function yolov10_inference_for_examples (line 42) | def yolov10_inference_for_examples(image, model_path, image_size, conf_t... function app (line 47) | def app(): FILE: docs/build_docs.py function build_docs (line 39) | def build_docs(clone_repos=True): function update_page_title (line 64) | def update_page_title(file_path: Path, new_title: str): function update_html_head (line 79) | def update_html_head(script=""): function update_subdir_edit_links (line 97) | def update_subdir_edit_links(subdir="", docs_url=""): function main (line 118) | def main(): FILE: docs/build_reference.py function extract_classes_and_functions (line 21) | def extract_classes_and_functions(filepath: Path) -> tuple: function create_markdown (line 33) | def create_markdown(py_filepath: Path, module_path: str, classes: list, ... function nested_dict (line 67) | def nested_dict() -> defaultdict: function sort_nested_dict (line 72) | def sort_nested_dict(d: dict) -> dict: function create_nav_menu_yaml (line 77) | def create_nav_menu_yaml(nav_items: list, save: bool = False): function main (line 112) | def main(): FILE: docs/overrides/javascript/extra.js function checkAutoTheme (line 18) | function checkAutoTheme() { FILE: examples/YOLOv8-CPP-Inference/inference.h type Detection (line 15) | struct Detection function confidence (line 19) | float confidence{0.0}; function cudaEnabled (line 37) | bool cudaEnabled{} function modelNMSThreshold (line 45) | float modelNMSThreshold {0.50}; FILE: examples/YOLOv8-CPP-Inference/main.cpp function main (line 12) | int main(int argc, char **argv) FILE: examples/YOLOv8-LibTorch-CPP-Inference/main.cc function generate_scale (line 13) | float generate_scale(cv::Mat& image, const std::vector& target_size) { function letterbox (line 27) | float letterbox(cv::Mat &input_image, cv::Mat &output_image, const std::... function xyxy2xywh (line 58) | torch::Tensor xyxy2xywh(const torch::Tensor& x) { function xywh2xyxy (line 68) | torch::Tensor xywh2xyxy(const torch::Tensor& x) { function nms (line 81) | torch::Tensor nms(const torch::Tensor& bboxes, const torch::Tensor& scor... function non_max_supperession (line 142) | torch::Tensor non_max_supperession(torch::Tensor& prediction, float conf... function clip_boxes (line 181) | torch::Tensor clip_boxes(torch::Tensor& boxes, const std::vector& s... function scale_boxes (line 190) | torch::Tensor scale_boxes(const std::vector& img1_shape, torch::Ten... function main (line 204) | int main() { FILE: examples/YOLOv8-ONNXRuntime-CPP/inference.cpp type Ort (line 16) | namespace Ort type TypeToTensorType (line 19) | struct TypeToTensorType { static constexpr ONNXTensorElementData... FILE: examples/YOLOv8-ONNXRuntime-CPP/inference.h type MODEL_TYPE (line 22) | enum MODEL_TYPE type DL_INIT_PARAM (line 35) | typedef struct _DL_INIT_PARAM type DL_RESULT (line 49) | typedef struct _DL_RESULT function class (line 58) | class YOLO_V8 FILE: examples/YOLOv8-ONNXRuntime-CPP/main.cpp function Detector (line 8) | void Detector(YOLO_V8*& p) { function Classifier (line 61) | void Classifier(YOLO_V8*& p) function ReadCocoYaml (line 100) | int ReadCocoYaml(YOLO_V8*& p) { function DetectTest (line 149) | void DetectTest() function ClsTest (line 178) | void ClsTest() function main (line 189) | int main() FILE: examples/YOLOv8-ONNXRuntime-Rust/src/cli.rs type Args (line 7) | pub struct Args { FILE: examples/YOLOv8-ONNXRuntime-Rust/src/lib.rs function non_max_suppression (line 14) | pub fn non_max_suppression( function gen_time_string (line 38) | pub fn gen_time_string(delimiter: &str) -> String { constant SKELETON (line 48) | pub const SKELETON: [(usize, usize); 16] = [ function check_font (line 67) | pub fn check_font(font: &str) -> rusttype::Font<'static> { FILE: examples/YOLOv8-ONNXRuntime-Rust/src/main.rs function main (line 5) | fn main() -> Result<(), Box> { FILE: examples/YOLOv8-ONNXRuntime-Rust/src/model.rs type YOLOv8 (line 14) | pub struct YOLOv8 { method new (line 34) | pub fn new(config: Args) -> Result { method scale_wh (line 123) | pub fn scale_wh(&self, w0: f32, h0: f32, w1: f32, h1: f32) -> (f32, f3... method preprocess (line 128) | pub fn preprocess(&mut self, xs: &Vec) -> Result) -> Result &OrtBackend { method conf (line 591) | pub fn conf(&self) -> f32 { method set_conf (line 595) | pub fn set_conf(&mut self, val: f32) { method conf_mut (line 599) | pub fn conf_mut(&mut self) -> &mut f32 { method kconf (line 603) | pub fn kconf(&self) -> f32 { method iou (line 607) | pub fn iou(&self) -> f32 { method task (line 611) | pub fn task(&self) -> &YOLOTask { method batch (line 615) | pub fn batch(&self) -> u32 { method width (line 619) | pub fn width(&self) -> u32 { method height (line 623) | pub fn height(&self) -> u32 { method nc (line 627) | pub fn nc(&self) -> u32 { method nk (line 631) | pub fn nk(&self) -> u32 { method nm (line 635) | pub fn nm(&self) -> u32 { method names (line 639) | pub fn names(&self) -> &Vec { FILE: examples/YOLOv8-ONNXRuntime-Rust/src/ort_backend.rs type YOLOTask (line 11) | pub enum YOLOTask { type OrtEP (line 20) | pub enum OrtEP { type Batch (line 28) | pub struct Batch { method default (line 35) | fn default() -> Self { type OrtInputs (line 45) | pub struct OrtInputs { method new (line 54) | pub fn new(session: &Session) -> Self { type OrtConfig (line 77) | pub struct OrtConfig { type OrtBackend (line 88) | pub struct OrtBackend { method build (line 98) | pub fn build(args: OrtConfig) -> Result { method fetch_inputs_from_session (line 186) | pub fn fetch_inputs_from_session( method set_ep_cuda (line 205) | pub fn set_ep_cuda(device_id: u32) -> (OrtEP, ExecutionProvider) { method set_ep_trt (line 221) | pub fn set_ep_trt( method fetch_from_metadata (line 272) | pub fn fetch_from_metadata(&self, key: &str) -> Option { method run (line 283) | pub fn run(&self, xs: Array, profile: bool) -> Result, profile: bool) -> Result... method run_fp32 (line 337) | pub fn run_fp32(&self, xs: Array, profile: bool) -> Result... method output_shapes (line 367) | pub fn output_shapes(&self) -> Vec> { method output_dtypes (line 379) | pub fn output_dtypes(&self) -> Vec { method input_shapes (line 388) | pub fn input_shapes(&self) -> &Vec> { method input_names (line 392) | pub fn input_names(&self) -> &Vec { method input_dtypes (line 396) | pub fn input_dtypes(&self) -> &Vec { method dtype (line 400) | pub fn dtype(&self) -> TensorElementDataType { method height (line 404) | pub fn height(&self) -> u32 { method width (line 408) | pub fn width(&self) -> u32 { method is_height_dynamic (line 412) | pub fn is_height_dynamic(&self) -> bool { method is_width_dynamic (line 416) | pub fn is_width_dynamic(&self) -> bool { method batch (line 420) | pub fn batch(&self) -> u32 { method is_batch_dynamic (line 424) | pub fn is_batch_dynamic(&self) -> bool { method ep (line 428) | pub fn ep(&self) -> &OrtEP { method task (line 432) | pub fn task(&self) -> YOLOTask { method names (line 436) | pub fn names(&self) -> Option> { method nk (line 452) | pub fn nk(&self) -> Option { method nc (line 464) | pub fn nc(&self) -> Option { method nm (line 505) | pub fn nm(&self) -> Option { method na (line 513) | pub fn na(&self) -> Option { method author (line 527) | pub fn author(&self) -> Option { method version (line 531) | pub fn version(&self) -> Option { FILE: examples/YOLOv8-ONNXRuntime-Rust/src/yolo_result.rs type YOLOResult (line 4) | pub struct YOLOResult { method fmt (line 13) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { method new (line 30) | pub fn new( method probs (line 44) | pub fn probs(&self) -> Option<&Embedding> { method keypoints (line 48) | pub fn keypoints(&self) -> Option<&Vec>> { method masks (line 52) | pub fn masks(&self) -> Option<&Vec>> { method bboxes (line 56) | pub fn bboxes(&self) -> Option<&Vec> { method bboxes_mut (line 60) | pub fn bboxes_mut(&mut self) -> Option<&mut Vec> { type Point2 (line 66) | pub struct Point2 { method new_with_conf (line 74) | pub fn new_with_conf(x: f32, y: f32, confidence: f32) -> Self { method new (line 78) | pub fn new(x: f32, y: f32) -> Self { method x (line 86) | pub fn x(&self) -> f32 { method y (line 90) | pub fn y(&self) -> f32 { method confidence (line 94) | pub fn confidence(&self) -> f32 { type Embedding (line 100) | pub struct Embedding { method new (line 106) | pub fn new(data: Array) -> Self { method data (line 110) | pub fn data(&self) -> &Array { method topk (line 114) | pub fn topk(&self, k: usize) -> Vec<(usize, f32)> { method norm (line 129) | pub fn norm(&self) -> Array { method top1 (line 134) | pub fn top1(&self) -> (usize, f32) { type Bbox (line 140) | pub struct Bbox { method new_from_xywh (line 151) | pub fn new_from_xywh(xmin: f32, ymin: f32, width: f32, height: f32) ->... method new (line 161) | pub fn new(xmin: f32, ymin: f32, width: f32, height: f32, id: usize, c... method width (line 172) | pub fn width(&self) -> f32 { method height (line 176) | pub fn height(&self) -> f32 { method xmin (line 180) | pub fn xmin(&self) -> f32 { method ymin (line 184) | pub fn ymin(&self) -> f32 { method xmax (line 188) | pub fn xmax(&self) -> f32 { method ymax (line 192) | pub fn ymax(&self) -> f32 { method tl (line 196) | pub fn tl(&self) -> Point2 { method br (line 200) | pub fn br(&self) -> Point2 { method cxcy (line 204) | pub fn cxcy(&self) -> Point2 { method id (line 208) | pub fn id(&self) -> usize { method confidence (line 212) | pub fn confidence(&self) -> f32 { method area (line 216) | pub fn area(&self) -> f32 { method intersection_area (line 220) | pub fn intersection_area(&self, another: &Bbox) -> f32 { method union (line 228) | pub fn union(&self, another: &Bbox) -> f32 { method iou (line 232) | pub fn iou(&self, another: &Bbox) -> f32 { FILE: examples/YOLOv8-ONNXRuntime/main.py class YOLOv8 (line 14) | class YOLOv8: method __init__ (line 17) | def __init__(self, onnx_model, input_image, confidence_thres, iou_thres): method draw_detections (line 38) | def draw_detections(self, img, box, score, class_id): method preprocess (line 79) | def preprocess(self): method postprocess (line 110) | def postprocess(self, input_image, output): method main (line 180) | def main(self): FILE: examples/YOLOv8-OpenCV-ONNX-Python/main.py function draw_bounding_box (line 15) | def draw_bounding_box(img, class_id, confidence, x, y, x_plus_w, y_plus_h): function main (line 34) | def main(onnx_model, input_image): FILE: examples/YOLOv8-OpenCV-int8-tflite-Python/main.py class LetterBox (line 17) | class LetterBox: method __init__ (line 18) | def __init__( method __call__ (line 28) | def __call__(self, labels=None, image=None): method _update_labels (line 77) | def _update_labels(self, labels, ratio, padw, padh): class Yolov8TFLite (line 87) | class Yolov8TFLite: method __init__ (line 88) | def __init__(self, tflite_model, input_image, confidence_thres, iou_th... method draw_detections (line 110) | def draw_detections(self, img, box, score, class_id): method preprocess (line 155) | def preprocess(self): method postprocess (line 180) | def postprocess(self, input_image, output): method main (line 229) | def main(self): FILE: examples/YOLOv8-Region-Counter/yolov8_region_counter.py function mouse_callback (line 39) | def mouse_callback(event, x, y, flags, param): function run (line 93) | def run( function parse_opt (line 227) | def parse_opt(): function main (line 244) | def main(opt): FILE: examples/YOLOv8-SAHI-Inference-Video/yolov8_sahi.py function run (line 14) | def run(weights="yolov8n.pt", source="test.mp4", view_img=False, save_im... function parse_opt (line 93) | def parse_opt(): function main (line 104) | def main(opt): FILE: examples/YOLOv8-Segmentation-ONNXRuntime-Python/main.py class YOLOv8Seg (line 14) | class YOLOv8Seg: method __init__ (line 17) | def __init__(self, onnx_model): method __call__ (line 45) | def __call__(self, im0, conf_threshold=0.4, iou_threshold=0.45, nm=32): method preprocess (line 80) | def preprocess(self, img): method postprocess (line 112) | def postprocess(self, preds, im0, ratio, pad_w, pad_h, conf_threshold,... method masks2segments (line 170) | def masks2segments(masks): method crop_mask (line 192) | def crop_mask(masks, boxes): method process_mask (line 210) | def process_mask(self, protos, masks_in, bboxes, im0_shape): method scale_mask (line 233) | def scale_mask(masks, im0_shape, ratio_pad=None): method draw_and_visualize (line 266) | def draw_and_visualize(self, im, bboxes, segments, vis=False, save=True): FILE: ultralytics/cfg/__init__.py function cfg2dict (line 178) | def cfg2dict(cfg): function get_cfg (line 195) | def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_D... function check_cfg (line 231) | def check_cfg(cfg, hard=True): function get_save_dir (line 267) | def get_save_dir(args, name=None): function _handle_deprecation (line 282) | def _handle_deprecation(custom): function check_dict_alignment (line 302) | def check_dict_alignment(base: Dict, custom: Dict, e=None): function merge_equals_args (line 327) | def merge_equals_args(args: List[str]) -> List[str]: function handle_yolo_hub (line 353) | def handle_yolo_hub(args: List[str]) -> None: function handle_yolo_settings (line 379) | def handle_yolo_settings(args: List[str]) -> None: function handle_explorer (line 412) | def handle_explorer(): function parse_key_value_pair (line 419) | def parse_key_value_pair(pair): function smart_value (line 427) | def smart_value(v): function entrypoint (line 442) | def entrypoint(debug=""): function copy_default_cfg (line 601) | def copy_default_cfg(): FILE: ultralytics/data/annotator.py function auto_annotate (line 8) | def auto_annotate(data, det_model="yolov8x.pt", sam_model="sam_b.pt", de... FILE: ultralytics/data/augment.py class BaseTransform (line 26) | class BaseTransform: method __init__ (line 41) | def __init__(self) -> None: method apply_image (line 45) | def apply_image(self, labels): method apply_instances (line 49) | def apply_instances(self, labels): method apply_semantic (line 53) | def apply_semantic(self, labels): method __call__ (line 57) | def __call__(self, labels): class Compose (line 64) | class Compose: method __init__ (line 67) | def __init__(self, transforms): method __call__ (line 71) | def __call__(self, data): method append (line 77) | def append(self, transform): method tolist (line 81) | def tolist(self): method __repr__ (line 85) | def __repr__(self): class BaseMixTransform (line 90) | class BaseMixTransform: method __init__ (line 97) | def __init__(self, dataset, pre_transform=None, p=0.0) -> None: method __call__ (line 103) | def __call__(self, labels): method _mix_transform (line 126) | def _mix_transform(self, labels): method get_indexes (line 130) | def get_indexes(self): class Mosaic (line 135) | class Mosaic(BaseMixTransform): method __init__ (line 149) | def __init__(self, dataset, imgsz=640, p=1.0, n=4): method get_indexes (line 159) | def get_indexes(self, buffer=True): method _mix_transform (line 166) | def _mix_transform(self, labels): method _mosaic3 (line 174) | def _mosaic3(self, labels): method _mosaic4 (line 208) | def _mosaic4(self, labels): method _mosaic9 (line 244) | def _mosaic9(self, labels): method _update_labels (line 293) | def _update_labels(labels, padw, padh): method _cat_labels (line 301) | def _cat_labels(self, mosaic_labels): class MixUp (line 326) | class MixUp(BaseMixTransform): method __init__ (line 329) | def __init__(self, dataset, pre_transform=None, p=0.0) -> None: method get_indexes (line 333) | def get_indexes(self): method _mix_transform (line 337) | def _mix_transform(self, labels): class RandomPerspective (line 347) | class RandomPerspective: method __init__ (line 371) | def __init__( method affine_transform (line 384) | def affine_transform(self, img, border): method apply_bboxes (line 437) | def apply_bboxes(self, bboxes, M): method apply_segments (line 462) | def apply_segments(self, segments, M): method apply_keypoints (line 489) | def apply_keypoints(self, keypoints, M): method __call__ (line 512) | def __call__(self, labels): method box_candidates (line 562) | def box_candidates(self, box1, box2, wh_thr=2, ar_thr=100, area_thr=0.... class RandomHSV (line 584) | class RandomHSV: method __init__ (line 592) | def __init__(self, hgain=0.5, sgain=0.5, vgain=0.5) -> None: method __call__ (line 605) | def __call__(self, labels): class RandomFlip (line 627) | class RandomFlip: method __init__ (line 634) | def __init__(self, p=0.5, direction="horizontal", flip_idx=None) -> None: method __call__ (line 651) | def __call__(self, labels): class LetterBox (line 684) | class LetterBox: method __init__ (line 687) | def __init__(self, new_shape=(640, 640), auto=False, scaleFill=False, ... method __call__ (line 696) | def __call__(self, labels=None, image=None): method _update_labels (line 744) | def _update_labels(self, labels, ratio, padw, padh): class CopyPaste (line 753) | class CopyPaste: method __init__ (line 759) | def __init__(self, p=0.5) -> None: method __call__ (line 769) | def __call__(self, labels): class Albumentations (line 819) | class Albumentations: method __init__ (line 828) | def __init__(self, p=1.0): method __call__ (line 856) | def __call__(self, labels): class Format (line 876) | class Format: method __init__ (line 892) | def __init__( method __call__ (line 915) | def __call__(self, labels): method _format_img (line 950) | def _format_img(self, img): method _format_segments (line 959) | def _format_segments(self, instances, cls, w, h): function v8_transforms (line 973) | def v8_transforms(dataset, imgsz, hyp, stretch=False): function classify_transforms (line 1011) | def classify_transforms( function classify_augmentations (line 1060) | def classify_augmentations( class ClassifyLetterBox (line 1154) | class ClassifyLetterBox: method __init__ (line 1166) | def __init__(self, size=(640, 640), auto=False, stride=32): method __call__ (line 1180) | def __call__(self, im): class CenterCrop (line 1205) | class CenterCrop: method __init__ (line 1210) | def __init__(self, size=640): method __call__ (line 1215) | def __call__(self, im): class ToTensor (line 1232) | class ToTensor: method __init__ (line 1235) | def __init__(self, half=False): method __call__ (line 1240) | def __call__(self, im): FILE: ultralytics/data/base.py class BaseDataset (line 21) | class BaseDataset(Dataset): method __init__ (line 49) | def __init__( method get_img_files (line 100) | def get_img_files(self, img_path): method update_labels (line 128) | def update_labels(self, include_class: Optional[list]): method load_image (line 147) | def load_image(self, i, rect_mode=True): method cache_images (line 184) | def cache_images(self, cache): method cache_images_to_disk (line 200) | def cache_images_to_disk(self, i): method check_cache_ram (line 206) | def check_cache_ram(self, safety_margin=0.5): method set_rectangle (line 226) | def set_rectangle(self): method __getitem__ (line 251) | def __getitem__(self, index): method get_image_and_label (line 255) | def get_image_and_label(self, index): method __len__ (line 268) | def __len__(self): method update_labels_info (line 272) | def update_labels_info(self, label): method build_transforms (line 276) | def build_transforms(self, hyp=None): method get_labels (line 292) | def get_labels(self): FILE: ultralytics/data/build.py class InfiniteDataLoader (line 29) | class InfiniteDataLoader(dataloader.DataLoader): method __init__ (line 36) | def __init__(self, *args, **kwargs): method __len__ (line 42) | def __len__(self): method __iter__ (line 46) | def __iter__(self): method reset (line 51) | def reset(self): class _RepeatSampler (line 60) | class _RepeatSampler: method __init__ (line 68) | def __init__(self, sampler): method __iter__ (line 72) | def __iter__(self): function seed_worker (line 78) | def seed_worker(worker_id): # noqa function build_yolo_dataset (line 85) | def build_yolo_dataset(cfg, img_path, batch, data, mode="train", rect=Fa... function build_dataloader (line 106) | def build_dataloader(dataset, batch, workers, shuffle=True, rank=-1): function check_source (line 127) | def check_source(source): function load_inference_source (line 153) | def load_inference_source(source=None, batch=1, vid_stride=1, buffer=Fal... FILE: ultralytics/data/converter.py function coco91_to_coco80_class (line 14) | def coco91_to_coco80_class(): function coco80_to_coco91_class (line 117) | def coco80_to_coco91_class(): function convert_coco (line 216) | def convert_coco( function convert_dota_to_yolo_obb (line 320) | def convert_dota_to_yolo_obb(dota_root_path: str): function min_index (line 416) | def min_index(arr1, arr2): function merge_multi_segment (line 431) | def merge_multi_segment(segments): function yolo_bbox2segment (line 481) | def yolo_bbox2segment(im_dir, save_dir=None, sam_model="sam_b.pt"): FILE: ultralytics/data/dataset.py class YOLODataset (line 23) | class YOLODataset(BaseDataset): method __init__ (line 35) | def __init__(self, *args, data=None, task="detect", **kwargs): method cache_labels (line 44) | def cache_labels(self, path=Path("./labels.cache")): method get_labels (line 111) | def get_labels(self): method build_transforms (line 152) | def build_transforms(self, hyp=None): method close_mosaic (line 175) | def close_mosaic(self, hyp): method update_labels_info (line 182) | def update_labels_info(self, label): method collate_fn (line 208) | def collate_fn(batch): class ClassificationDataset (line 228) | class ClassificationDataset(torchvision.datasets.ImageFolder): method __init__ (line 246) | def __init__(self, root, args, augment=False, prefix=""): method __getitem__ (line 285) | def __getitem__(self, i): method __len__ (line 301) | def __len__(self) -> int: method verify_images (line 305) | def verify_images(self): function load_dataset_cache_file (line 345) | def load_dataset_cache_file(path): function save_dataset_cache_file (line 355) | def save_dataset_cache_file(prefix, path, x): class SemanticDataset (line 369) | class SemanticDataset(BaseDataset): method __init__ (line 381) | def __init__(self): FILE: ultralytics/data/explorer/explorer.py class ExplorerDataset (line 23) | class ExplorerDataset(YOLODataset): method __init__ (line 24) | def __init__(self, *args, data: dict = None, **kwargs) -> None: method load_image (line 27) | def load_image(self, i: int) -> Union[Tuple[np.ndarray, Tuple[int, int... method build_transforms (line 42) | def build_transforms(self, hyp: IterableSimpleNamespace = None): class Explorer (line 55) | class Explorer: method __init__ (line 56) | def __init__( method create_embeddings_table (line 78) | def create_embeddings_table(self, force: bool = False, split: str = "t... method _yield_batches (line 130) | def _yield_batches(self, dataset: ExplorerDataset, data_info: dict, mo... method query (line 141) | def query( method sql_query (line 173) | def sql_query( method plot_sql_query (line 219) | def plot_sql_query(self, query: str, labels: bool = True) -> Image.Image: method get_similar (line 244) | def get_similar( method plot_similar (line 282) | def plot_similar( method similarity_index (line 315) | def similarity_index(self, max_dist: float = 0.2, top_k: float = None,... method plot_similarity_index (line 374) | def plot_similarity_index(self, max_dist: float = 0.2, top_k: float = ... method _check_imgs_or_idxs (line 418) | def _check_imgs_or_idxs( method ask_ai (line 431) | def ask_ai(self, query): method visualize (line 457) | def visualize(self, result): method generate_report (line 466) | def generate_report(self, result): FILE: ultralytics/data/explorer/gui/dash.py function _get_explorer (line 18) | def _get_explorer(): function init_explorer_form (line 34) | def init_explorer_form(): function query_form (line 66) | def query_form(): function ai_query_form (line 81) | def ai_query_form(): function find_similar_imgs (line 91) | def find_similar_imgs(imgs): function similarity_form (line 100) | def similarity_form(selected_imgs): function run_sql_query (line 133) | def run_sql_query(): function run_ai_query (line 144) | def run_ai_query(): function reset_explorer (line 163) | def reset_explorer(): function utralytics_explorer_docs_callback (line 170) | def utralytics_explorer_docs_callback(): function layout (line 185) | def layout(): FILE: ultralytics/data/explorer/utils.py function get_table_schema (line 18) | def get_table_schema(vector_size): function get_sim_index_schema (line 34) | def get_sim_index_schema(): function sanitize_batch (line 47) | def sanitize_batch(batch, dataset_info): function plot_query_result (line 59) | def plot_query_result(similar_set, plot_labels=True): function prompt_sql_query (line 112) | def prompt_sql_query(query): FILE: ultralytics/data/loaders.py class SourceTypes (line 24) | class SourceTypes: class LoadStreams (line 33) | class LoadStreams: method __init__ (line 65) | def __init__(self, sources="file.streams", vid_stride=1, buffer=False): method update (line 116) | def update(self, i, cap, stream): method close (line 136) | def close(self): method __iter__ (line 149) | def __iter__(self): method __next__ (line 154) | def __next__(self): method __len__ (line 181) | def __len__(self): class LoadScreenshots (line 186) | class LoadScreenshots: method __init__ (line 211) | def __init__(self, source): method __iter__ (line 238) | def __iter__(self): method __next__ (line 242) | def __next__(self): class LoadImagesAndVideos (line 251) | class LoadImagesAndVideos: method __init__ (line 274) | def __init__(self, path, batch=1, vid_stride=1): method __iter__ (line 315) | def __iter__(self): method __next__ (line 320) | def __next__(self): method _new_video (line 372) | def _new_video(self, path): method __len__ (line 381) | def __len__(self): class LoadPilAndNumpy (line 386) | class LoadPilAndNumpy: method __init__ (line 404) | def __init__(self, im0): method _single_check (line 414) | def _single_check(im): method __len__ (line 424) | def __len__(self): method __next__ (line 428) | def __next__(self): method __iter__ (line 435) | def __iter__(self): class LoadTensor (line 441) | class LoadTensor: method __init__ (line 458) | def __init__(self, im0) -> None: method _single_check (line 466) | def _single_check(im, stride=32): method __iter__ (line 488) | def __iter__(self): method __next__ (line 493) | def __next__(self): method __len__ (line 500) | def __len__(self): function autocast_list (line 505) | def autocast_list(source): function get_best_youtube_url (line 522) | def get_best_youtube_url(url, use_pafy=True): FILE: ultralytics/data/split_dota.py function bbox_iof (line 20) | def bbox_iof(polygon1, bbox2, eps=1e-6): function load_yolo_dota (line 56) | def load_yolo_dota(data_root, split="train"): function get_windows (line 89) | def get_windows(im_size, crop_sizes=[1024], gaps=[200], im_rate_thr=0.6,... function get_window_obj (line 132) | def get_window_obj(anno, windows, iof_thr=0.7): function crop_and_save (line 146) | def crop_and_save(anno, windows, window_objs, im_dir, lb_dir): function split_images_and_labels (line 190) | def split_images_and_labels(data_root, save_dir, split="train", crop_siz... function split_trainval (line 220) | def split_trainval(data_root, save_dir, crop_size=1024, gap=200, rates=[... function split_test (line 250) | def split_test(data_root, save_dir, crop_size=1024, gap=200, rates=[1.0]): FILE: ultralytics/data/utils.py function img2label_paths (line 43) | def img2label_paths(img_paths): function get_hash (line 49) | def get_hash(paths): function exif_size (line 57) | def exif_size(img: Image.Image): function verify_image (line 70) | def verify_image(args): function verify_image_label (line 95) | def verify_image_label(args): function polygon2mask (line 167) | def polygon2mask(imgsz, polygons, color=1, downsample_ratio=1): function polygons2masks (line 190) | def polygons2masks(imgsz, polygons, color, downsample_ratio=1): function polygons2masks_overlap (line 207) | def polygons2masks_overlap(imgsz, segments, downsample_ratio=1): function find_dataset_yaml (line 229) | def find_dataset_yaml(path: Path) -> Path: function check_det_dataset (line 251) | def check_det_dataset(dataset, autodownload=True): function check_cls_dataset (line 345) | def check_cls_dataset(dataset, split=""): class HUBDatasetStats (line 424) | class HUBDatasetStats: method __init__ (line 449) | def __init__(self, path="coco8.yaml", task="detect", autodownload=False): method _unzip (line 477) | def _unzip(path): method _hub_ops (line 487) | def _hub_ops(self, f): method get_json (line 491) | def get_json(self, save=False, verbose=False): method process_images (line 565) | def process_images(self): function compress_one_image (line 581) | def compress_one_image(f, f_new=None, max_dim=1920, quality=50): function autosplit (line 619) | def autosplit(path=DATASETS_DIR / "coco8/images", weights=(0.9, 0.1, 0.0... FILE: ultralytics/engine/exporter.py function export_formats (line 93) | def export_formats(): function gd_outputs (line 115) | def gd_outputs(gd): function try_export (line 124) | def try_export(inner_func): class Exporter (line 143) | class Exporter: method __init__ (line 152) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method __call__ (line 169) | def __call__(self, model=None): method export_torchscript (line 337) | def export_torchscript(self, prefix=colorstr("TorchScript:")): method export_onnx (line 354) | def export_onnx(self, prefix=colorstr("ONNX:")): method export_openvino (line 415) | def export_openvino(self, prefix=colorstr("OpenVINO:")): method export_paddle (line 500) | def export_paddle(self, prefix=colorstr("PaddlePaddle:")): method export_ncnn (line 514) | def export_ncnn(self, prefix=colorstr("NCNN:")): method export_coreml (line 583) | def export_coreml(self, prefix=colorstr("CoreML:")): method export_engine (line 656) | def export_engine(self, prefix=colorstr("TensorRT:")): method export_saved_model (line 727) | def export_saved_model(self, prefix=colorstr("TensorFlow SavedModel:")): method export_pb (line 828) | def export_pb(self, keras_model, prefix=colorstr("TensorFlow GraphDef:... method export_tflite (line 844) | def export_tflite(self, keras_model, nms, agnostic_nms, prefix=colorst... method export_edgetpu (line 859) | def export_edgetpu(self, tflite_model="", prefix=colorstr("Edge TPU:")): method export_tfjs (line 889) | def export_tfjs(self, prefix=colorstr("TensorFlow.js:")): method _add_tflite_metadata (line 937) | def _add_tflite_metadata(self, file): method _pipeline_coreml (line 995) | def _pipeline_coreml(self, model, weights_dir=None, prefix=colorstr("C... method add_callback (line 1117) | def add_callback(self, event: str, callback): method run_callbacks (line 1121) | def run_callbacks(self, event: str): class IOSDetectModel (line 1127) | class IOSDetectModel(torch.nn.Module): method __init__ (line 1130) | def __init__(self, model, im): method forward (line 1141) | def forward(self, x): FILE: ultralytics/engine/model.py class Model (line 17) | class Model(nn.Module): method __init__ (line 84) | def __init__( method __call__ (line 143) | def __call__( method _get_hub_session (line 169) | def _get_hub_session(model: str): method is_triton_model (line 177) | def is_triton_model(model: str) -> bool: method is_hub_model (line 185) | def is_hub_model(model: str) -> bool: method _new (line 195) | def _new(self, cfg: str, task=None, model=None, verbose=False) -> None: method _load (line 217) | def _load(self, weights: str, task=None) -> None: method _check_is_pytorch_model (line 243) | def _check_is_pytorch_model(self) -> None: method reset_weights (line 256) | def reset_weights(self) -> "Model": method load (line 278) | def load(self, weights: Union[str, Path] = "yolov8n.pt") -> "Model": method save (line 300) | def save(self, filename: Union[str, Path] = "saved_model.pt", use_dill... method info (line 325) | def info(self, detailed: bool = False, verbose: bool = True): method fuse (line 345) | def fuse(self): method embed (line 357) | def embed( method predict (line 385) | def predict( method track (line 443) | def track( method val (line 483) | def val( method benchmark (line 520) | def benchmark( method export (line 561) | def export( method train (line 592) | def train( method tune (line 666) | def tune( method _apply (line 705) | def _apply(self, fn) -> "Model": method names (line 714) | def names(self) -> list: method device (line 729) | def device(self) -> torch.device: method transforms (line 742) | def transforms(self): method add_callback (line 753) | def add_callback(self, event: str, func) -> None: method clear_callback (line 769) | def clear_callback(self, event: str) -> None: method reset_callbacks (line 783) | def reset_callbacks(self) -> None: method _reset_ckpt_args (line 794) | def _reset_ckpt_args(args: dict) -> dict: method _smart_load (line 804) | def _smart_load(self, key: str): method task_map (line 816) | def task_map(self) -> dict: FILE: ultralytics/engine/predictor.py class BasePredictor (line 63) | class BasePredictor: method __init__ (line 80) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method preprocess (line 115) | def preprocess(self, im): method inference (line 135) | def inference(self, im, *args, **kwargs): method pre_transform (line 144) | def pre_transform(self, im): method postprocess (line 158) | def postprocess(self, preds, img, orig_imgs): method __call__ (line 162) | def __call__(self, source=None, model=None, stream=False, *args, **kwa... method predict_cli (line 170) | def predict_cli(self, source=None, model=None): method setup_source (line 180) | def setup_source(self, source): method stream_inference (line 209) | def stream_inference(self, source=None, model=None, *args, **kwargs): method setup_model (line 295) | def setup_model(self, model, verbose=True): method write_results (line 312) | def write_results(self, i, p, im, s): method save_predicted_images (line 352) | def save_predicted_images(self, save_path="", frame=0): method show (line 380) | def show(self, p=""): method run_callbacks (line 390) | def run_callbacks(self, event: str): method add_callback (line 395) | def add_callback(self, event: str, func): FILE: ultralytics/engine/results.py class BaseTensor (line 21) | class BaseTensor(SimpleClass): method __init__ (line 24) | def __init__(self, data, orig_shape) -> None: method shape (line 37) | def shape(self): method cpu (line 41) | def cpu(self): method numpy (line 45) | def numpy(self): method cuda (line 49) | def cuda(self): method to (line 53) | def to(self, *args, **kwargs): method __len__ (line 57) | def __len__(self): # override len(results) method __getitem__ (line 61) | def __getitem__(self, idx): class Results (line 66) | class Results(SimpleClass): method __init__ (line 97) | def __init__(self, orig_img, path, names, boxes=None, masks=None, prob... method __getitem__ (line 124) | def __getitem__(self, idx): method __len__ (line 128) | def __len__(self): method update (line 135) | def update(self, boxes=None, masks=None, probs=None, obb=None): method _apply (line 146) | def _apply(self, fn, *args, **kwargs): method cpu (line 166) | def cpu(self): method numpy (line 170) | def numpy(self): method cuda (line 174) | def cuda(self): method to (line 178) | def to(self, *args, **kwargs): method new (line 182) | def new(self): method plot (line 186) | def plot( method show (line 304) | def show(self, *args, **kwargs): method save (line 308) | def save(self, filename=None, *args, **kwargs): method verbose (line 315) | def verbose(self): method save_txt (line 330) | def save_txt(self, txt_file, save_conf=False): method save_crop (line 366) | def save_crop(self, save_dir, file_name=Path("im.jpg")): method summary (line 388) | def summary(self, normalize=False, decimals=5): method tojson (line 426) | def tojson(self, normalize=False, decimals=5): class Boxes (line 433) | class Boxes(BaseTensor): method __init__ (line 460) | def __init__(self, boxes, orig_shape) -> None: method xyxy (line 479) | def xyxy(self): method conf (line 484) | def conf(self): method cls (line 489) | def cls(self): method id (line 494) | def id(self): method xywh (line 500) | def xywh(self): method xyxyn (line 506) | def xyxyn(self): method xywhn (line 515) | def xywhn(self): class Masks (line 523) | class Masks(BaseTensor): method __init__ (line 538) | def __init__(self, masks, orig_shape) -> None: method xyn (line 546) | def xyn(self): method xy (line 555) | def xy(self): class Keypoints (line 563) | class Keypoints(BaseTensor): method __init__ (line 580) | def __init__(self, keypoints, orig_shape) -> None: method xy (line 592) | def xy(self): method xyn (line 598) | def xyn(self): method conf (line 607) | def conf(self): class Probs (line 612) | class Probs(BaseTensor): method __init__ (line 629) | def __init__(self, probs, orig_shape=None) -> None: method top1 (line 635) | def top1(self): method top5 (line 641) | def top5(self): method top1conf (line 647) | def top1conf(self): method top5conf (line 653) | def top5conf(self): class OBB (line 658) | class OBB(BaseTensor): method __init__ (line 685) | def __init__(self, boxes, orig_shape) -> None: method xywhr (line 696) | def xywhr(self): method conf (line 701) | def conf(self): method cls (line 706) | def cls(self): method id (line 711) | def id(self): method xyxyxyxy (line 717) | def xyxyxyxy(self): method xyxyxyxyn (line 723) | def xyxyxyxyn(self): method xyxy (line 732) | def xyxy(self): FILE: ultralytics/engine/trainer.py class BaseTrainer (line 53) | class BaseTrainer: method __init__ (line 90) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method add_callback (line 165) | def add_callback(self, event: str, callback): method set_callback (line 169) | def set_callback(self, event: str, callback): method run_callbacks (line 173) | def run_callbacks(self, event: str): method train (line 178) | def train(self): method _setup_scheduler (line 215) | def _setup_scheduler(self): method _setup_ddp (line 223) | def _setup_ddp(self, world_size): method _setup_train (line 236) | def _setup_train(self, world_size): method _do_train (line 323) | def _do_train(self, world_size=1): method save_model (line 479) | def save_model(self): method get_dataset (line 509) | def get_dataset(data): method setup_model (line 517) | def setup_model(self): method optimizer_step (line 532) | def optimizer_step(self): method preprocess_batch (line 542) | def preprocess_batch(self, batch): method validate (line 546) | def validate(self): method get_model (line 558) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 562) | def get_validator(self): method get_dataloader (line 566) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="tr... method build_dataset (line 570) | def build_dataset(self, img_path, mode="train", batch=None): method label_loss_items (line 574) | def label_loss_items(self, loss_items=None, prefix="train"): method set_model_attributes (line 583) | def set_model_attributes(self): method build_targets (line 587) | def build_targets(self, preds, targets): method progress_string (line 591) | def progress_string(self): method plot_training_samples (line 596) | def plot_training_samples(self, batch, ni): method plot_training_labels (line 600) | def plot_training_labels(self): method save_metrics (line 604) | def save_metrics(self, metrics): method plot_metrics (line 612) | def plot_metrics(self): method on_plot (line 616) | def on_plot(self, name, data=None): method final_eval (line 621) | def final_eval(self): method check_resume (line 633) | def check_resume(self, overrides): method resume_training (line 660) | def resume_training(self, ckpt): method _close_dataloader_mosaic (line 687) | def _close_dataloader_mosaic(self): method build_optimizer (line 695) | def build_optimizer(self, model, name="auto", lr=0.001, momentum=0.9, ... FILE: ultralytics/engine/tuner.py class Tuner (line 33) | class Tuner: method __init__ (line 70) | def __init__(self, args=DEFAULT_CFG, _callbacks=None): method _mutate (line 114) | def _mutate(self, parent="single", n=5, mutation=0.8, sigma=0.2): method __call__ (line 160) | def __call__(self, model=None, iterations=10, cleanup=True): FILE: ultralytics/engine/validator.py class BaseValidator (line 39) | class BaseValidator: method __init__ (line 68) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method __call__ (line 106) | def __call__(self, trainer=None, model=None): method match_predictions (line 226) | def match_predictions(self, pred_classes, true_classes, iou, use_scipy... method add_callback (line 268) | def add_callback(self, event: str, callback): method run_callbacks (line 272) | def run_callbacks(self, event: str): method get_dataloader (line 277) | def get_dataloader(self, dataset_path, batch_size): method build_dataset (line 281) | def build_dataset(self, img_path): method preprocess (line 285) | def preprocess(self, batch): method postprocess (line 289) | def postprocess(self, preds): method init_metrics (line 293) | def init_metrics(self, model): method update_metrics (line 297) | def update_metrics(self, preds, batch): method finalize_metrics (line 301) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 305) | def get_stats(self): method check_stats (line 309) | def check_stats(self, stats): method print_results (line 313) | def print_results(self): method get_desc (line 317) | def get_desc(self): method metric_keys (line 322) | def metric_keys(self): method on_plot (line 326) | def on_plot(self, name, data=None): method plot_val_samples (line 331) | def plot_val_samples(self, batch, ni): method plot_predictions (line 335) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 339) | def pred_to_json(self, preds, batch): method eval_json (line 343) | def eval_json(self, stats): FILE: ultralytics/hub/__init__.py function login (line 11) | def login(api_key: str = None, save=True) -> bool: function logout (line 55) | def logout(): function reset_model (line 71) | def reset_model(model_id=""): function export_fmts_hub (line 80) | def export_fmts_hub(): function export_model (line 87) | def export_model(model_id="", format="torchscript"): function get_export (line 97) | def get_export(model_id="", format="torchscript"): function check_dataset (line 109) | def check_dataset(path="", task="detect"): FILE: ultralytics/hub/auth.py class Auth (line 11) | class Auth: method __init__ (line 28) | def __init__(self, api_key="", verbose=False): method request_api_key (line 69) | def request_api_key(self, max_attempts=3): method authenticate (line 85) | def authenticate(self) -> bool: method auth_with_cookies (line 104) | def auth_with_cookies(self) -> bool: method get_auth_header (line 125) | def get_auth_header(self): FILE: ultralytics/hub/session.py class HUBTrainingSession (line 17) | class HUBTrainingSession: method __init__ (line 34) | def __init__(self, identifier): method load_model (line 73) | def load_model(self, model_id): method create_model (line 87) | def create_model(self, model_args): method _parse_identifier (line 125) | def _parse_identifier(self, identifier): method _set_train_args (line 173) | def _set_train_args(self): method request_queue (line 208) | def request_queue( method _should_retry (line 268) | def _should_retry(self, status_code): method _get_failure_message (line 277) | def _get_failure_message(self, response: requests.Response, retry: int... method upload_metrics (line 303) | def upload_metrics(self): method upload_model (line 307) | def upload_model( method _show_upload_progress (line 342) | def _show_upload_progress(self, content_length: int, response: request... FILE: ultralytics/hub/utils.py function request_with_credentials (line 38) | def request_with_credentials(url: str) -> any: function requests_with_progress (line 80) | def requests_with_progress(method, url, **kwargs): function smart_request (line 112) | def smart_request(method, url, retry=3, timeout=30, thread=True, code=-1... class Events (line 171) | class Events: method __init__ (line 185) | def __init__(self): method __call__ (line 207) | def __call__(self, cfg): FILE: ultralytics/models/fastsam/model.py class FastSAM (line 10) | class FastSAM(Model): method __init__ (line 23) | def __init__(self, model="FastSAM-x.pt"): method task_map (line 31) | def task_map(self): FILE: ultralytics/models/fastsam/predict.py class FastSAMPredictor (line 11) | class FastSAMPredictor(DetectionPredictor): method __init__ (line 26) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 38) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/fastsam/prompt.py class FastSAMPrompt (line 15) | class FastSAMPrompt: method __init__ (line 26) | def __init__(self, source, results, device="cuda") -> None: method _segment_image (line 43) | def _segment_image(image, bbox): method _format_results (line 59) | def _format_results(result, filter=0): method _get_bbox_from_mask (line 79) | def _get_bbox_from_mask(mask): method plot (line 96) | def plot( method fast_show_mask (line 181) | def fast_show_mask( method retrieve (line 248) | def retrieve(self, model, preprocess, elements, search_text: str, devi... method _crop_image (line 260) | def _crop_image(self, format_results): method box_prompt (line 284) | def box_prompt(self, bbox): method point_prompt (line 319) | def point_prompt(self, points, pointlabel): # numpy method text_prompt (line 342) | def text_prompt(self, text): method everything_prompt (line 355) | def everything_prompt(self): FILE: ultralytics/models/fastsam/utils.py function adjust_bboxes_to_image_border (line 6) | def adjust_bboxes_to_image_border(boxes, image_shape, threshold=20): function bbox_iou (line 30) | def bbox_iou(box1, boxes, iou_thres=0.9, image_shape=(640, 640), raw_out... FILE: ultralytics/models/fastsam/val.py class FastSAMValidator (line 7) | class FastSAMValidator(SegmentationValidator): method __init__ (line 23) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... FILE: ultralytics/models/nas/model.py class NAS (line 24) | class NAS(Model): method __init__ (line 46) | def __init__(self, model="yolo_nas_s.pt") -> None: method _load (line 52) | def _load(self, weights: str, task: str): method info (line 70) | def info(self, detailed=False, verbose=True): method task_map (line 81) | def task_map(self): FILE: ultralytics/models/nas/predict.py class NASPredictor (line 10) | class NASPredictor(BasePredictor): method postprocess (line 35) | def postprocess(self, preds_in, img, orig_imgs): FILE: ultralytics/models/nas/val.py class NASValidator (line 11) | class NASValidator(DetectionValidator): method postprocess (line 37) | def postprocess(self, preds_in): FILE: ultralytics/models/rtdetr/model.py class RTDETR (line 18) | class RTDETR(Model): method __init__ (line 27) | def __init__(self, model="rtdetr-l.pt") -> None: method task_map (line 40) | def task_map(self) -> dict: FILE: ultralytics/models/rtdetr/predict.py class RTDETRPredictor (line 11) | class RTDETRPredictor(BasePredictor): method postprocess (line 34) | def postprocess(self, preds, img, orig_imgs): method pre_transform (line 74) | def pre_transform(self, im): FILE: ultralytics/models/rtdetr/train.py class RTDETRTrainer (line 13) | class RTDETRTrainer(DetectionTrainer): method get_model (line 33) | def get_model(self, cfg=None, weights=None, verbose=True): method build_dataset (line 50) | def build_dataset(self, img_path, mode="val", batch=None): method get_validator (line 74) | def get_validator(self): method preprocess_batch (line 84) | def preprocess_batch(self, batch): FILE: ultralytics/models/rtdetr/val.py class RTDETRDataset (line 13) | class RTDETRDataset(YOLODataset): method __init__ (line 21) | def __init__(self, *args, data=None, **kwargs): method load_image (line 26) | def load_image(self, i, rect_mode=False): method build_transforms (line 30) | def build_transforms(self, hyp=None): class RTDETRValidator (line 53) | class RTDETRValidator(DetectionValidator): method build_dataset (line 74) | def build_dataset(self, img_path, mode="val", batch=None): method postprocess (line 95) | def postprocess(self, preds): method _prepare_batch (line 116) | def _prepare_batch(self, si, batch): method _prepare_pred (line 130) | def _prepare_pred(self, pred, pbatch): FILE: ultralytics/models/sam/amg.py function is_box_near_crop_edge (line 11) | def is_box_near_crop_edge( function batch_iterator (line 24) | def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None,... function calculate_stability_score (line 32) | def calculate_stability_score(masks: torch.Tensor, mask_threshold: float... function build_point_grid (line 48) | def build_point_grid(n_per_side: int) -> np.ndarray: function build_all_layer_point_grids (line 57) | def build_all_layer_point_grids(n_per_side: int, n_layers: int, scale_pe... function generate_crop_boxes (line 62) | def generate_crop_boxes( function uncrop_boxes_xyxy (line 101) | def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch... function uncrop_points (line 111) | def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Te... function uncrop_masks (line 121) | def uncrop_masks(masks: torch.Tensor, crop_box: List[int], orig_h: int, ... function remove_small_regions (line 132) | def remove_small_regions(mask: np.ndarray, area_thresh: float, mode: str... function batched_mask_to_box (line 152) | def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: FILE: ultralytics/models/sam/build.py function build_sam_vit_h (line 21) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 32) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 43) | def build_sam_vit_b(checkpoint=None): function build_mobile_sam (line 54) | def build_mobile_sam(checkpoint=None): function _build_sam (line 66) | def _build_sam( function build_sam (line 149) | def build_sam(ckpt="sam_b.pt"): FILE: ultralytics/models/sam/model.py class SAM (line 25) | class SAM(Model): method __init__ (line 34) | def __init__(self, model="sam_b.pt") -> None: method _load (line 48) | def _load(self, weights: str, task=None): method predict (line 58) | def predict(self, source, stream=False, bboxes=None, points=None, labe... method __call__ (line 77) | def __call__(self, source=None, stream=False, bboxes=None, points=None... method info (line 93) | def info(self, detailed=False, verbose=True): method task_map (line 107) | def task_map(self): FILE: ultralytics/models/sam/modules/decoders.py class MaskDecoder (line 12) | class MaskDecoder(nn.Module): method __init__ (line 29) | def __init__( method forward (line 73) | def forward( method predict_masks (line 110) | def predict_masks( class MLP (line 154) | class MLP(nn.Module): method __init__ (line 160) | def __init__( method forward (line 184) | def forward(self, x): FILE: ultralytics/models/sam/modules/encoders.py class ImageEncoderViT (line 13) | class ImageEncoderViT(nn.Module): method __init__ (line 30) | def __init__( method forward (line 116) | def forward(self, x: torch.Tensor) -> torch.Tensor: class PromptEncoder (line 128) | class PromptEncoder(nn.Module): method __init__ (line 146) | def __init__( method get_dense_pe (line 191) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 201) | def _embed_points(self, points: torch.Tensor, labels: torch.Tensor, pa... method _embed_boxes (line 216) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 225) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 229) | def _get_batch_size( method _get_device (line 245) | def _get_device(self) -> torch.device: method forward (line 249) | def forward( class PositionEmbeddingRandom (line 288) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 291) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 302) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 311) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 324) | def forward_with_coords(self, coords_input: torch.Tensor, image_size: ... class Block (line 332) | class Block(nn.Module): method __init__ (line 335) | def __init__( method forward (line 379) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 397) | class Attention(nn.Module): method __init__ (line 400) | def __init__( method forward (line 435) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 453) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 477) | def window_unpartition( function get_rel_pos (line 503) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 536) | def add_decomposed_rel_pos( class PatchEmbed (line 576) | class PatchEmbed(nn.Module): method __init__ (line 579) | def __init__( method forward (line 601) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: ultralytics/models/sam/modules/sam.py class Sam (line 18) | class Sam(nn.Module): method __init__ (line 37) | def __init__( FILE: ultralytics/models/sam/modules/tiny_encoder.py class Conv2d_BN (line 23) | class Conv2d_BN(torch.nn.Sequential): method __init__ (line 26) | def __init__(self, a, b, ks=1, stride=1, pad=0, dilation=1, groups=1, ... class PatchEmbed (line 38) | class PatchEmbed(nn.Module): method __init__ (line 41) | def __init__(self, in_chans, embed_dim, resolution, activation): method forward (line 58) | def forward(self, x): class MBConv (line 63) | class MBConv(nn.Module): method __init__ (line 66) | def __init__(self, in_chans, out_chans, expand_ratio, activation, drop... method forward (line 88) | def forward(self, x): class PatchMerging (line 101) | class PatchMerging(nn.Module): method __init__ (line 104) | def __init__(self, input_resolution, dim, out_dim, activation): method forward (line 119) | def forward(self, x): class ConvLayer (line 136) | class ConvLayer(nn.Module): method __init__ (line 143) | def __init__( method forward (line 196) | def forward(self, x): class Mlp (line 203) | class Mlp(nn.Module): method __init__ (line 210) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 221) | def forward(self, x): class Attention (line 231) | class Attention(torch.nn.Module): method __init__ (line 241) | def __init__( method train (line 292) | def train(self, mode=True): method forward (line 300) | def forward(self, x): # x class TinyViTBlock (line 324) | class TinyViTBlock(nn.Module): method __init__ (line 327) | def __init__( method forward (line 382) | def forward(self, x): method extra_repr (line 427) | def extra_repr(self) -> str: class BasicLayer (line 437) | class BasicLayer(nn.Module): method __init__ (line 440) | def __init__( method forward (line 508) | def forward(self, x): method extra_repr (line 514) | def extra_repr(self) -> str: class LayerNorm2d (line 519) | class LayerNorm2d(nn.Module): method __init__ (line 522) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 529) | def forward(self, x: torch.Tensor) -> torch.Tensor: class TinyViT (line 537) | class TinyViT(nn.Module): method __init__ (line 563) | def __init__( method set_layer_lr_decay (line 674) | def set_layer_lr_decay(self, layer_lr_decay): method _init_weights (line 709) | def _init_weights(self, m): method no_weight_decay_keywords (line 721) | def no_weight_decay_keywords(self): method forward_features (line 725) | def forward_features(self, x): method forward (line 740) | def forward(self, x): FILE: ultralytics/models/sam/modules/transformer.py class TwoWayTransformer (line 12) | class TwoWayTransformer(nn.Module): method __init__ (line 29) | def __init__( method forward (line 71) | def forward( class TwoWayAttentionBlock (line 116) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 135) | def __init__( method forward (line 171) | def forward(self, queries: Tensor, keys: Tensor, query_pe: Tensor, key... class Attention (line 205) | class Attention(nn.Module): method __init__ (line 210) | def __init__( method _separate_heads (line 239) | def _separate_heads(x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 246) | def _recombine_heads(x: Tensor) -> Tensor: method forward (line 252) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: ultralytics/models/sam/predict.py class Predictor (line 35) | class Predictor(BasePredictor): method __init__ (line 55) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method preprocess (line 77) | def preprocess(self, im): method pre_transform (line 105) | def pre_transform(self, im): method inference (line 122) | def inference(self, im, bboxes=None, points=None, labels=None, masks=N... method prompt_inference (line 152) | def prompt_inference(self, im, bboxes=None, points=None, labels=None, ... method generate (line 210) | def generate( method setup_model (line 316) | def setup_model(self, model, verbose=True): method postprocess (line 349) | def postprocess(self, preds, img, orig_imgs): method setup_source (line 388) | def setup_source(self, source): method set_image (line 401) | def set_image(self, image): method set_prompts (line 425) | def set_prompts(self, prompts): method reset_image (line 429) | def reset_image(self): method remove_small_regions (line 435) | def remove_small_regions(masks, min_area=0, nms_thresh=0.7): FILE: ultralytics/models/utils/loss.py class DETRLoss (line 12) | class DETRLoss(nn.Module): method __init__ (line 32) | def __init__( method _get_loss_class (line 61) | def _get_loss_class(self, pred_scores, targets, gt_scores, num_gts, po... method _get_loss_bbox (line 83) | def _get_loss_bbox(self, pred_bboxes, gt_bboxes, postfix=""): method _get_loss_aux (line 134) | def _get_loss_aux( method _get_index (line 191) | def _get_index(match_indices): method _get_assigned_bboxes (line 198) | def _get_assigned_bboxes(self, pred_bboxes, gt_bboxes, match_indices): method _get_loss (line 214) | def _get_loss( method forward (line 250) | def forward(self, pred_bboxes, pred_scores, batch, postfix="", **kwargs): class RTDETRDetectionLoss (line 279) | class RTDETRDetectionLoss(DETRLoss): method forward (line 287) | def forward(self, preds, batch, dn_bboxes=None, dn_scores=None, dn_met... method get_dn_match_indices (line 322) | def get_dn_match_indices(dn_pos_idx, dn_num_group, gt_groups): FILE: ultralytics/models/utils/ops.py class HungarianMatcher (line 12) | class HungarianMatcher(nn.Module): method __init__ (line 34) | def __init__(self, cost_gain=None, use_fl=True, with_mask=False, num_s... method forward (line 48) | def forward(self, pred_bboxes, pred_scores, gt_bboxes, gt_cls, gt_grou... function get_cdn_group (line 153) | def get_cdn_group( FILE: ultralytics/models/yolo/classify/predict.py class ClassificationPredictor (line 12) | class ClassificationPredictor(BasePredictor): method __init__ (line 30) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method preprocess (line 36) | def preprocess(self, img): method postprocess (line 51) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolo/classify/train.py class ClassificationTrainer (line 15) | class ClassificationTrainer(BaseTrainer): method __init__ (line 32) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method set_model_attributes (line 41) | def set_model_attributes(self): method get_model (line 45) | def get_model(self, cfg=None, weights=None, verbose=True): method setup_model (line 60) | def setup_model(self): method build_dataset (line 81) | def build_dataset(self, img_path, mode="train", batch=None): method get_dataloader (line 85) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="tr... method preprocess_batch (line 99) | def preprocess_batch(self, batch): method progress_string (line 105) | def progress_string(self): method get_validator (line 115) | def get_validator(self): method label_loss_items (line 120) | def label_loss_items(self, loss_items=None, prefix="train"): method plot_metrics (line 132) | def plot_metrics(self): method final_eval (line 136) | def final_eval(self): method plot_training_samples (line 150) | def plot_training_samples(self, batch, ni): FILE: ultralytics/models/yolo/classify/val.py class ClassificationValidator (line 12) | class ClassificationValidator(BaseValidator): method __init__ (line 29) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method get_desc (line 37) | def get_desc(self): method init_metrics (line 41) | def init_metrics(self, model): method preprocess (line 49) | def preprocess(self, batch): method update_metrics (line 56) | def update_metrics(self, preds, batch): method finalize_metrics (line 62) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 74) | def get_stats(self): method build_dataset (line 79) | def build_dataset(self, img_path): method get_dataloader (line 83) | def get_dataloader(self, dataset_path, batch_size): method print_results (line 88) | def print_results(self): method plot_val_samples (line 93) | def plot_val_samples(self, batch, ni): method plot_predictions (line 104) | def plot_predictions(self, batch, preds, ni): FILE: ultralytics/models/yolo/detect/predict.py class DetectionPredictor (line 8) | class DetectionPredictor(BasePredictor): method postprocess (line 23) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolo/detect/train.py class DetectionTrainer (line 19) | class DetectionTrainer(BaseTrainer): method build_dataset (line 33) | def build_dataset(self, img_path, mode="train", batch=None): method get_dataloader (line 45) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode="tr... method preprocess_batch (line 57) | def preprocess_batch(self, batch): method set_model_attributes (line 76) | def set_model_attributes(self): method get_model (line 86) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 93) | def get_validator(self): method label_loss_items (line 100) | def label_loss_items(self, loss_items=None, prefix="train"): method progress_string (line 113) | def progress_string(self): method plot_training_samples (line 123) | def plot_training_samples(self, batch, ni): method plot_metrics (line 135) | def plot_metrics(self): method plot_training_labels (line 139) | def plot_training_labels(self): FILE: ultralytics/models/yolo/detect/val.py class DetectionValidator (line 17) | class DetectionValidator(BaseValidator): method __init__ (line 31) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 43) | def preprocess(self, batch): method init_metrics (line 65) | def init_metrics(self, model): method get_desc (line 80) | def get_desc(self): method postprocess (line 84) | def postprocess(self, preds): method _prepare_batch (line 96) | def _prepare_batch(self, si, batch): method _prepare_pred (line 109) | def _prepare_pred(self, pred, pbatch): method update_metrics (line 117) | def update_metrics(self, preds, batch): method finalize_metrics (line 161) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 166) | def get_stats(self): method print_results (line 176) | def print_results(self): method _process_batch (line 194) | def _process_batch(self, detections, gt_bboxes, gt_cls): method build_dataset (line 210) | def build_dataset(self, img_path, mode="val", batch=None): method get_dataloader (line 221) | def get_dataloader(self, dataset_path, batch_size): method plot_val_samples (line 226) | def plot_val_samples(self, batch, ni): method plot_predictions (line 239) | def plot_predictions(self, batch, preds, ni): method save_one_txt (line 250) | def save_one_txt(self, predn, save_conf, shape, file): method pred_to_json (line 259) | def pred_to_json(self, predn, filename): method eval_json (line 275) | def eval_json(self, stats): FILE: ultralytics/models/yolo/model.py class YOLO (line 11) | class YOLO(Model): method __init__ (line 14) | def __init__(self, model="yolov8n.pt", task=None, verbose=False): method task_map (line 31) | def task_map(self): class YOLOWorld (line 67) | class YOLOWorld(Model): method __init__ (line 70) | def __init__(self, model="yolov8s-world.pt") -> None: method task_map (line 84) | def task_map(self): method set_classes (line 94) | def set_classes(self, classes): FILE: ultralytics/models/yolo/obb/predict.py class OBBPredictor (line 10) | class OBBPredictor(DetectionPredictor): method __init__ (line 25) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 30) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolo/obb/train.py class OBBTrainer (line 10) | class OBBTrainer(yolo.detect.DetectionTrainer): method __init__ (line 24) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_model (line 31) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 39) | def get_validator(self): FILE: ultralytics/models/yolo/obb/val.py class OBBValidator (line 13) | class OBBValidator(DetectionValidator): method __init__ (line 27) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method init_metrics (line 33) | def init_metrics(self, model): method postprocess (line 39) | def postprocess(self, preds): method _process_batch (line 53) | def _process_batch(self, detections, gt_bboxes, gt_cls): method _prepare_batch (line 70) | def _prepare_batch(self, si, batch): method _prepare_pred (line 83) | def _prepare_pred(self, pred, pbatch): method plot_predictions (line 91) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 102) | def pred_to_json(self, predn, filename): method save_one_txt (line 119) | def save_one_txt(self, predn, save_conf, shape, file): method eval_json (line 129) | def eval_json(self, stats): FILE: ultralytics/models/yolo/pose/predict.py class PosePredictor (line 8) | class PosePredictor(DetectionPredictor): method __init__ (line 23) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 33) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolo/pose/train.py class PoseTrainer (line 11) | class PoseTrainer(yolo.detect.DetectionTrainer): method __init__ (line 25) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_model (line 38) | def get_model(self, cfg=None, weights=None, verbose=True): method set_model_attributes (line 46) | def set_model_attributes(self): method get_validator (line 51) | def get_validator(self): method plot_training_samples (line 58) | def plot_training_samples(self, batch, ni): method plot_metrics (line 77) | def plot_metrics(self): FILE: ultralytics/models/yolo/pose/val.py class PoseValidator (line 15) | class PoseValidator(DetectionValidator): method __init__ (line 29) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 42) | def preprocess(self, batch): method get_desc (line 48) | def get_desc(self): method postprocess (line 64) | def postprocess(self, preds): method init_metrics (line 77) | def init_metrics(self, model): method _prepare_batch (line 86) | def _prepare_batch(self, si, batch): method _prepare_pred (line 98) | def _prepare_pred(self, pred, pbatch): method update_metrics (line 106) | def update_metrics(self, preds, batch): method _process_batch (line 152) | def _process_batch(self, detections, gt_bboxes, gt_cls, pred_kpts=None... method plot_val_samples (line 177) | def plot_val_samples(self, batch, ni): method plot_predictions (line 191) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 204) | def pred_to_json(self, predn, filename): method eval_json (line 221) | def eval_json(self, stats): FILE: ultralytics/models/yolo/segment/predict.py class SegmentationPredictor (line 8) | class SegmentationPredictor(DetectionPredictor): method __init__ (line 23) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 28) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolo/segment/train.py class SegmentationTrainer (line 11) | class SegmentationTrainer(yolo.detect.DetectionTrainer): method __init__ (line 25) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_model (line 32) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 40) | def get_validator(self): method plot_training_samples (line 47) | def plot_training_samples(self, batch, ni): method plot_metrics (line 60) | def plot_metrics(self): FILE: ultralytics/models/yolo/segment/val.py class SegmentationValidator (line 17) | class SegmentationValidator(DetectionValidator): method __init__ (line 31) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 39) | def preprocess(self, batch): method init_metrics (line 45) | def init_metrics(self, model): method get_desc (line 56) | def get_desc(self): method postprocess (line 72) | def postprocess(self, preds): method _prepare_batch (line 87) | def _prepare_batch(self, si, batch): method _prepare_pred (line 94) | def _prepare_pred(self, pred, pbatch, proto): method update_metrics (line 100) | def update_metrics(self, preds, batch): method finalize_metrics (line 159) | def finalize_metrics(self, *args, **kwargs): method _process_batch (line 164) | def _process_batch(self, detections, gt_bboxes, gt_cls, pred_masks=Non... method plot_val_samples (line 190) | def plot_val_samples(self, batch, ni): method plot_predictions (line 204) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 217) | def pred_to_json(self, predn, filename, pred_masks): method eval_json (line 250) | def eval_json(self, stats): FILE: ultralytics/models/yolov10/model.py class YOLOv10 (line 10) | class YOLOv10(Model, PyTorchModelHubMixin, model_card_template=card_temp... method __init__ (line 12) | def __init__(self, model="yolov10n.pt", task=None, verbose=False, method push_to_hub (line 18) | def push_to_hub(self, repo_name, **kwargs): method task_map (line 27) | def task_map(self): FILE: ultralytics/models/yolov10/predict.py class YOLOv10DetectionPredictor (line 7) | class YOLOv10DetectionPredictor(DetectionPredictor): method postprocess (line 8) | def postprocess(self, preds, img, orig_imgs): FILE: ultralytics/models/yolov10/train.py class YOLOv10DetectionTrainer (line 7) | class YOLOv10DetectionTrainer(DetectionTrainer): method get_validator (line 8) | def get_validator(self): method get_model (line 15) | def get_model(self, cfg=None, weights=None, verbose=True): FILE: ultralytics/models/yolov10/val.py class YOLOv10DetectionValidator (line 5) | class YOLOv10DetectionValidator(DetectionValidator): method __init__ (line 6) | def __init__(self, *args, **kwargs): method postprocess (line 10) | def postprocess(self, preds): FILE: ultralytics/nn/Addmodules/DualConv.py function autopad (line 7) | def autopad(k, p=None, d=1): # kernel, padding, dilation class Conv (line 16) | class Conv(nn.Module): method __init__ (line 20) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True): method forward (line 27) | def forward(self, x): method forward_fuse (line 31) | def forward_fuse(self, x): class DualConv (line 36) | class DualConv(nn.Module): method __init__ (line 37) | def __init__(self, in_channels, out_channels, stride=1, g=4): method forward (line 51) | def forward(self, input_data): class Bottleneck (line 60) | class Bottleneck(nn.Module): method __init__ (line 62) | def __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5): # ch... method forward (line 70) | def forward(self, x): class C2f_Dual (line 74) | class C2f_Dual(nn.Module): method __init__ (line 76) | def __init__(self, c1, c2, n=1, shortcut=False, g=1, e=0.5): # ch_in,... method forward (line 83) | def forward(self, x): FILE: ultralytics/nn/Addmodules/EMAttention.py class EMA (line 7) | class EMA(nn.Module): method __init__ (line 8) | def __init__(self, channels, factor=16): method forward (line 20) | def forward(self, x): function autopad (line 37) | def autopad(k, p=None, d=1): # kernel, padding, dilation class Conv (line 46) | class Conv(nn.Module): method __init__ (line 50) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True): method forward (line 57) | def forward(self, x): method forward_fuse (line 61) | def forward_fuse(self, x): class Bottleneck (line 66) | class Bottleneck(nn.Module): method __init__ (line 69) | def __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5): method forward (line 80) | def forward(self, x): class C2f_EMA (line 85) | class C2f_EMA(nn.Module): method __init__ (line 88) | def __init__(self, c1, c2, n=1, shortcut=False, g=1, e=0.5): method forward (line 98) | def forward(self, x): method forward_split (line 104) | def forward_split(self, x): class PSAEMA (line 111) | class PSAEMA(nn.Module): method __init__ (line 113) | def __init__(self, c1, c2, e=0.5): method forward (line 126) | def forward(self, x): FILE: ultralytics/nn/Addmodules/mobilenetv4.py function mhsa (line 201) | def mhsa(num_heads, key_dim, value_dim, px): function make_divisible (line 361) | def make_divisible( function conv_2d (line 389) | def conv_2d(inp, oup, kernel_size=3, stride=1, groups=1, bias=False, nor... class InvertedResidual (line 400) | class InvertedResidual(nn.Module): method __init__ (line 401) | def __init__(self, inp, oup, stride, expand_ratio, act=False, squeeze_... method forward (line 415) | def forward(self, x): class UniversalInvertedBottleneckBlock (line 422) | class UniversalInvertedBottleneckBlock(nn.Module): method __init__ (line 423) | def __init__(self, method forward (line 458) | def forward(self, x): class MultiQueryAttentionLayerWithDownSampling (line 472) | class MultiQueryAttentionLayerWithDownSampling(nn.Module): method __init__ (line 473) | def __init__(self, inp, num_heads, key_dim, value_dim, query_h_strides... method forward (line 510) | def forward(self, x): class MNV4LayerScale (line 543) | class MNV4LayerScale(nn.Module): method __init__ (line 544) | def __init__(self, init_value): method forward (line 554) | def forward(self, x): class MultiHeadSelfAttentionBlock (line 559) | class MultiHeadSelfAttentionBlock(nn.Module): method __init__ (line 560) | def __init__( method forward (line 593) | def forward(self, x): function build_blocks (line 612) | def build_blocks(layer_spec): class MobileNetV4 (line 646) | class MobileNetV4(nn.Module): method __init__ (line 647) | def __init__(self, model): method forward (line 674) | def forward(self, x): function MobileNetV4ConvSmall (line 685) | def MobileNetV4ConvSmall(): function MobileNetV4ConvMedium (line 690) | def MobileNetV4ConvMedium(): function MobileNetV4ConvLarge (line 695) | def MobileNetV4ConvLarge(): function MobileNetV4HybridMedium (line 700) | def MobileNetV4HybridMedium(): function MobileNetV4HybridLarge (line 705) | def MobileNetV4HybridLarge(): FILE: ultralytics/nn/Addmodules/starnet.py class ConvBN (line 25) | class ConvBN(torch.nn.Sequential): method __init__ (line 26) | def __init__(self, in_planes, out_planes, kernel_size=1, stride=1, pad... class StarNetBlock (line 35) | class StarNetBlock(nn.Module): method __init__ (line 36) | def __init__(self, dim, mlp_ratio=3, drop_path=0.): method forward (line 46) | def forward(self, x): class StarNet (line 56) | class StarNet(nn.Module): method __init__ (line 57) | def __init__(self, base_dim=32, depths=[3, 3, 12, 5], mlp_ratio=4, dro... method _init_weights (line 78) | def _init_weights(self, m): method forward (line 87) | def forward(self, x): function starnet_s1 (line 97) | def starnet_s1(pretrained=False, **kwargs): function starnet_s2 (line 106) | def starnet_s2(pretrained=False, **kwargs): function starnet_s3 (line 115) | def starnet_s3(pretrained=False, **kwargs): function starnet_s4 (line 124) | def starnet_s4(pretrained=False, **kwargs): function starnet_s050 (line 135) | def starnet_s050(pretrained=False, **kwargs): function starnet_s100 (line 139) | def starnet_s100(pretrained=False, **kwargs): function starnet_s150 (line 143) | def starnet_s150(pretrained=False, **kwargs): FILE: ultralytics/nn/autobackend.py function check_class_names (line 22) | def check_class_names(names): function default_class_names (line 45) | def default_class_names(data=None): class AutoBackend (line 53) | class AutoBackend(nn.Module): method __init__ (line 82) | def __init__( method forward (line 401) | def forward(self, im, augment=False, visualize=False, embed=None): method from_numpy (line 565) | def from_numpy(self, x): method warmup (line 577) | def warmup(self, imgsz=(1, 3, 640, 640)): method _model_type (line 591) | def _model_type(p="path/to/model.pt"): FILE: ultralytics/nn/modules/block.py class DFL (line 44) | class DFL(nn.Module): method __init__ (line 51) | def __init__(self, c1=16): method forward (line 59) | def forward(self, x): class Proto (line 66) | class Proto(nn.Module): method __init__ (line 69) | def __init__(self, c1, c_=256, c2=32): method forward (line 81) | def forward(self, x): class HGStem (line 86) | class HGStem(nn.Module): method __init__ (line 93) | def __init__(self, c1, cm, c2): method forward (line 103) | def forward(self, x): class HGBlock (line 117) | class HGBlock(nn.Module): method __init__ (line 124) | def __init__(self, c1, cm, c2, k=3, n=6, lightconv=False, shortcut=Fal... method forward (line 133) | def forward(self, x): class SPP (line 141) | class SPP(nn.Module): method __init__ (line 144) | def __init__(self, c1, c2, k=(5, 9, 13)): method forward (line 152) | def forward(self, x): class SPPF (line 158) | class SPPF(nn.Module): method __init__ (line 161) | def __init__(self, c1, c2, k=5): method forward (line 173) | def forward(self, x): class C1 (line 181) | class C1(nn.Module): method __init__ (line 184) | def __init__(self, c1, c2, n=1): method forward (line 190) | def forward(self, x): class C2 (line 196) | class C2(nn.Module): method __init__ (line 199) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): method forward (line 210) | def forward(self, x): class C2f (line 216) | class C2f(nn.Module): method __init__ (line 219) | def __init__(self, c1, c2, n=1, shortcut=False, g=1, e=0.5): method forward (line 229) | def forward(self, x): method forward_split (line 235) | def forward_split(self, x): class C3 (line 242) | class C3(nn.Module): method __init__ (line 245) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): method forward (line 254) | def forward(self, x): class C3x (line 259) | class C3x(C3): method __init__ (line 262) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class RepC3 (line 269) | class RepC3(nn.Module): method __init__ (line 272) | def __init__(self, c1, c2, n=3, e=1.0): method forward (line 281) | def forward(self, x): class C3TR (line 286) | class C3TR(C3): method __init__ (line 289) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class C3Ghost (line 296) | class C3Ghost(C3): method __init__ (line 299) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class GhostBottleneck (line 306) | class GhostBottleneck(nn.Module): method __init__ (line 309) | def __init__(self, c1, c2, k=3, s=1): method forward (line 322) | def forward(self, x): class Bottleneck (line 327) | class Bottleneck(nn.Module): method __init__ (line 330) | def __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5): method forward (line 340) | def forward(self, x): class BottleneckCSP (line 345) | class BottleneckCSP(nn.Module): method __init__ (line 348) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): method forward (line 360) | def forward(self, x): class ResNetBlock (line 367) | class ResNetBlock(nn.Module): method __init__ (line 370) | def __init__(self, c1, c2, s=1, e=4): method forward (line 379) | def forward(self, x): class ResNetLayer (line 384) | class ResNetLayer(nn.Module): method __init__ (line 387) | def __init__(self, c1, c2, s=1, is_first=False, n=1, e=4): method forward (line 401) | def forward(self, x): class MaxSigmoidAttnBlock (line 406) | class MaxSigmoidAttnBlock(nn.Module): method __init__ (line 409) | def __init__(self, c1, c2, nh=1, ec=128, gc=512, scale=False): method forward (line 420) | def forward(self, x, guide): class C2fAttn (line 441) | class C2fAttn(nn.Module): method __init__ (line 444) | def __init__(self, c1, c2, n=1, ec=128, nh=1, gc=512, shortcut=False, ... method forward (line 455) | def forward(self, x, guide): method forward_split (line 462) | def forward_split(self, x, guide): class ImagePoolingAttn (line 470) | class ImagePoolingAttn(nn.Module): method __init__ (line 473) | def __init__(self, ec=256, ch=(), ct=512, nh=8, k=3, scale=False): method forward (line 491) | def forward(self, x, text): class ContrastiveHead (line 516) | class ContrastiveHead(nn.Module): method __init__ (line 521) | def __init__(self): method forward (line 527) | def forward(self, x, w): class BNContrastiveHead (line 535) | class BNContrastiveHead(nn.Module): method __init__ (line 543) | def __init__(self, embed_dims: int): method forward (line 551) | def forward(self, x, w): class RepBottleneck (line 559) | class RepBottleneck(nn.Module): method __init__ (line 562) | def __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5): method forward (line 572) | def forward(self, x): class RepCSP (line 577) | class RepCSP(nn.Module): method __init__ (line 580) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): method forward (line 589) | def forward(self, x): class RepNCSPELAN4 (line 594) | class RepNCSPELAN4(nn.Module): method __init__ (line 597) | def __init__(self, c1, c2, c3, c4, n=1): method forward (line 606) | def forward(self, x): method forward_split (line 612) | def forward_split(self, x): class ADown (line 619) | class ADown(nn.Module): method __init__ (line 622) | def __init__(self, c1, c2): method forward (line 629) | def forward(self, x): class SPPELAN (line 639) | class SPPELAN(nn.Module): method __init__ (line 642) | def __init__(self, c1, c2, c3, k=5): method forward (line 652) | def forward(self, x): class Silence (line 659) | class Silence(nn.Module): method __init__ (line 662) | def __init__(self): method forward (line 666) | def forward(self, x): class CBLinear (line 671) | class CBLinear(nn.Module): method __init__ (line 674) | def __init__(self, c1, c2s, k=1, s=1, p=None, g=1): method forward (line 680) | def forward(self, x): class CBFuse (line 686) | class CBFuse(nn.Module): method __init__ (line 689) | def __init__(self, idx): method forward (line 694) | def forward(self, xs): class RepVGGDW (line 702) | class RepVGGDW(torch.nn.Module): method __init__ (line 703) | def __init__(self, ed) -> None: method forward (line 710) | def forward(self, x): method forward_fuse (line 713) | def forward_fuse(self, x): method fuse (line 717) | def fuse(self): class CIB (line 737) | class CIB(nn.Module): method __init__ (line 740) | def __init__(self, c1, c2, shortcut=True, e=0.5, lk=False): method forward (line 756) | def forward(self, x): class C2fCIB (line 760) | class C2fCIB(C2f): method __init__ (line 763) | def __init__(self, c1, c2, n=1, shortcut=False, lk=False, g=1, e=0.5): class Attention (line 771) | class Attention(nn.Module): method __init__ (line 772) | def __init__(self, dim, num_heads=8, method forward (line 785) | def forward(self, x): class PSA (line 799) | class PSA(nn.Module): method __init__ (line 801) | def __init__(self, c1, c2, e=0.5): method forward (line 814) | def forward(self, x): class SCDown (line 820) | class SCDown(nn.Module): method __init__ (line 821) | def __init__(self, c1, c2, k, s): method forward (line 826) | def forward(self, x): FILE: ultralytics/nn/modules/conv.py function autopad (line 27) | def autopad(k, p=None, d=1): # kernel, padding, dilation class Conv (line 36) | class Conv(nn.Module): method __init__ (line 41) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True): method forward (line 48) | def forward(self, x): method forward_fuse (line 52) | def forward_fuse(self, x): class Conv2 (line 57) | class Conv2(Conv): method __init__ (line 60) | def __init__(self, c1, c2, k=3, s=1, p=None, g=1, d=1, act=True): method forward (line 65) | def forward(self, x): method forward_fuse (line 69) | def forward_fuse(self, x): method fuse_convs (line 73) | def fuse_convs(self): class LightConv (line 83) | class LightConv(nn.Module): method __init__ (line 90) | def __init__(self, c1, c2, k=1, act=nn.ReLU()): method forward (line 96) | def forward(self, x): class DWConv (line 101) | class DWConv(Conv): method __init__ (line 104) | def __init__(self, c1, c2, k=1, s=1, d=1, act=True): # ch_in, ch_out,... class DWConvTranspose2d (line 109) | class DWConvTranspose2d(nn.ConvTranspose2d): method __init__ (line 112) | def __init__(self, c1, c2, k=1, s=1, p1=0, p2=0): # ch_in, ch_out, ke... class ConvTranspose (line 117) | class ConvTranspose(nn.Module): method __init__ (line 122) | def __init__(self, c1, c2, k=2, s=2, p=0, bn=True, act=True): method forward (line 129) | def forward(self, x): method forward_fuse (line 133) | def forward_fuse(self, x): class Focus (line 138) | class Focus(nn.Module): method __init__ (line 141) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): method forward (line 147) | def forward(self, x): class GhostConv (line 157) | class GhostConv(nn.Module): method __init__ (line 160) | def __init__(self, c1, c2, k=1, s=1, g=1, act=True): method forward (line 169) | def forward(self, x): class RepConv (line 175) | class RepConv(nn.Module): method __init__ (line 185) | def __init__(self, c1, c2, k=3, s=1, p=1, g=1, d=1, act=True, bn=False... method forward_fuse (line 198) | def forward_fuse(self, x): method forward (line 202) | def forward(self, x): method get_equivalent_kernel_bias (line 207) | def get_equivalent_kernel_bias(self): method _pad_1x1_to_3x3_tensor (line 214) | def _pad_1x1_to_3x3_tensor(self, kernel1x1): method _fuse_bn_tensor (line 221) | def _fuse_bn_tensor(self, branch): method fuse_convs (line 249) | def fuse_convs(self): class ChannelAttention (line 278) | class ChannelAttention(nn.Module): method __init__ (line 281) | def __init__(self, channels: int) -> None: method forward (line 288) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SpatialAttention (line 293) | class SpatialAttention(nn.Module): method __init__ (line 296) | def __init__(self, kernel_size=7): method forward (line 304) | def forward(self, x): class CBAM (line 309) | class CBAM(nn.Module): method __init__ (line 312) | def __init__(self, c1, kernel_size=7): method forward (line 318) | def forward(self, x): class Concat (line 323) | class Concat(nn.Module): method __init__ (line 326) | def __init__(self, dimension=1): method forward (line 331) | def forward(self, x): FILE: ultralytics/nn/modules/head.py class Detect (line 21) | class Detect(nn.Module): method __init__ (line 30) | def __init__(self, nc=80, ch=()): method inference (line 45) | def inference(self, x): method forward_feat (line 73) | def forward_feat(self, x, cv2, cv3): method forward (line 79) | def forward(self, x): method bias_init (line 88) | def bias_init(self): method decode_bboxes (line 97) | def decode_bboxes(self, bboxes, anchors): class Segment (line 104) | class Segment(Detect): method __init__ (line 107) | def __init__(self, nc=80, nm=32, npr=256, ch=()): method forward (line 118) | def forward(self, x): class OBB (line 130) | class OBB(Detect): method __init__ (line 133) | def __init__(self, nc=80, ne=1, ch=()): method forward (line 142) | def forward(self, x): method decode_bboxes (line 156) | def decode_bboxes(self, bboxes, anchors): class Pose (line 161) | class Pose(Detect): method __init__ (line 164) | def __init__(self, nc=80, kpt_shape=(17, 3), ch=()): method forward (line 174) | def forward(self, x): method kpts_decode (line 184) | def kpts_decode(self, bs, kpts): class Classify (line 202) | class Classify(nn.Module): method __init__ (line 205) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1): method forward (line 216) | def forward(self, x): class WorldDetect (line 224) | class WorldDetect(Detect): method __init__ (line 225) | def __init__(self, nc=80, embed=512, with_bn=False, ch=()): method forward (line 232) | def forward(self, x, text): class RTDETRDecoder (line 267) | class RTDETRDecoder(nn.Module): method __init__ (line 278) | def __init__( method forward (line 357) | def forward(self, x, batch=None): method _generate_anchors (line 396) | def _generate_anchors(self, shapes, grid_size=0.05, dtype=torch.float3... method _get_encoder_input (line 416) | def _get_encoder_input(self, x): method _get_decoder_input (line 434) | def _get_decoder_input(self, feats, shapes, dn_embed=None, dn_bbox=None): method _reset_parameters (line 473) | def _reset_parameters(self): class v10Detect (line 497) | class v10Detect(Detect): method __init__ (line 501) | def __init__(self, nc=80, ch=()): method forward (line 511) | def forward(self, x): method bias_init (line 527) | def bias_init(self): FILE: ultralytics/nn/modules/transformer.py class TransformerEncoderLayer (line 28) | class TransformerEncoderLayer(nn.Module): method __init__ (line 31) | def __init__(self, c1, cm=2048, num_heads=8, dropout=0.0, act=nn.GELU(... method with_pos_embed (line 55) | def with_pos_embed(tensor, pos=None): method forward_post (line 59) | def forward_post(self, src, src_mask=None, src_key_padding_mask=None, ... method forward_pre (line 69) | def forward_pre(self, src, src_mask=None, src_key_padding_mask=None, p... method forward (line 79) | def forward(self, src, src_mask=None, src_key_padding_mask=None, pos=N... class AIFI (line 86) | class AIFI(TransformerEncoderLayer): method __init__ (line 89) | def __init__(self, c1, cm=2048, num_heads=8, dropout=0, act=nn.GELU(),... method forward (line 93) | def forward(self, x): method build_2d_sincos_position_embedding (line 102) | def build_2d_sincos_position_embedding(w, h, embed_dim=256, temperatur... class TransformerLayer (line 118) | class TransformerLayer(nn.Module): method __init__ (line 121) | def __init__(self, c, num_heads): method forward (line 131) | def forward(self, x): class TransformerBlock (line 137) | class TransformerBlock(nn.Module): method __init__ (line 140) | def __init__(self, c1, c2, num_heads, num_layers): method forward (line 150) | def forward(self, x): class MLPBlock (line 159) | class MLPBlock(nn.Module): method __init__ (line 162) | def __init__(self, embedding_dim, mlp_dim, act=nn.GELU): method forward (line 169) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MLP (line 174) | class MLP(nn.Module): method __init__ (line 177) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers): method forward (line 184) | def forward(self, x): class LayerNorm2d (line 191) | class LayerNorm2d(nn.Module): method __init__ (line 201) | def __init__(self, num_channels, eps=1e-6): method forward (line 208) | def forward(self, x): class MSDeformAttn (line 216) | class MSDeformAttn(nn.Module): method __init__ (line 223) | def __init__(self, d_model=256, n_levels=4, n_heads=8, n_points=4): method _reset_parameters (line 246) | def _reset_parameters(self): method forward (line 267) | def forward(self, query, refer_bbox, value, value_shapes, value_mask=N... class DeformableTransformerDecoderLayer (line 310) | class DeformableTransformerDecoderLayer(nn.Module): method __init__ (line 318) | def __init__(self, d_model=256, n_heads=8, d_ffn=1024, dropout=0.0, ac... method with_pos_embed (line 341) | def with_pos_embed(tensor, pos): method forward_ffn (line 345) | def forward_ffn(self, tgt): method forward (line 351) | def forward(self, embed, refer_bbox, feats, shapes, padding_mask=None,... class DeformableTransformerDecoder (line 373) | class DeformableTransformerDecoder(nn.Module): method __init__ (line 380) | def __init__(self, hidden_dim, decoder_layer, num_layers, eval_idx=-1): method forward (line 388) | def forward( FILE: ultralytics/nn/modules/utils.py function _get_clones (line 16) | def _get_clones(module, n): function bias_init_with_prob (line 21) | def bias_init_with_prob(prior_prob=0.01): function linear_init (line 26) | def linear_init(module): function inverse_sigmoid (line 34) | def inverse_sigmoid(x, eps=1e-5): function multi_scale_deformable_attn_pytorch (line 42) | def multi_scale_deformable_attn_pytorch( FILE: ultralytics/nn/tasks.py class BaseModel (line 81) | class BaseModel(nn.Module): method forward (line 84) | def forward(self, x, *args, **kwargs): method predict (line 98) | def predict(self, x, profile=False, visualize=False, augment=False, em... method _predict_once (line 116) | def _predict_once(self, x, profile=False, visualize=False, embed=None): method _predict_augment (line 154) | def _predict_augment(self, x): method _profile_one_layer (line 162) | def _profile_one_layer(self, m, x, dt): method fuse (line 187) | def fuse(self, verbose=True): method is_fused (line 217) | def is_fused(self, thresh=10): method info (line 230) | def info(self, detailed=False, verbose=True, imgsz=640): method _apply (line 241) | def _apply(self, fn): method load (line 259) | def load(self, weights, verbose=True): method loss (line 274) | def loss(self, batch, preds=None): method init_criterion (line 288) | def init_criterion(self): class DetectionModel (line 293) | class DetectionModel(BaseModel): method __init__ (line 296) | def __init__(self, cfg="yolov8n.yaml", ch=3, nc=None, verbose=True): ... method _predict_augment (line 330) | def _predict_augment(self, x): method _descale_pred (line 349) | def _descale_pred(p, flips, scale, img_size, dim=1): method _clip_augmented (line 359) | def _clip_augmented(self, y): method init_criterion (line 370) | def init_criterion(self): class OBBModel (line 375) | class OBBModel(DetectionModel): method __init__ (line 378) | def __init__(self, cfg="yolov8n-obb.yaml", ch=3, nc=None, verbose=True): method init_criterion (line 382) | def init_criterion(self): class SegmentationModel (line 387) | class SegmentationModel(DetectionModel): method __init__ (line 390) | def __init__(self, cfg="yolov8n-seg.yaml", ch=3, nc=None, verbose=True): method init_criterion (line 394) | def init_criterion(self): class PoseModel (line 399) | class PoseModel(DetectionModel): method __init__ (line 402) | def __init__(self, cfg="yolov8n-pose.yaml", ch=3, nc=None, data_kpt_sh... method init_criterion (line 411) | def init_criterion(self): class ClassificationModel (line 416) | class ClassificationModel(BaseModel): method __init__ (line 419) | def __init__(self, cfg="yolov8n-cls.yaml", ch=3, nc=None, verbose=True): method _from_yaml (line 424) | def _from_yaml(self, cfg, ch, nc, verbose): method reshape_outputs (line 441) | def reshape_outputs(model, nc): method init_criterion (line 461) | def init_criterion(self): class RTDETRDetectionModel (line 466) | class RTDETRDetectionModel(DetectionModel): method __init__ (line 486) | def __init__(self, cfg="rtdetr-l.yaml", ch=3, nc=None, verbose=True): method init_criterion (line 498) | def init_criterion(self): method loss (line 504) | def loss(self, batch, preds=None): method predict (line 549) | def predict(self, x, profile=False, visualize=False, batch=None, augme... class WorldModel (line 583) | class WorldModel(DetectionModel): method __init__ (line 586) | def __init__(self, cfg="yolov8s-world.yaml", ch=3, nc=None, verbose=Tr... method set_classes (line 592) | def set_classes(self, text): method init_criterion (line 609) | def init_criterion(self): method predict (line 613) | def predict(self, x, profile=False, visualize=False, augment=False, em... class YOLOv10DetectionModel (line 655) | class YOLOv10DetectionModel(DetectionModel): method init_criterion (line 656) | def init_criterion(self): class Ensemble (line 659) | class Ensemble(nn.ModuleList): method __init__ (line 662) | def __init__(self): method forward (line 666) | def forward(self, x, augment=False, profile=False, visualize=False): function temporary_modules (line 679) | def temporary_modules(modules=None): function torch_safe_load (line 720) | def torch_safe_load(weight): function attempt_load_weights (line 777) | def attempt_load_weights(weights, device=None, inplace=True, fuse=False): function attempt_load_one_weight (line 816) | def attempt_load_one_weight(weight, device=None, inplace=True, fuse=False): function parse_model (line 842) | def parse_model(d, ch, verbose=True): # model_dict, input_channels(3) function yaml_model_load (line 1000) | def yaml_model_load(path): function guess_model_scale (line 1021) | def guess_model_scale(model_path): function guess_model_task (line 1040) | def guess_model_task(model): FILE: ultralytics/solutions/ai_gym.py class AIGym (line 9) | class AIGym: method __init__ (line 12) | def __init__(self): method set_args (line 39) | def set_args( method start_counting (line 66) | def start_counting(self, im0, results, frame_count): FILE: ultralytics/solutions/distance_calculation.py class DistanceCalculation (line 11) | class DistanceCalculation: method __init__ (line 14) | def __init__(self): method set_args (line 44) | def set_args( method mouse_event_for_distance (line 71) | def mouse_event_for_distance(self, event, x, y, flags, param): method extract_tracks (line 97) | def extract_tracks(self, tracks): method calculate_centroid (line 108) | def calculate_centroid(self, box): method calculate_distance (line 117) | def calculate_distance(self, centroid1, centroid2): method start_process (line 128) | def start_process(self, im0, tracks): method display_frames (line 170) | def display_frames(self): FILE: ultralytics/solutions/heatmap.py class Heatmap (line 16) | class Heatmap: method __init__ (line 19) | def __init__(self): method set_args (line 66) | def set_args( method extract_results (line 149) | def extract_results(self, tracks): method generate_heatmap (line 160) | def generate_heatmap(self, im0, tracks): method display_frames (line 272) | def display_frames(self): FILE: ultralytics/solutions/object_counter.py class ObjectCounter (line 15) | class ObjectCounter: method __init__ (line 18) | def __init__(self): method set_args (line 60) | def set_args( method mouse_event_for_region (line 128) | def mouse_event_for_region(self, event, x, y, flags, params): method extract_and_process_tracks (line 160) | def extract_and_process_tracks(self, tracks): method display_frames (line 249) | def display_frames(self): method start_counting (line 261) | def start_counting(self, im0, tracks): FILE: ultralytics/solutions/speed_estimation.py class SpeedEstimator (line 13) | class SpeedEstimator: method __init__ (line 16) | def __init__(self): method set_args (line 48) | def set_args( method extract_tracks (line 78) | def extract_tracks(self, tracks): method store_track_info (line 89) | def store_track_info(self, track_id, box): method plot_box_and_track (line 107) | def plot_box_and_track(self, track_id, box, cls, track): method calculate_speed (line 125) | def calculate_speed(self, trk_id, track): method estimate_speed (line 157) | def estimate_speed(self, im0, tracks, region_color=(255, 0, 0)): method display_frames (line 190) | def display_frames(self): FILE: ultralytics/trackers/basetrack.py class TrackState (line 9) | class TrackState: class BaseTrack (line 26) | class BaseTrack: method __init__ (line 57) | def __init__(self): method end_frame (line 72) | def end_frame(self): method next_id (line 77) | def next_id(): method activate (line 82) | def activate(self, *args): method predict (line 86) | def predict(self): method update (line 90) | def update(self, *args, **kwargs): method mark_lost (line 94) | def mark_lost(self): method mark_removed (line 98) | def mark_removed(self): method reset_id (line 103) | def reset_id(): FILE: ultralytics/trackers/bot_sort.py class BOTrack (line 14) | class BOTrack(STrack): method __init__ (line 45) | def __init__(self, tlwh, score, cls, feat=None, feat_history=50): method update_features (line 56) | def update_features(self, feat): method predict (line 67) | def predict(self): method re_activate (line 76) | def re_activate(self, new_track, frame_id, new_id=False): method update (line 82) | def update(self, new_track, frame_id): method tlwh (line 89) | def tlwh(self): method multi_predict (line 98) | def multi_predict(stracks): method convert_coords (line 113) | def convert_coords(self, tlwh): method tlwh_to_xywh (line 118) | def tlwh_to_xywh(tlwh): class BOTSORT (line 125) | class BOTSORT(BYTETracker): method __init__ (line 151) | def __init__(self, args, frame_rate=30): method get_kalmanfilter (line 163) | def get_kalmanfilter(self): method init_track (line 167) | def init_track(self, dets, scores, cls, img=None): method get_dists (line 177) | def get_dists(self, tracks, detections): method multi_predict (line 193) | def multi_predict(self, tracks): method reset (line 197) | def reset(self): FILE: ultralytics/trackers/byte_tracker.py class STrack (line 12) | class STrack(BaseTrack): method __init__ (line 46) | def __init__(self, xywh, score, cls): method predict (line 62) | def predict(self): method multi_predict (line 70) | def multi_predict(stracks): method multi_gmc (line 85) | def multi_gmc(stracks, H=np.eye(2, 3)): method activate (line 103) | def activate(self, kalman_filter, frame_id): method re_activate (line 116) | def re_activate(self, new_track, frame_id, new_id=False): method update (line 132) | def update(self, new_track, frame_id): method convert_coords (line 155) | def convert_coords(self, tlwh): method tlwh (line 160) | def tlwh(self): method xyxy (line 170) | def xyxy(self): method tlwh_to_xyah (line 177) | def tlwh_to_xyah(tlwh): method xywh (line 187) | def xywh(self): method xywha (line 194) | def xywha(self): method result (line 202) | def result(self): method __repr__ (line 207) | def __repr__(self): class BYTETracker (line 212) | class BYTETracker: method __init__ (line 241) | def __init__(self, args, frame_rate=30): method update (line 253) | def update(self, results, img=None): method get_kalmanfilter (line 367) | def get_kalmanfilter(self): method init_track (line 371) | def init_track(self, dets, scores, cls, img=None): method get_dists (line 375) | def get_dists(self, tracks, detections): method multi_predict (line 383) | def multi_predict(self, tracks): method reset_id (line 388) | def reset_id(): method reset (line 392) | def reset(self): method joint_stracks (line 402) | def joint_stracks(tlista, tlistb): method sub_stracks (line 417) | def sub_stracks(tlista, tlistb): method remove_duplicate_stracks (line 430) | def remove_duplicate_stracks(stracksa, stracksb): FILE: ultralytics/trackers/track.py function on_predict_start (line 17) | def on_predict_start(predictor: object, persist: bool = False) -> None: function on_predict_postprocess_end (line 47) | def on_predict_postprocess_end(predictor: object, persist: bool = False)... function register_tracker (line 80) | def register_tracker(model: object, persist: bool) -> None: FILE: ultralytics/trackers/utils/gmc.py class GMC (line 11) | class GMC: method __init__ (line 36) | def __init__(self, method: str = "sparseOptFlow", downscale: int = 2) ... method apply (line 80) | def apply(self, raw_frame: np.array, detections: list = None) -> np.ar... method applyEcc (line 106) | def applyEcc(self, raw_frame: np.array) -> np.array: method applyFeatures (line 152) | def applyFeatures(self, raw_frame: np.array, detections: list = None) ... method applySparseOptFlow (line 294) | def applySparseOptFlow(self, raw_frame: np.array) -> np.array: method reset_params (line 358) | def reset_params(self) -> None: FILE: ultralytics/trackers/utils/kalman_filter.py class KalmanFilterXYAH (line 7) | class KalmanFilterXYAH: method __init__ (line 18) | def __init__(self): method initiate (line 33) | def initiate(self, measurement: np.ndarray) -> tuple: method predict (line 62) | def predict(self, mean: np.ndarray, covariance: np.ndarray) -> tuple: method project (line 93) | def project(self, mean: np.ndarray, covariance: np.ndarray) -> tuple: method multi_predict (line 116) | def multi_predict(self, mean: np.ndarray, covariance: np.ndarray) -> t... method update (line 151) | def update(self, mean: np.ndarray, covariance: np.ndarray, measurement... method gating_distance (line 176) | def gating_distance( class KalmanFilterXYWH (line 219) | class KalmanFilterXYWH(KalmanFilterXYAH): method initiate (line 230) | def initiate(self, measurement: np.ndarray) -> tuple: method predict (line 258) | def predict(self, mean, covariance) -> tuple: method project (line 289) | def project(self, mean, covariance) -> tuple: method multi_predict (line 312) | def multi_predict(self, mean, covariance) -> tuple: method update (line 347) | def update(self, mean, covariance, measurement) -> tuple: FILE: ultralytics/trackers/utils/matching.py function linear_assignment (line 20) | def linear_assignment(cost_matrix: np.ndarray, thresh: float, use_lap: b... function iou_distance (line 61) | def iou_distance(atracks: list, btracks: list) -> np.ndarray: function embedding_distance (line 96) | def embedding_distance(tracks: list, detections: list, metric: str = "co... function fuse_score (line 120) | def fuse_score(cost_matrix: np.ndarray, detections: list) -> np.ndarray: FILE: ultralytics/utils/__init__.py class TQDM (line 110) | class TQDM(tqdm_original): method __init__ (line 119) | def __init__(self, *args, **kwargs): class SimpleClass (line 130) | class SimpleClass: method __str__ (line 135) | def __str__(self): method __repr__ (line 149) | def __repr__(self): method __getattr__ (line 153) | def __getattr__(self, attr): class IterableSimpleNamespace (line 159) | class IterableSimpleNamespace(SimpleNamespace): method __iter__ (line 164) | def __iter__(self): method __str__ (line 168) | def __str__(self): method __getattr__ (line 172) | def __getattr__(self, attr): method get (line 184) | def get(self, key, default=None): function plt_settings (line 189) | def plt_settings(rcparams=None, backend="Agg"): function set_logging (line 232) | def set_logging(name=LOGGING_NAME, verbose=True): function emojis (line 276) | def emojis(string=""): class ThreadingLocked (line 281) | class ThreadingLocked: method __init__ (line 301) | def __init__(self): method __call__ (line 305) | def __call__(self, f): function yaml_save (line 318) | def yaml_save(file="data.yaml", data=None, header=""): function yaml_load (line 350) | def yaml_load(file="data.yaml", append_filename=False): function yaml_print (line 376) | def yaml_print(yaml_file: Union[str, Path, dict]) -> None: function is_ubuntu (line 400) | def is_ubuntu() -> bool: function is_colab (line 413) | def is_colab(): function is_kaggle (line 423) | def is_kaggle(): function is_jupyter (line 433) | def is_jupyter(): function is_docker (line 447) | def is_docker() -> bool: function is_online (line 462) | def is_online() -> bool: function is_pip_package (line 486) | def is_pip_package(filepath: str = __name__) -> bool: function is_dir_writeable (line 505) | def is_dir_writeable(dir_path: Union[str, Path]) -> bool: function is_pytest_running (line 518) | def is_pytest_running(): function is_github_action_running (line 528) | def is_github_action_running() -> bool: function is_git_dir (line 538) | def is_git_dir(): function get_git_dir (line 549) | def get_git_dir(): function get_git_origin_url (line 562) | def get_git_origin_url(): function get_git_branch (line 575) | def get_git_branch(): function get_default_args (line 588) | def get_default_args(func): function get_ubuntu_version (line 602) | def get_ubuntu_version(): function get_user_config_dir (line 615) | def get_user_config_dir(sub_dir="yolov10"): function colorstr (line 652) | def colorstr(*input): function remove_colorstr (line 705) | def remove_colorstr(input_string): class TryExcept (line 723) | class TryExcept(contextlib.ContextDecorator): method __init__ (line 740) | def __init__(self, msg="", verbose=True): method __enter__ (line 745) | def __enter__(self): method __exit__ (line 749) | def __exit__(self, exc_type, value, traceback): class Retry (line 756) | class Retry(contextlib.ContextDecorator): method __init__ (line 776) | def __init__(self, times=3, delay=2): method __call__ (line 782) | def __call__(self, func): method __enter__ (line 800) | def __enter__(self): method __exit__ (line 804) | def __exit__(self, exc_type, exc_value, traceback): function threaded (line 815) | def threaded(func): function set_sentry (line 834) | def set_sentry(): class SettingsManager (line 906) | class SettingsManager(dict): method __init__ (line 915) | def __init__(self, file=SETTINGS_YAML, version="0.0.4"): method load (line 980) | def load(self): method save (line 984) | def save(self): method update (line 988) | def update(self, *args, **kwargs): method reset (line 993) | def reset(self): function deprecation_warn (line 1000) | def deprecation_warn(arg, new_arg, version=None): function clean_url (line 1010) | def clean_url(url): function url2file (line 1016) | def url2file(url): FILE: ultralytics/utils/autobatch.py function check_train_batch_size (line 13) | def check_train_batch_size(model, imgsz=640, amp=True): function autobatch (line 30) | def autobatch(model, imgsz=640, fraction=0.60, batch_size=DEFAULT_CFG.ba... FILE: ultralytics/utils/benchmarks.py function benchmark (line 44) | def benchmark( class ProfileModels (line 154) | class ProfileModels: method __init__ (line 178) | def __init__( method profile (line 211) | def profile(self): method get_files (line 248) | def get_files(self): method get_onnx_model_info (line 264) | def get_onnx_model_info(self, onnx_file: str): method iterative_sigma_clipping (line 271) | def iterative_sigma_clipping(data, sigma=2, max_iters=3): method profile_tensorrt_model (line 282) | def profile_tensorrt_model(self, engine_file: str, eps: float = 1e-3): method profile_onnx_model (line 311) | def profile_onnx_model(self, onnx_file: str, eps: float = 1e-3): method generate_table_row (line 366) | def generate_table_row(self, model_name, t_onnx, t_engine, model_info): method generate_results_dict (line 375) | def generate_results_dict(model_name, t_onnx, t_engine, model_info): method print_table (line 387) | def print_table(table_rows): FILE: ultralytics/utils/callbacks/base.py function on_pretrain_routine_start (line 11) | def on_pretrain_routine_start(trainer): function on_pretrain_routine_end (line 16) | def on_pretrain_routine_end(trainer): function on_train_start (line 21) | def on_train_start(trainer): function on_train_epoch_start (line 26) | def on_train_epoch_start(trainer): function on_train_batch_start (line 31) | def on_train_batch_start(trainer): function optimizer_step (line 36) | def optimizer_step(trainer): function on_before_zero_grad (line 41) | def on_before_zero_grad(trainer): function on_train_batch_end (line 46) | def on_train_batch_end(trainer): function on_train_epoch_end (line 51) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 56) | def on_fit_epoch_end(trainer): function on_model_save (line 61) | def on_model_save(trainer): function on_train_end (line 66) | def on_train_end(trainer): function on_params_update (line 71) | def on_params_update(trainer): function teardown (line 76) | def teardown(trainer): function on_val_start (line 84) | def on_val_start(validator): function on_val_batch_start (line 89) | def on_val_batch_start(validator): function on_val_batch_end (line 94) | def on_val_batch_end(validator): function on_val_end (line 99) | def on_val_end(validator): function on_predict_start (line 107) | def on_predict_start(predictor): function on_predict_batch_start (line 112) | def on_predict_batch_start(predictor): function on_predict_batch_end (line 117) | def on_predict_batch_end(predictor): function on_predict_postprocess_end (line 122) | def on_predict_postprocess_end(predictor): function on_predict_end (line 127) | def on_predict_end(predictor): function on_export_start (line 135) | def on_export_start(exporter): function on_export_end (line 140) | def on_export_end(exporter): function get_default_callbacks (line 178) | def get_default_callbacks(): function add_integration_callbacks (line 188) | def add_integration_callbacks(instance): FILE: ultralytics/utils/callbacks/clearml.py function _log_debug_samples (line 19) | def _log_debug_samples(files, title="Debug Samples") -> None: function _log_plot (line 39) | def _log_plot(title, plot_path) -> None: function on_pretrain_routine_start (line 60) | def on_pretrain_routine_start(trainer): function on_train_epoch_end (line 86) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 99) | def on_fit_epoch_end(trainer): function on_val_end (line 115) | def on_val_end(validator): function on_train_end (line 122) | def on_train_end(trainer): FILE: ultralytics/utils/callbacks/comet.py function _get_comet_mode (line 28) | def _get_comet_mode(): function _get_comet_model_name (line 33) | def _get_comet_model_name(): function _get_eval_batch_logging_interval (line 38) | def _get_eval_batch_logging_interval(): function _get_max_image_predictions_to_log (line 43) | def _get_max_image_predictions_to_log(): function _scale_confidence_score (line 48) | def _scale_confidence_score(score): function _should_log_confusion_matrix (line 54) | def _should_log_confusion_matrix(): function _should_log_image_predictions (line 59) | def _should_log_image_predictions(): function _get_experiment_type (line 64) | def _get_experiment_type(mode, project_name): function _create_experiment (line 72) | def _create_experiment(args): function _fetch_trainer_metadata (line 95) | def _fetch_trainer_metadata(trainer): function _scale_bounding_box_to_original_image_shape (line 111) | def _scale_bounding_box_to_original_image_shape(box, resized_image_shape... function _format_ground_truth_annotations_for_detection (line 133) | def _format_ground_truth_annotations_for_detection(img_idx, image_path, ... function _format_prediction_annotations_for_detection (line 163) | def _format_prediction_annotations_for_detection(image_path, metadata, c... function _fetch_annotations (line 186) | def _fetch_annotations(img_idx, image_path, batch, prediction_metadata_m... function _create_prediction_metadata_map (line 201) | def _create_prediction_metadata_map(model_predictions): function _log_confusion_matrix (line 211) | def _log_confusion_matrix(experiment, trainer, curr_step, curr_epoch): function _log_images (line 220) | def _log_images(experiment, image_paths, curr_step, annotations=None): function _log_image_predictions (line 231) | def _log_image_predictions(experiment, validator, curr_step): function _log_plots (line 276) | def _log_plots(experiment, trainer): function _log_model (line 285) | def _log_model(experiment, trainer): function on_pretrain_routine_start (line 291) | def on_pretrain_routine_start(trainer): function on_train_epoch_end (line 299) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 315) | def on_fit_epoch_end(trainer): function on_train_end (line 343) | def on_train_end(trainer): FILE: ultralytics/utils/callbacks/dvc.py function _log_images (line 28) | def _log_images(path, prefix=""): function _log_plots (line 42) | def _log_plots(plots, prefix=""): function _log_confusion_matrix (line 51) | def _log_confusion_matrix(validator): function on_pretrain_routine_start (line 68) | def on_pretrain_routine_start(trainer): function on_pretrain_routine_end (line 78) | def on_pretrain_routine_end(trainer): function on_train_start (line 83) | def on_train_start(trainer): function on_train_epoch_start (line 89) | def on_train_epoch_start(trainer): function on_fit_epoch_end (line 95) | def on_fit_epoch_end(trainer): function on_train_end (line 116) | def on_train_end(trainer): FILE: ultralytics/utils/callbacks/hub.py function on_pretrain_routine_end (line 10) | def on_pretrain_routine_end(trainer): function on_fit_epoch_end (line 21) | def on_fit_epoch_end(trainer): function on_model_save (line 47) | def on_model_save(trainer): function on_train_end (line 59) | def on_train_end(trainer): function on_train_start (line 75) | def on_train_start(trainer): function on_val_start (line 80) | def on_val_start(validator): function on_predict_start (line 85) | def on_predict_start(predictor): function on_export_start (line 90) | def on_export_start(exporter): FILE: ultralytics/utils/callbacks/mlflow.py function on_pretrain_routine_end (line 43) | def on_pretrain_routine_end(trainer): function on_train_epoch_end (line 86) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 98) | def on_fit_epoch_end(trainer): function on_train_end (line 104) | def on_train_end(trainer): FILE: ultralytics/utils/callbacks/neptune.py function _log_scalars (line 19) | def _log_scalars(scalars, step=0): function _log_images (line 26) | def _log_images(imgs_dict, group=""): function _log_plot (line 33) | def _log_plot(title, plot_path): function on_pretrain_routine_start (line 51) | def on_pretrain_routine_start(trainer): function on_train_epoch_end (line 61) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 69) | def on_fit_epoch_end(trainer): function on_val_end (line 78) | def on_val_end(validator): function on_train_end (line 85) | def on_train_end(trainer): FILE: ultralytics/utils/callbacks/raytune.py function on_fit_epoch_end (line 15) | def on_fit_epoch_end(trainer): FILE: ultralytics/utils/callbacks/tensorboard.py function _log_scalars (line 26) | def _log_scalars(scalars, step=0): function _log_tensorboard_graph (line 33) | def _log_tensorboard_graph(trainer): function on_pretrain_routine_start (line 69) | def on_pretrain_routine_start(trainer): function on_train_start (line 80) | def on_train_start(trainer): function on_train_epoch_end (line 86) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 92) | def on_fit_epoch_end(trainer): FILE: ultralytics/utils/callbacks/wb.py function _custom_table (line 22) | def _custom_table(x, y, classes, title="Precision Recall Curve", x_title... function _plot_curve (line 49) | def _plot_curve( function _log_plots (line 101) | def _log_plots(plots, step): function on_pretrain_routine_start (line 110) | def on_pretrain_routine_start(trainer): function on_fit_epoch_end (line 115) | def on_fit_epoch_end(trainer): function on_train_epoch_end (line 124) | def on_train_epoch_end(trainer): function on_train_end (line 132) | def on_train_end(trainer): FILE: ultralytics/utils/checks.py function parse_requirements (line 51) | def parse_requirements(file_path=ROOT.parent / "requirements.txt", packa... function parse_version (line 87) | def parse_version(version="0.0.0") -> tuple: function is_ascii (line 105) | def is_ascii(s) -> bool: function check_imgsz (line 122) | def check_imgsz(imgsz, stride=32, min_dim=1, max_dim=2, floor=0): function check_version (line 176) | def check_version( function check_latest_pypi_version (line 257) | def check_latest_pypi_version(package_name="ultralytics"): function check_pip_update_available (line 274) | def check_pip_update_available(): function check_font (line 296) | def check_font(font="Arial.ttf"): function check_python (line 325) | def check_python(minimum: str = "3.8.0") -> bool: function check_requirements (line 339) | def check_requirements(requirements=ROOT.parent / "requirements.txt", ex... function check_torchvision (line 408) | def check_torchvision(): function check_suffix (line 440) | def check_suffix(file="yolov8n.pt", suffix=".pt", msg=""): function check_yolov5u_filename (line 451) | def check_yolov5u_filename(file: str, verbose: bool = True): function check_model_file_from_stem (line 470) | def check_model_file_from_stem(model="yolov8n"): function check_file (line 478) | def check_file(file, suffix="", download=True, hard=True): function check_yaml (line 506) | def check_yaml(file, suffix=(".yaml", ".yml"), hard=True): function check_is_path_safe (line 511) | def check_is_path_safe(basedir, path): function check_imshow (line 528) | def check_imshow(warn=False): function check_yolo (line 544) | def check_yolo(verbose=True, device=""): function collect_system_info (line 573) | def collect_system_info(): function check_amp (line 613) | def check_amp(model): function git_describe (line 671) | def git_describe(path=ROOT): # path must be a directory function print_args (line 678) | def print_args(args: Optional[dict] = None, show_file=True, show_func=Fa... function cuda_device_count (line 698) | def cuda_device_count() -> int: function cuda_is_available (line 720) | def cuda_is_available() -> bool: FILE: ultralytics/utils/dist.py function find_free_network_port (line 13) | def find_free_network_port() -> int: function generate_ddp_file (line 25) | def generate_ddp_file(trainer): function generate_ddp_command (line 55) | def generate_ddp_command(world_size, trainer): function ddp_cleanup (line 68) | def ddp_cleanup(trainer, file): FILE: ultralytics/utils/downloads.py function is_url (line 36) | def is_url(url, check=False): function delete_dsstore (line 65) | def delete_dsstore(path, files_to_delete=(".DS_Store", "__MACOSX")): function zip_directory (line 91) | def zip_directory(directory, compress=True, exclude=(".DS_Store", "__MAC... function unzip_file (line 130) | def unzip_file(file, path=None, exclude=(".DS_Store", "__MACOSX"), exist... function check_disk_space (line 194) | def check_disk_space(url="https://ultralytics.com/assets/coco128.zip", p... function get_google_drive_file_info (line 232) | def get_google_drive_file_info(link): function safe_download (line 274) | def safe_download( function get_github_assets (line 373) | def get_github_assets(repo="ultralytics/assets", version="latest", retry... function attempt_download_asset (line 405) | def attempt_download_asset(file, repo="ultralytics/assets", release="v8.... function download (line 459) | def download(url, dir=Path.cwd(), unzip=True, delete=False, curl=False, ... FILE: ultralytics/utils/errors.py class HUBModelError (line 6) | class HUBModelError(Exception): method __init__ (line 20) | def __init__(self, message="Model not found. Please check model URL an... FILE: ultralytics/utils/files.py class WorkingDirectory (line 13) | class WorkingDirectory(contextlib.ContextDecorator): method __init__ (line 16) | def __init__(self, new_dir): method __enter__ (line 21) | def __enter__(self): method __exit__ (line 25) | def __exit__(self, exc_type, exc_val, exc_tb): # noqa function spaces_in_path (line 31) | def spaces_in_path(path): function increment_path (line 85) | def increment_path(path, exist_ok=False, sep="", mkdir=False): function file_age (line 120) | def file_age(path=__file__): function file_date (line 126) | def file_date(path=__file__): function file_size (line 132) | def file_size(path): function get_latest_run (line 144) | def get_latest_run(search_dir="."): function update_models (line 150) | def update_models(model_names=("yolov8n.pt",), source_dir=Path("."), upd... FILE: ultralytics/utils/instance.py function _ntuple (line 13) | def _ntuple(n): class Bboxes (line 34) | class Bboxes: method __init__ (line 49) | def __init__(self, bboxes, format="xyxy") -> None: method convert (line 59) | def convert(self, format): method areas (line 73) | def areas(self): method mul (line 94) | def mul(self, scale): method add (line 108) | def add(self, offset): method __len__ (line 122) | def __len__(self): method concatenate (line 127) | def concatenate(cls, boxes_list: List["Bboxes"], axis=0) -> "Bboxes": method __getitem__ (line 151) | def __getitem__(self, index) -> "Bboxes": class Instances (line 176) | class Instances: method __init__ (line 208) | def __init__(self, bboxes, segments=None, keypoints=None, bbox_format=... method convert_bbox (line 220) | def convert_bbox(self, format): method bbox_areas (line 225) | def bbox_areas(self): method scale (line 229) | def scale(self, scale_w, scale_h, bbox_only=False): method denormalize (line 240) | def denormalize(self, w, h): method normalize (line 252) | def normalize(self, w, h): method add_padding (line 264) | def add_padding(self, padw, padh): method __getitem__ (line 274) | def __getitem__(self, index) -> "Instances": method flipud (line 302) | def flipud(self, h): method fliplr (line 315) | def fliplr(self, w): method clip (line 328) | def clip(self, w, h): method remove_zero_area_boxes (line 342) | def remove_zero_area_boxes(self): method update (line 357) | def update(self, bboxes, segments=None, keypoints=None): method __len__ (line 365) | def __len__(self): method concatenate (line 370) | def concatenate(cls, instances_list: List["Instances"], axis=0) -> "In... method bboxes (line 405) | def bboxes(self): FILE: ultralytics/utils/loss.py class VarifocalLoss (line 14) | class VarifocalLoss(nn.Module): method __init__ (line 21) | def __init__(self): method forward (line 26) | def forward(pred_score, gt_score, label, alpha=0.75, gamma=2.0): class FocalLoss (line 38) | class FocalLoss(nn.Module): method __init__ (line 41) | def __init__(self): method forward (line 46) | def forward(pred, label, gamma=1.5, alpha=0.25): class BboxLoss (line 63) | class BboxLoss(nn.Module): method __init__ (line 66) | def __init__(self, reg_max, use_dfl=False): method forward (line 72) | def forward(self, pred_dist, pred_bboxes, anchor_points, target_bboxes... method _df_loss (line 89) | def _df_loss(pred_dist, target): class RotatedBboxLoss (line 106) | class RotatedBboxLoss(BboxLoss): method __init__ (line 109) | def __init__(self, reg_max, use_dfl=False): method forward (line 113) | def forward(self, pred_dist, pred_bboxes, anchor_points, target_bboxes... class KeypointLoss (line 130) | class KeypointLoss(nn.Module): method __init__ (line 133) | def __init__(self, sigmas) -> None: method forward (line 138) | def forward(self, pred_kpts, gt_kpts, kpt_mask, area): class v8DetectionLoss (line 147) | class v8DetectionLoss: method __init__ (line 150) | def __init__(self, model, tal_topk=10): # model must be de-paralleled method preprocess (line 170) | def preprocess(self, targets, batch_size, scale_tensor): method bbox_decode (line 187) | def bbox_decode(self, anchor_points, pred_dist): method __call__ (line 196) | def __call__(self, preds, batch): class v8SegmentationLoss (line 250) | class v8SegmentationLoss(v8DetectionLoss): method __init__ (line 253) | def __init__(self, model): # model must be de-paralleled method __call__ (line 258) | def __call__(self, preds, batch): method single_mask_loss (line 342) | def single_mask_loss( method calculate_segmentation_loss (line 366) | def calculate_segmentation_loss( class v8PoseLoss (line 433) | class v8PoseLoss(v8DetectionLoss): method __init__ (line 436) | def __init__(self, model): # model must be de-paralleled method __call__ (line 446) | def __call__(self, preds, batch): method kpts_decode (line 513) | def kpts_decode(anchor_points, pred_kpts): method calculate_keypoints_loss (line 521) | def calculate_keypoints_loss( class v8ClassificationLoss (line 589) | class v8ClassificationLoss: method __call__ (line 592) | def __call__(self, preds, batch): class v8OBBLoss (line 599) | class v8OBBLoss(v8DetectionLoss): method __init__ (line 600) | def __init__(self, model): method preprocess (line 610) | def preprocess(self, targets, batch_size, scale_tensor): method __call__ (line 628) | def __call__(self, preds, batch): method bbox_decode (line 700) | def bbox_decode(self, anchor_points, pred_dist, pred_angle): class v10DetectLoss (line 717) | class v10DetectLoss: method __init__ (line 718) | def __init__(self, model): method __call__ (line 722) | def __call__(self, preds, batch): FILE: ultralytics/utils/metrics.py function bbox_ioa (line 20) | def bbox_ioa(box1, box2, iou=False, eps=1e-7): function box_iou (line 53) | def box_iou(box1, box2, eps=1e-7): function bbox_iou (line 78) | def bbox_iou(box1, box2, xywh=True, GIoU=False, DIoU=False, CIoU=False, ... function mask_iou (line 137) | def mask_iou(mask1, mask2, eps=1e-7): function kpt_iou (line 156) | def kpt_iou(kpt1, kpt2, area, sigma, eps=1e-7): function _get_covariance_matrix (line 178) | def _get_covariance_matrix(boxes): function probiou (line 198) | def probiou(obb1, obb2, CIoU=False, eps=1e-7): function batch_probiou (line 237) | def batch_probiou(obb1, obb2, eps=1e-7): function smooth_BCE (line 271) | def smooth_BCE(eps=0.1): class ConfusionMatrix (line 287) | class ConfusionMatrix: method __init__ (line 299) | def __init__(self, nc, conf=0.25, iou_thres=0.45, task="detect"): method process_cls_preds (line 307) | def process_cls_preds(self, preds, targets): method process_batch (line 319) | def process_batch(self, detections, gt_bboxes, gt_cls): method matrix (line 378) | def matrix(self): method tp_fp (line 382) | def tp_fp(self): method plot (line 391) | def plot(self, normalize=True, save_dir="", names=(), on_plot=None): method print (line 435) | def print(self): function smooth (line 441) | def smooth(y, f=0.05): function plot_pr_curve (line 450) | def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names=(), o... function plot_mc_curve (line 475) | def plot_mc_curve(px, py, save_dir=Path("mc_curve.png"), names=(), xlabe... function compute_ap (line 499) | def compute_ap(recall, precision): function ap_per_class (line 532) | def ap_per_class( class Metric (line 623) | class Metric(SimpleClass): method __init__ (line 650) | def __init__(self) -> None: method ap50 (line 660) | def ap50(self): method ap (line 670) | def ap(self): method mp (line 680) | def mp(self): method mr (line 690) | def mr(self): method map50 (line 700) | def map50(self): method map75 (line 710) | def map75(self): method map (line 720) | def map(self): method mean_results (line 729) | def mean_results(self): method class_result (line 733) | def class_result(self, i): method maps (line 738) | def maps(self): method fitness (line 745) | def fitness(self): method update (line 750) | def update(self, results): method curves (line 780) | def curves(self): method curves_results (line 785) | def curves_results(self): class DetMetrics (line 795) | class DetMetrics(SimpleClass): method __init__ (line 827) | def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names... method process (line 837) | def process(self, tp, conf, pred_cls, target_cls): method keys (line 853) | def keys(self): method mean_results (line 857) | def mean_results(self): method class_result (line 861) | def class_result(self, i): method maps (line 866) | def maps(self): method fitness (line 871) | def fitness(self): method ap_class_index (line 876) | def ap_class_index(self): method results_dict (line 881) | def results_dict(self): method curves (line 886) | def curves(self): method curves_results (line 891) | def curves_results(self): class SegmentMetrics (line 896) | class SegmentMetrics(SimpleClass): method __init__ (line 925) | def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names... method process (line 936) | def process(self, tp, tp_m, conf, pred_cls, target_cls): method keys (line 976) | def keys(self): method mean_results (line 989) | def mean_results(self): method class_result (line 993) | def class_result(self, i): method maps (line 998) | def maps(self): method fitness (line 1003) | def fitness(self): method ap_class_index (line 1008) | def ap_class_index(self): method results_dict (line 1013) | def results_dict(self): method curves (line 1018) | def curves(self): method curves_results (line 1032) | def curves_results(self): class PoseMetrics (line 1037) | class PoseMetrics(SegmentMetrics): method __init__ (line 1066) | def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names... method process (line 1078) | def process(self, tp, tp_p, conf, pred_cls, target_cls): method keys (line 1118) | def keys(self): method mean_results (line 1131) | def mean_results(self): method class_result (line 1135) | def class_result(self, i): method maps (line 1140) | def maps(self): method fitness (line 1145) | def fitness(self): method curves (line 1150) | def curves(self): method curves_results (line 1164) | def curves_results(self): class ClassifyMetrics (line 1169) | class ClassifyMetrics(SimpleClass): method __init__ (line 1187) | def __init__(self) -> None: method process (line 1194) | def process(self, targets, pred): method fitness (line 1202) | def fitness(self): method results_dict (line 1207) | def results_dict(self): method keys (line 1212) | def keys(self): method curves (line 1217) | def curves(self): method curves_results (line 1222) | def curves_results(self): class OBBMetrics (line 1227) | class OBBMetrics(SimpleClass): method __init__ (line 1228) | def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names... method process (line 1236) | def process(self, tp, conf, pred_cls, target_cls): method keys (line 1252) | def keys(self): method mean_results (line 1256) | def mean_results(self): method class_result (line 1260) | def class_result(self, i): method maps (line 1265) | def maps(self): method fitness (line 1270) | def fitness(self): method ap_class_index (line 1275) | def ap_class_index(self): method results_dict (line 1280) | def results_dict(self): method curves (line 1285) | def curves(self): method curves_results (line 1290) | def curves_results(self): FILE: ultralytics/utils/ops.py class Profile (line 18) | class Profile(contextlib.ContextDecorator): method __init__ (line 33) | def __init__(self, t=0.0, device: torch.device = None): method __enter__ (line 45) | def __enter__(self): method __exit__ (line 50) | def __exit__(self, type, value, traceback): # noqa method __str__ (line 55) | def __str__(self): method time (line 59) | def time(self): function segment2box (line 66) | def segment2box(segment, width=640, height=640): function scale_boxes (line 89) | def scale_boxes(img1_shape, boxes, img0_shape, ratio_pad=None, padding=T... function make_divisible (line 127) | def make_divisible(x, divisor): function nms_rotated (line 143) | def nms_rotated(boxes, scores, threshold=0.45): function non_max_suppression (line 163) | def non_max_suppression( function clip_boxes (line 305) | def clip_boxes(boxes, shape): function clip_coords (line 327) | def clip_coords(coords, shape): function scale_image (line 347) | def scale_image(masks, im0_shape, ratio_pad=None): function xyxy2xywh (line 382) | def xyxy2xywh(x): function xywh2xyxy (line 402) | def xywh2xyxy(x): function xywhn2xyxy (line 424) | def xywhn2xyxy(x, w=640, h=640, padw=0, padh=0): function xyxy2xywhn (line 447) | def xyxy2xywhn(x, w=640, h=640, clip=False, eps=0.0): function xywh2ltwh (line 473) | def xywh2ltwh(x): function xyxy2ltwh (line 489) | def xyxy2ltwh(x): function ltwh2xywh (line 505) | def ltwh2xywh(x): function xyxyxyxy2xywhr (line 521) | def xyxyxyxy2xywhr(corners): function xywhr2xyxyxyxy (line 548) | def xywhr2xyxyxyxy(rboxes): function ltwh2xyxy (line 576) | def ltwh2xyxy(x): function segments2boxes (line 592) | def segments2boxes(segments): function resample_segments (line 609) | def resample_segments(segments, n=1000): function crop_mask (line 630) | def crop_mask(masks, boxes): function process_mask_upsample (line 649) | def process_mask_upsample(protos, masks_in, bboxes, shape): function process_mask (line 670) | def process_mask(protos, masks_in, bboxes, shape, upsample=False): function process_mask_native (line 704) | def process_mask_native(protos, masks_in, bboxes, shape): function scale_masks (line 724) | def scale_masks(masks, shape, padding=True): function scale_coords (line 748) | def scale_coords(img1_shape, coords, img0_shape, ratio_pad=None, normali... function regularize_rboxes (line 783) | def regularize_rboxes(rboxes): function masks2segments (line 801) | def masks2segments(masks, strategy="largest"): function convert_torch2numpy_batch (line 826) | def convert_torch2numpy_batch(batch: torch.Tensor) -> np.ndarray: function clean_str (line 839) | def clean_str(s): function v10postprocess (line 851) | def v10postprocess(preds, max_det, nc=80): FILE: ultralytics/utils/patches.py function imread (line 15) | def imread(filename: str, flags: int = cv2.IMREAD_COLOR): function imwrite (line 29) | def imwrite(filename: str, img: np.ndarray, params=None): function imshow (line 48) | def imshow(winname: str, mat: np.ndarray): function torch_save (line 63) | def torch_save(*args, use_dill=True, **kwargs): FILE: ultralytics/utils/plotting.py class Colors (line 20) | class Colors: method __init__ (line 33) | def __init__(self): method __call__ (line 85) | def __call__(self, i, bgr=False): method hex2rgb (line 91) | def hex2rgb(h): class Annotator (line 99) | class Annotator: method __init__ (line 113) | def __init__(self, im, line_width=None, font_size=None, font="Arial.tt... method box_label (line 162) | def box_label(self, box, label="", color=(128, 128, 128), txt_color=(2... method masks (line 207) | def masks(self, masks, colors, im_gpu, alpha=0.5, retina_masks=False): method kpts (line 243) | def kpts(self, kpts, shape=(640, 640), radius=5, kpt_line=True): method rectangle (line 292) | def rectangle(self, xy, fill=None, outline=None, width=1): method text (line 296) | def text(self, xy, text, txt_color=(255, 255, 255), anchor="top", box_... method fromarray (line 325) | def fromarray(self, im): method result (line 330) | def result(self): method show (line 334) | def show(self, title=None): method save (line 338) | def save(self, filename="image.jpg"): method draw_region (line 342) | def draw_region(self, reg_pts=None, color=(0, 255, 0), thickness=5): method draw_centroid_and_tracks (line 353) | def draw_centroid_and_tracks(self, track, color=(255, 0, 255), track_t... method count_labels (line 366) | def count_labels(self, counts=0, count_txt_size=2, color=(255, 255, 25... method estimate_pose_angle (line 397) | def estimate_pose_angle(a, b, c): method draw_specific_points (line 416) | def draw_specific_points(self, keypoints, indices=[2, 5, 7], shape=(64... method plot_angle_and_count_and_stage (line 437) | def plot_angle_and_count_and_stage(self, angle_text, count_text, stage... method seg_bbox (line 507) | def seg_bbox(self, mask, mask_color=(255, 0, 255), det_label=None, tra... method plot_distance_and_line (line 534) | def plot_distance_and_line(self, distance_m, distance_mm, centroids, l... method visioneye (line 579) | def visioneye(self, box, center_point, color=(235, 219, 11), pin_color... function plot_labels (line 599) | def plot_labels(boxes, cls, names=(), save_dir=Path(""), on_plot=None): function save_one_box (line 653) | def save_one_box(xyxy, im, file=Path("im.jpg"), gain=1.02, pad=10, squar... function plot_images (line 702) | def plot_images( function plot_results (line 842) | def plot_results(file="path/to/results.csv", dir="", segment=False, pose... function plt_color_scatter (line 905) | def plt_color_scatter(v, f, bins=20, cmap="viridis", alpha=0.8, edgecolo... function plot_tune_results (line 937) | def plot_tune_results(csv_file="tune_results.csv"): function output_to_target (line 995) | def output_to_target(output, max_det=300): function output_to_rotated_target (line 1006) | def output_to_rotated_target(output, max_det=300): function feature_visualization (line 1017) | def feature_visualization(x, module_type, stage, n=32, save_dir=Path("ru... FILE: ultralytics/utils/tal.py class TaskAlignedAssigner (line 13) | class TaskAlignedAssigner(nn.Module): method __init__ (line 28) | def __init__(self, topk=13, num_classes=80, alpha=1.0, beta=6.0, eps=1... method forward (line 39) | def forward(self, pd_scores, pd_bboxes, anc_points, gt_labels, gt_bbox... method get_pos_mask (line 90) | def get_pos_mask(self, pd_scores, pd_bboxes, gt_labels, gt_bboxes, anc... method get_box_metrics (line 102) | def get_box_metrics(self, pd_scores, pd_bboxes, gt_labels, gt_bboxes, ... method iou_calculation (line 123) | def iou_calculation(self, gt_bboxes, pd_bboxes): method select_topk_candidates (line 127) | def select_topk_candidates(self, metrics, largest=True, topk_mask=None): method get_targets (line 163) | def get_targets(self, gt_labels, gt_bboxes, target_gt_idx, fg_mask): method select_candidates_in_gts (line 213) | def select_candidates_in_gts(xy_centers, gt_bboxes, eps=1e-9): method select_highest_overlaps (line 232) | def select_highest_overlaps(mask_pos, overlaps, n_max_boxes): class RotatedTaskAlignedAssigner (line 261) | class RotatedTaskAlignedAssigner(TaskAlignedAssigner): method iou_calculation (line 262) | def iou_calculation(self, gt_bboxes, pd_bboxes): method select_candidates_in_gts (line 267) | def select_candidates_in_gts(xy_centers, gt_bboxes): function make_anchors (line 294) | def make_anchors(feats, strides, grid_cell_offset=0.5): function dist2bbox (line 309) | def dist2bbox(distance, anchor_points, xywh=True, dim=-1): function bbox2dist (line 322) | def bbox2dist(anchor_points, bbox, reg_max): function dist2rbox (line 328) | def dist2rbox(pred_dist, pred_angle, anchor_points, dim=-1): FILE: ultralytics/utils/torch_utils.py function torch_distributed_zero_first (line 37) | def torch_distributed_zero_first(local_rank: int): function smart_inference_mode (line 47) | def smart_inference_mode(): function get_cpu_info (line 60) | def get_cpu_info(): function select_device (line 70) | def select_device(device="", batch=0, newline=False, verbose=True): function time_sync (line 164) | def time_sync(): function fuse_conv_and_bn (line 171) | def fuse_conv_and_bn(conv, bn): function fuse_deconv_and_bn (line 201) | def fuse_deconv_and_bn(deconv, bn): function model_info (line 232) | def model_info(model, detailed=False, verbose=True, imgsz=640): function get_num_params (line 263) | def get_num_params(model): function get_num_gradients (line 268) | def get_num_gradients(model): function model_info_for_loggers (line 273) | def model_info_for_loggers(trainer): function get_flops (line 301) | def get_flops(model, imgsz=640): function get_flops_with_torch_profiler (line 326) | def get_flops_with_torch_profiler(model, imgsz=640): function initialize_weights (line 342) | def initialize_weights(model): function scale_img (line 355) | def scale_img(img, ratio=1.0, same_shape=False, gs=32): function make_divisible (line 369) | def make_divisible(x, divisor): function copy_attr (line 376) | def copy_attr(a, b, include=(), exclude=()): function get_latest_opset (line 385) | def get_latest_opset(): function intersect_dicts (line 390) | def intersect_dicts(da, db, exclude=()): function is_parallel (line 395) | def is_parallel(model): function de_parallel (line 400) | def de_parallel(model): function one_cycle (line 405) | def one_cycle(y1=0.0, y2=1.0, steps=100): function init_seeds (line 410) | def init_seeds(seed=0, deterministic=False): class ModelEMA (line 431) | class ModelEMA: method __init__ (line 438) | def __init__(self, model, decay=0.9999, tau=2000, updates=0): method update (line 447) | def update(self, model): method update_attr (line 460) | def update_attr(self, model, include=(), exclude=("process_group", "re... function strip_optimizer (line 466) | def strip_optimizer(f: Union[str, Path] = "best.pt", s: str = "") -> None: function profile (line 509) | def profile(input, ops, n=10, device=None): class EarlyStopping (line 568) | class EarlyStopping: method __init__ (line 571) | def __init__(self, patience=50): method __call__ (line 583) | def __call__(self, epoch, fitness): FILE: ultralytics/utils/triton.py class TritonRemoteModel (line 9) | class TritonRemoteModel: method __init__ (line 25) | def __init__(self, url: str, endpoint: str = "", scheme: str = ""): method __call__ (line 70) | def __call__(self, *inputs: np.ndarray) -> List[np.ndarray]: FILE: ultralytics/utils/tuner.py function run_ray_tune (line 9) | def run_ray_tune(