SYMBOL INDEX (1574 symbols across 105 files) FILE: Inference.py function parse_args (line 9) | def parse_args(): function main (line 74) | def main(args): FILE: app_gradio.py function segment_everything (line 72) | def segment_everything( function segment_with_points (line 118) | def segment_with_points( function get_points_with_draw (line 167) | def get_points_with_draw(image, label, evt: gr.SelectData): function clear (line 363) | def clear(): function clear_text (line 366) | def clear_text(): FILE: fastsam/decoder.py class FastSAMDecoder (line 7) | class FastSAMDecoder: method __init__ (line 8) | def __init__( method run_encoder (line 26) | def run_encoder(self, image): method run_decoder (line 40) | def run_decoder( method box_prompt (line 61) | def box_prompt(self, bbox): method point_prompt (line 91) | def point_prompt(self, points, pointlabel): # numpy method _format_results (line 115) | def _format_results(self, result, filter=0): FILE: fastsam/model.py class FastSAM (line 22) | class FastSAM(YOLO): method predict (line 25) | def predict(self, source=None, stream=False, **kwargs): method train (line 55) | def train(self, **kwargs): method val (line 59) | def val(self, **kwargs): method export (line 71) | def export(self, **kwargs): method info (line 89) | def info(self, detailed=False, verbose=True): method __call__ (line 99) | def __call__(self, source=None, stream=False, **kwargs): method __getattr__ (line 103) | def __getattr__(self, attr): FILE: fastsam/predict.py class FastSAMPredictor (line 8) | class FastSAMPredictor(DetectionPredictor): method __init__ (line 10) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 14) | def postprocess(self, preds, img, orig_imgs): FILE: fastsam/prompt.py class FastSAMPrompt (line 11) | class FastSAMPrompt: method __init__ (line 13) | def __init__(self, image, results, device='cuda'): method _segment_image (line 20) | def _segment_image(self, image, bbox): method _format_results (line 37) | def _format_results(self, result, filter=0): method filter_masks (line 54) | def filter_masks(annotations): # filte the overlap mask method _get_bbox_from_mask (line 69) | def _get_bbox_from_mask(self, mask): method plot_to_result (line 86) | def plot_to_result(self, method plot (line 183) | def plot(self, method fast_show_mask (line 213) | def fast_show_mask( method fast_show_mask_gpu (line 270) | def fast_show_mask_gpu( method retrieve (line 332) | def retrieve(self, model, preprocess, elements, search_text: str, devi... method _crop_image (line 353) | def _crop_image(self, format_results): method box_prompt (line 378) | def box_prompt(self, bbox=None, bboxes=None): method point_prompt (line 415) | def point_prompt(self, points, pointlabel): # numpy method text_prompt (line 440) | def text_prompt(self, text): method everything_prompt (line 452) | def everything_prompt(self): FILE: fastsam/utils.py function adjust_bboxes_to_image_border (line 6) | def adjust_bboxes_to_image_border(boxes, image_shape, threshold=20): function convert_box_xywh_to_xyxy (line 33) | def convert_box_xywh_to_xyxy(box): function bbox_iou (line 41) | def bbox_iou(box1, boxes, iou_thres=0.9, image_shape=(640, 640), raw_out... function image_to_np_ndarray (line 79) | def image_to_np_ndarray(image): FILE: predict.py class Predictor (line 14) | class Predictor(BasePredictor): method setup (line 15) | def setup(self): method predict (line 19) | def predict( function prompt (line 140) | def prompt(results, args, box=None, point=None, text=None): FILE: ultralytics/hub/__init__.py function login (line 11) | def login(api_key=''): function logout (line 25) | def logout(): function start (line 38) | def start(key=''): function reset_model (line 57) | def reset_model(model_id=''): function export_fmts_hub (line 66) | def export_fmts_hub(): function export_model (line 72) | def export_model(model_id='', format='torchscript'): function get_export (line 82) | def get_export(model_id='', format='torchscript'): function check_dataset (line 94) | def check_dataset(path='', task='detect'): FILE: ultralytics/hub/auth.py class Auth (line 11) | class Auth: method __init__ (line 14) | def __init__(self, api_key='', verbose=False): method request_api_key (line 55) | def request_api_key(self, max_attempts=3): method authenticate (line 68) | def authenticate(self) -> bool: method auth_with_cookies (line 88) | def auth_with_cookies(self) -> bool: method get_auth_header (line 109) | def get_auth_header(self): method get_state (line 123) | def get_state(self) -> bool: method set_api_key (line 132) | def set_api_key(self, key: str): FILE: ultralytics/hub/session.py class HUBTrainingSession (line 16) | class HUBTrainingSession: method __init__ (line 36) | def __init__(self, url): method _register_signal_handlers (line 78) | def _register_signal_handlers(self): method _handle_signal (line 83) | def _handle_signal(self, signum, frame): method _stop_heartbeat (line 93) | def _stop_heartbeat(self): method upload_metrics (line 97) | def upload_metrics(self): method _get_model (line 102) | def _get_model(self): method upload_model (line 139) | def upload_model(self, epoch, weights, is_best=False, map=0.0, final=F... method _start_heartbeat (line 176) | def _start_heartbeat(self): FILE: ultralytics/hub/utils.py function request_with_credentials (line 23) | def request_with_credentials(url: str) -> any: function requests_with_progress (line 60) | def requests_with_progress(method, url, **kwargs): function smart_request (line 88) | def smart_request(method, url, retry=3, timeout=30, thread=True, code=-1... class Events (line 145) | class Events: method __init__ (line 159) | def __init__(self): method __call__ (line 181) | def __call__(self, cfg): FILE: ultralytics/nn/autobackend.py function check_class_names (line 24) | def check_class_names(names): class AutoBackend (line 41) | class AutoBackend(nn.Module): method __init__ (line 43) | def __init__(self, method forward (line 295) | def forward(self, im, augment=False, visualize=False): method from_numpy (line 402) | def from_numpy(self, x): method warmup (line 414) | def warmup(self, imgsz=(1, 3, 640, 640)): method _apply_default_class_names (line 431) | def _apply_default_class_names(data): method _model_type (line 438) | def _model_type(p='path/to/model.pt'): FILE: ultralytics/nn/autoshape.py class AutoShape (line 26) | class AutoShape(nn.Module): method __init__ (line 36) | def __init__(self, model, verbose=True): method _apply (line 50) | def _apply(self, fn): method forward (line 62) | def forward(self, ims, size=640, augment=False, profile=False): class Detections (line 126) | class Detections: method __init__ (line 129) | def __init__(self, ims, pred, files, times=(0, 0, 0), names=None, shap... method _run (line 147) | def _run(self, pprint=False, show=False, save=False, crop=False, rende... method show (line 193) | def show(self, labels=True): method save (line 197) | def save(self, labels=True, save_dir='runs/detect/exp', exist_ok=False): method crop (line 202) | def crop(self, save=True, save_dir='runs/detect/exp', exist_ok=False): method render (line 207) | def render(self, labels=True): method pandas (line 212) | def pandas(self): method tolist (line 223) | def tolist(self): method print (line 232) | def print(self): method __len__ (line 236) | def __len__(self): # override len(results) method __str__ (line 239) | def __str__(self): # override print(results) method __repr__ (line 242) | def __repr__(self): FILE: ultralytics/nn/modules/block.py class DFL (line 17) | class DFL(nn.Module): method __init__ (line 23) | def __init__(self, c1=16): method forward (line 31) | def forward(self, x): class Proto (line 38) | class Proto(nn.Module): method __init__ (line 41) | def __init__(self, c1, c_=256, c2=32): # ch_in, number of protos, num... method forward (line 48) | def forward(self, x): class HGStem (line 53) | class HGStem(nn.Module): method __init__ (line 58) | def __init__(self, c1, cm, c2): method forward (line 67) | def forward(self, x): class HGBlock (line 81) | class HGBlock(nn.Module): method __init__ (line 86) | def __init__(self, c1, cm, c2, k=3, n=6, lightconv=False, shortcut=Fal... method forward (line 94) | def forward(self, x): class SPP (line 102) | class SPP(nn.Module): method __init__ (line 105) | def __init__(self, c1, c2, k=(5, 9, 13)): method forward (line 113) | def forward(self, x): class SPPF (line 119) | class SPPF(nn.Module): method __init__ (line 122) | def __init__(self, c1, c2, k=5): # equivalent to SPP(k=(5, 9, 13)) method forward (line 129) | def forward(self, x): class C1 (line 137) | class C1(nn.Module): method __init__ (line 140) | def __init__(self, c1, c2, n=1): # ch_in, ch_out, number method forward (line 145) | def forward(self, x): class C2 (line 151) | class C2(nn.Module): method __init__ (line 154) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ... method forward (line 162) | def forward(self, x): class C2f (line 168) | class C2f(nn.Module): method __init__ (line 171) | def __init__(self, c1, c2, n=1, shortcut=False, g=1, e=0.5): # ch_in,... method forward (line 178) | def forward(self, x): method forward_split (line 184) | def forward_split(self, x): class C3 (line 191) | class C3(nn.Module): method __init__ (line 194) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ... method forward (line 202) | def forward(self, x): class C3x (line 207) | class C3x(C3): method __init__ (line 210) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class RepC3 (line 217) | class RepC3(nn.Module): method __init__ (line 220) | def __init__(self, c1, c2, n=3, e=1.0): method forward (line 228) | def forward(self, x): class C3TR (line 233) | class C3TR(C3): method __init__ (line 236) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class C3Ghost (line 243) | class C3Ghost(C3): method __init__ (line 246) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): class GhostBottleneck (line 253) | class GhostBottleneck(nn.Module): method __init__ (line 256) | def __init__(self, c1, c2, k=3, s=1): # ch_in, ch_out, kernel, stride method forward (line 266) | def forward(self, x): class Bottleneck (line 271) | class Bottleneck(nn.Module): method __init__ (line 274) | def __init__(self, c1, c2, shortcut=True, g=1, k=(3, 3), e=0.5): # ch... method forward (line 281) | def forward(self, x): class BottleneckCSP (line 286) | class BottleneckCSP(nn.Module): method __init__ (line 289) | def __init__(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ... method forward (line 300) | def forward(self, x): FILE: ultralytics/nn/modules/conv.py function autopad (line 16) | def autopad(k, p=None, d=1): # kernel, padding, dilation class Conv (line 25) | class Conv(nn.Module): method __init__ (line 29) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, d=1, act=True): method forward (line 36) | def forward(self, x): method forward_fuse (line 40) | def forward_fuse(self, x): class Conv2 (line 45) | class Conv2(Conv): method __init__ (line 48) | def __init__(self, c1, c2, k=3, s=1, p=None, g=1, d=1, act=True): method forward (line 53) | def forward(self, x): method fuse_convs (line 57) | def fuse_convs(self): class LightConv (line 66) | class LightConv(nn.Module): method __init__ (line 71) | def __init__(self, c1, c2, k=1, act=nn.ReLU()): method forward (line 77) | def forward(self, x): class DWConv (line 82) | class DWConv(Conv): method __init__ (line 85) | def __init__(self, c1, c2, k=1, s=1, d=1, act=True): # ch_in, ch_out,... class DWConvTranspose2d (line 89) | class DWConvTranspose2d(nn.ConvTranspose2d): method __init__ (line 92) | def __init__(self, c1, c2, k=1, s=1, p1=0, p2=0): # ch_in, ch_out, ke... class ConvTranspose (line 96) | class ConvTranspose(nn.Module): method __init__ (line 100) | def __init__(self, c1, c2, k=2, s=2, p=0, bn=True, act=True): method forward (line 107) | def forward(self, x): method forward_fuse (line 111) | def forward_fuse(self, x): class Focus (line 116) | class Focus(nn.Module): method __init__ (line 119) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in,... method forward (line 124) | def forward(self, x): # x(b,c,w,h) -> y(b,4c,w/2,h/2) class GhostConv (line 129) | class GhostConv(nn.Module): method __init__ (line 132) | def __init__(self, c1, c2, k=1, s=1, g=1, act=True): # ch_in, ch_out,... method forward (line 138) | def forward(self, x): class RepConv (line 144) | class RepConv(nn.Module): method __init__ (line 150) | def __init__(self, c1, c2, k=3, s=1, p=1, g=1, d=1, act=True, bn=False... method forward_fuse (line 162) | def forward_fuse(self, x): method forward (line 166) | def forward(self, x): method get_equivalent_kernel_bias (line 171) | def get_equivalent_kernel_bias(self): method _avg_to_3x3_tensor (line 177) | def _avg_to_3x3_tensor(self, avgp): method _pad_1x1_to_3x3_tensor (line 186) | def _pad_1x1_to_3x3_tensor(self, kernel1x1): method _fuse_bn_tensor (line 192) | def _fuse_bn_tensor(self, branch): method fuse_convs (line 219) | def fuse_convs(self): class ChannelAttention (line 245) | class ChannelAttention(nn.Module): method __init__ (line 248) | def __init__(self, channels: int) -> None: method forward (line 254) | def forward(self, x: torch.Tensor) -> torch.Tensor: class SpatialAttention (line 258) | class SpatialAttention(nn.Module): method __init__ (line 261) | def __init__(self, kernel_size=7): method forward (line 269) | def forward(self, x): class CBAM (line 274) | class CBAM(nn.Module): method __init__ (line 277) | def __init__(self, c1, kernel_size=7): # ch_in, kernels method forward (line 282) | def forward(self, x): class Concat (line 287) | class Concat(nn.Module): method __init__ (line 290) | def __init__(self, dimension=1): method forward (line 295) | def forward(self, x): FILE: ultralytics/nn/modules/head.py class Detect (line 22) | class Detect(nn.Module): method __init__ (line 30) | def __init__(self, nc=80, ch=()): # detection layer method forward (line 43) | def forward(self, x): method bias_init (line 64) | def bias_init(self): class Segment (line 74) | class Segment(Detect): method __init__ (line 77) | def __init__(self, nc=80, nm=32, npr=256, ch=()): method forward (line 88) | def forward(self, x): class Pose (line 100) | class Pose(Detect): method __init__ (line 103) | def __init__(self, nc=80, kpt_shape=(17, 3), ch=()): method forward (line 113) | def forward(self, x): method kpts_decode (line 123) | def kpts_decode(self, bs, kpts): class Classify (line 141) | class Classify(nn.Module): method __init__ (line 144) | def __init__(self, c1, c2, k=1, s=1, p=None, g=1): # ch_in, ch_out, k... method forward (line 152) | def forward(self, x): class RTDETRDecoder (line 160) | class RTDETRDecoder(nn.Module): method __init__ (line 162) | def __init__( method forward (line 220) | def forward(self, x, batch=None): method _generate_anchors (line 253) | def _generate_anchors(self, shapes, grid_size=0.05, dtype=torch.float3... method _get_encoder_input (line 272) | def _get_encoder_input(self, x): method _get_decoder_input (line 289) | def _get_decoder_input(self, feats, shapes, dn_embed=None, dn_bbox=None): method _reset_parameters (line 328) | def _reset_parameters(self): FILE: ultralytics/nn/modules/transformer.py class TransformerEncoderLayer (line 20) | class TransformerEncoderLayer(nn.Module): method __init__ (line 23) | def __init__(self, c1, cm=2048, num_heads=8, dropout=0.0, act=nn.GELU(... method with_pos_embed (line 39) | def with_pos_embed(self, tensor, pos=None): method forward_post (line 43) | def forward_post(self, src, src_mask=None, src_key_padding_mask=None, ... method forward_pre (line 53) | def forward_pre(self, src, src_mask=None, src_key_padding_mask=None, p... method forward (line 63) | def forward(self, src, src_mask=None, src_key_padding_mask=None, pos=N... class AIFI (line 70) | class AIFI(TransformerEncoderLayer): method __init__ (line 72) | def __init__(self, c1, cm=2048, num_heads=8, dropout=0, act=nn.GELU(),... method forward (line 75) | def forward(self, x): method build_2d_sincos_position_embedding (line 83) | def build_2d_sincos_position_embedding(w, h, embed_dim=256, temperatur... class TransformerLayer (line 100) | class TransformerLayer(nn.Module): method __init__ (line 103) | def __init__(self, c, num_heads): method forward (line 113) | def forward(self, x): class TransformerBlock (line 120) | class TransformerBlock(nn.Module): method __init__ (line 123) | def __init__(self, c1, c2, num_heads, num_layers): method forward (line 133) | def forward(self, x): class MLPBlock (line 142) | class MLPBlock(nn.Module): method __init__ (line 144) | def __init__(self, embedding_dim, mlp_dim, act=nn.GELU): method forward (line 150) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MLP (line 154) | class MLP(nn.Module): method __init__ (line 157) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers): method forward (line 163) | def forward(self, x): class LayerNorm2d (line 171) | class LayerNorm2d(nn.Module): method __init__ (line 173) | def __init__(self, num_channels, eps=1e-6): method forward (line 179) | def forward(self, x): class MSDeformAttn (line 187) | class MSDeformAttn(nn.Module): method __init__ (line 193) | def __init__(self, d_model=256, n_levels=4, n_heads=8, n_points=4): method _reset_parameters (line 215) | def _reset_parameters(self): method forward (line 232) | def forward(self, query, refer_bbox, value, value_shapes, value_mask=N... class DeformableTransformerDecoderLayer (line 273) | class DeformableTransformerDecoderLayer(nn.Module): method __init__ (line 279) | def __init__(self, d_model=256, n_heads=8, d_ffn=1024, dropout=0., act... method with_pos_embed (line 301) | def with_pos_embed(tensor, pos): method forward_ffn (line 304) | def forward_ffn(self, tgt): method forward (line 310) | def forward(self, embed, refer_bbox, feats, shapes, padding_mask=None,... class DeformableTransformerDecoder (line 330) | class DeformableTransformerDecoder(nn.Module): method __init__ (line 335) | def __init__(self, hidden_dim, decoder_layer, num_layers, eval_idx=-1): method forward (line 342) | def forward( FILE: ultralytics/nn/modules/utils.py function _get_clones (line 18) | def _get_clones(module, n): function bias_init_with_prob (line 22) | def bias_init_with_prob(prior_prob=0.01): function linear_init_ (line 27) | def linear_init_(module): function inverse_sigmoid (line 34) | def inverse_sigmoid(x, eps=1e-5): function multi_scale_deformable_attn_pytorch (line 41) | def multi_scale_deformable_attn_pytorch(value: torch.Tensor, value_spati... FILE: ultralytics/nn/tasks.py class BaseModel (line 27) | class BaseModel(nn.Module): method forward (line 32) | def forward(self, x, *args, **kwargs): method predict (line 47) | def predict(self, x, profile=False, visualize=False, augment=False): method _predict_once (line 64) | def _predict_once(self, x, profile=False, visualize=False): method _predict_augment (line 88) | def _predict_augment(self, x): method _profile_one_layer (line 95) | def _profile_one_layer(self, m, x, dt): method fuse (line 120) | def fuse(self, verbose=True): method is_fused (line 147) | def is_fused(self, thresh=10): method info (line 160) | def info(self, detailed=False, verbose=True, imgsz=640): method _apply (line 170) | def _apply(self, fn): method load (line 189) | def load(self, weights, verbose=True): method loss (line 203) | def loss(self, batch, preds=None): method init_criterion (line 217) | def init_criterion(self): class DetectionModel (line 221) | class DetectionModel(BaseModel): method __init__ (line 224) | def __init__(self, cfg='yolov8n.yaml', ch=3, nc=None, verbose=True): ... method _predict_augment (line 255) | def _predict_augment(self, x): method _descale_pred (line 271) | def _descale_pred(p, flips, scale, img_size, dim=1): method _clip_augmented (line 281) | def _clip_augmented(self, y): method init_criterion (line 292) | def init_criterion(self): class SegmentationModel (line 296) | class SegmentationModel(DetectionModel): method __init__ (line 299) | def __init__(self, cfg='yolov8n-seg.yaml', ch=3, nc=None, verbose=True): method init_criterion (line 303) | def init_criterion(self): method _predict_augment (line 306) | def _predict_augment(self, x): class PoseModel (line 314) | class PoseModel(DetectionModel): method __init__ (line 317) | def __init__(self, cfg='yolov8n-pose.yaml', ch=3, nc=None, data_kpt_sh... method init_criterion (line 326) | def init_criterion(self): method _predict_augment (line 329) | def _predict_augment(self, x): class ClassificationModel (line 337) | class ClassificationModel(BaseModel): method __init__ (line 340) | def __init__(self, method _from_detection_model (line 350) | def _from_detection_model(self, model, nc=1000, cutoff=10): method _from_yaml (line 366) | def _from_yaml(self, cfg, ch, nc, verbose): method reshape_outputs (line 383) | def reshape_outputs(model, nc): method init_criterion (line 403) | def init_criterion(self): class RTDETRDetectionModel (line 408) | class RTDETRDetectionModel(DetectionModel): method __init__ (line 410) | def __init__(self, cfg='rtdetr-l.yaml', ch=3, nc=None, verbose=True): method init_criterion (line 413) | def init_criterion(self): method loss (line 419) | def loss(self, batch, preds=None): method predict (line 454) | def predict(self, x, profile=False, visualize=False, batch=None, augme... class Ensemble (line 482) | class Ensemble(nn.ModuleList): method __init__ (line 485) | def __init__(self): method forward (line 489) | def forward(self, x, augment=False, profile=False, visualize=False): function torch_safe_load (line 501) | def torch_safe_load(weight): function attempt_load_weights (line 536) | def attempt_load_weights(weights, device=None, inplace=True, fuse=False): function attempt_load_one_weight (line 576) | def attempt_load_one_weight(weight, device=None, inplace=True, fuse=False): function parse_model (line 603) | def parse_model(d, ch, verbose=True): # model_dict, input_channels(3) function yaml_model_load (line 679) | def yaml_model_load(path): function guess_model_scale (line 697) | def guess_model_scale(model_path): function guess_model_task (line 715) | def guess_model_task(model): FILE: ultralytics/tracker/track.py function on_predict_start (line 15) | def on_predict_start(predictor, persist=False): function on_predict_postprocess_end (line 39) | def on_predict_postprocess_end(predictor): function register_tracker (line 55) | def register_tracker(model, persist): FILE: ultralytics/tracker/trackers/basetrack.py class TrackState (line 8) | class TrackState: class BaseTrack (line 17) | class BaseTrack: method end_frame (line 38) | def end_frame(self): method next_id (line 43) | def next_id(): method activate (line 48) | def activate(self, *args): method predict (line 52) | def predict(self): method update (line 56) | def update(self, *args, **kwargs): method mark_lost (line 60) | def mark_lost(self): method mark_removed (line 64) | def mark_removed(self): method reset_id (line 69) | def reset_id(): FILE: ultralytics/tracker/trackers/bot_sort.py class BOTrack (line 14) | class BOTrack(STrack): method __init__ (line 17) | def __init__(self, tlwh, score, cls, feat=None, feat_history=50): method update_features (line 28) | def update_features(self, feat): method predict (line 39) | def predict(self): method re_activate (line 48) | def re_activate(self, new_track, frame_id, new_id=False): method update (line 54) | def update(self, new_track, frame_id): method tlwh (line 61) | def tlwh(self): method multi_predict (line 72) | def multi_predict(stracks): method convert_coords (line 87) | def convert_coords(self, tlwh): method tlwh_to_xywh (line 92) | def tlwh_to_xywh(tlwh): class BOTSORT (line 101) | class BOTSORT(BYTETracker): method __init__ (line 103) | def __init__(self, args, frame_rate=30): method get_kalmanfilter (line 116) | def get_kalmanfilter(self): method init_track (line 120) | def init_track(self, dets, scores, cls, img=None): method get_dists (line 130) | def get_dists(self, tracks, detections): method multi_predict (line 146) | def multi_predict(self, tracks): FILE: ultralytics/tracker/trackers/byte_tracker.py class STrack (line 10) | class STrack(BaseTrack): method __init__ (line 13) | def __init__(self, tlwh, score, cls): method predict (line 25) | def predict(self): method multi_predict (line 33) | def multi_predict(stracks): method multi_gmc (line 48) | def multi_gmc(stracks, H=np.eye(2, 3)): method activate (line 66) | def activate(self, kalman_filter, frame_id): method re_activate (line 79) | def re_activate(self, new_track, frame_id, new_id=False): method update (line 93) | def update(self, new_track, frame_id): method convert_coords (line 113) | def convert_coords(self, tlwh): method tlwh (line 118) | def tlwh(self): method tlbr (line 130) | def tlbr(self): method tlwh_to_xyah (line 139) | def tlwh_to_xyah(tlwh): method tlbr_to_tlwh (line 149) | def tlbr_to_tlwh(tlbr): method tlwh_to_tlbr (line 156) | def tlwh_to_tlbr(tlwh): method __repr__ (line 162) | def __repr__(self): class BYTETracker (line 167) | class BYTETracker: method __init__ (line 169) | def __init__(self, args, frame_rate=30): method update (line 181) | def update(self, results, img=None): method get_kalmanfilter (line 297) | def get_kalmanfilter(self): method init_track (line 301) | def init_track(self, dets, scores, cls, img=None): method get_dists (line 305) | def get_dists(self, tracks, detections): method multi_predict (line 313) | def multi_predict(self, tracks): method reset_id (line 317) | def reset_id(self): method joint_stracks (line 322) | def joint_stracks(tlista, tlistb): method sub_stracks (line 337) | def sub_stracks(tlista, tlistb): method remove_duplicate_stracks (line 350) | def remove_duplicate_stracks(stracksa, stracksb): FILE: ultralytics/tracker/utils/gmc.py class GMC (line 11) | class GMC: method __init__ (line 13) | def __init__(self, method='sparseOptFlow', downscale=2, verbose=None): method apply (line 72) | def apply(self, raw_frame, detections=None): method applyEcc (line 87) | def applyEcc(self, raw_frame, detections=None): method applyFeatures (line 119) | def applyFeatures(self, raw_frame, detections=None): method applySparseOptFlow (line 245) | def applySparseOptFlow(self, raw_frame, detections=None): method applyFile (line 307) | def applyFile(self, raw_frame, detections=None): FILE: ultralytics/tracker/utils/kalman_filter.py class KalmanFilterXYAH (line 11) | class KalmanFilterXYAH: method __init__ (line 29) | def __init__(self): method initiate (line 45) | def initiate(self, measurement): method predict (line 73) | def predict(self, mean, covariance): method project (line 106) | def project(self, mean, covariance): method multi_predict (line 132) | def multi_predict(self, mean, covariance): method update (line 165) | def update(self, mean, covariance, measurement): method gating_distance (line 197) | def gating_distance(self, mean, covariance, measurements, only_positio... class KalmanFilterXYWH (line 238) | class KalmanFilterXYWH: method __init__ (line 256) | def __init__(self): method initiate (line 272) | def initiate(self, measurement): method predict (line 301) | def predict(self, mean, covariance): method project (line 333) | def project(self, mean, covariance): method multi_predict (line 359) | def multi_predict(self, mean, covariance): method update (line 392) | def update(self, mean, covariance, measurement): method gating_distance (line 424) | def gating_distance(self, mean, covariance, measurements, only_positio... FILE: ultralytics/tracker/utils/matching.py function merge_matches (line 20) | def merge_matches(m1, m2, shape): function _indices_to_matches (line 38) | def _indices_to_matches(cost_matrix, indices, thresh): function linear_assignment (line 50) | def linear_assignment(cost_matrix, thresh, use_lap=True): function ious (line 73) | def ious(atlbrs, btlbrs): function iou_distance (line 89) | def iou_distance(atracks, btracks): function v_iou_distance (line 109) | def v_iou_distance(atracks, btracks): function embedding_distance (line 129) | def embedding_distance(tracks, detections, metric='cosine'): function gate_cost_matrix (line 148) | def gate_cost_matrix(kf, cost_matrix, tracks, detections, only_position=... function fuse_motion (line 161) | def fuse_motion(kf, cost_matrix, tracks, detections, only_position=False... function fuse_iou (line 175) | def fuse_iou(cost_matrix, tracks, detections): function fuse_score (line 188) | def fuse_score(cost_matrix, detections): function bbox_ious (line 199) | def bbox_ious(box1, box2, eps=1e-7): FILE: ultralytics/vit/rtdetr/model.py class RTDETR (line 22) | class RTDETR: method __init__ (line 24) | def __init__(self, model='rtdetr-l.pt') -> None: method _new (line 36) | def _new(self, cfg: str, verbose=True): method _load (line 47) | def _load(self, weights: str): method load (line 53) | def load(self, weights='yolov8n.pt'): method predict (line 63) | def predict(self, source=None, stream=False, **kwargs): method train (line 89) | def train(self, **kwargs): method val (line 115) | def val(self, **kwargs): method info (line 126) | def info(self, verbose=True): method _check_is_pytorch_model (line 130) | def _check_is_pytorch_model(self): method fuse (line 142) | def fuse(self): method export (line 148) | def export(self, **kwargs): method __call__ (line 166) | def __call__(self, source=None, stream=False, **kwargs): method __getattr__ (line 170) | def __getattr__(self, attr): FILE: ultralytics/vit/rtdetr/predict.py class RTDETRPredictor (line 11) | class RTDETRPredictor(BasePredictor): method postprocess (line 13) | def postprocess(self, preds, img, orig_imgs): method pre_transform (line 35) | def pre_transform(self, im): FILE: ultralytics/vit/rtdetr/train.py class RTDETRTrainer (line 14) | class RTDETRTrainer(DetectionTrainer): method get_model (line 16) | def get_model(self, cfg=None, weights=None, verbose=True): method build_dataset (line 23) | def build_dataset(self, img_path, mode='val', batch=None): method get_validator (line 42) | def get_validator(self): method preprocess_batch (line 47) | def preprocess_batch(self, batch): function train (line 59) | def train(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/vit/rtdetr/val.py class RTDETRDataset (line 18) | class RTDETRDataset(YOLODataset): method __init__ (line 20) | def __init__(self, *args, data=None, **kwargs): method load_image (line 24) | def load_image(self, i): method build_transforms (line 49) | def build_transforms(self, hyp=None): class RTDETRValidator (line 69) | class RTDETRValidator(DetectionValidator): method build_dataset (line 71) | def build_dataset(self, img_path, mode='val', batch=None): method postprocess (line 90) | def postprocess(self, preds): method update_metrics (line 108) | def update_metrics(self, preds, batch): FILE: ultralytics/vit/sam/amg.py class MaskData (line 12) | class MaskData: method __init__ (line 18) | def __init__(self, **kwargs) -> None: method __setitem__ (line 25) | def __setitem__(self, key: str, item: Any) -> None: method __delitem__ (line 31) | def __delitem__(self, key: str) -> None: method __getitem__ (line 35) | def __getitem__(self, key: str) -> Any: method items (line 39) | def items(self) -> ItemsView[str, Any]: method filter (line 43) | def filter(self, keep: torch.Tensor) -> None: method cat (line 59) | def cat(self, new_stats: 'MaskData') -> None: method to_numpy (line 73) | def to_numpy(self) -> None: function is_box_near_crop_edge (line 80) | def is_box_near_crop_edge(boxes: torch.Tensor, function box_xyxy_to_xywh (line 94) | def box_xyxy_to_xywh(box_xyxy: torch.Tensor) -> torch.Tensor: function batch_iterator (line 102) | def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None,... function mask_to_rle_pytorch (line 110) | def mask_to_rle_pytorch(tensor: torch.Tensor) -> List[Dict[str, Any]]: function rle_to_mask (line 135) | def rle_to_mask(rle: Dict[str, Any]) -> np.ndarray: function area_from_rle (line 149) | def area_from_rle(rle: Dict[str, Any]) -> int: function calculate_stability_score (line 154) | def calculate_stability_score(masks: torch.Tensor, mask_threshold: float... function build_point_grid (line 168) | def build_point_grid(n_per_side: int) -> np.ndarray: function build_all_layer_point_grids (line 177) | def build_all_layer_point_grids(n_per_side: int, n_layers: int, scale_pe... function generate_crop_boxes (line 182) | def generate_crop_boxes(im_size: Tuple[int, ...], n_layers: int, function uncrop_boxes_xyxy (line 216) | def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch... function uncrop_points (line 226) | def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Te... function uncrop_masks (line 236) | def uncrop_masks(masks: torch.Tensor, crop_box: List[int], orig_h: int, ... function remove_small_regions (line 247) | def remove_small_regions(mask: np.ndarray, area_thresh: float, mode: str... function coco_encode_rle (line 267) | def coco_encode_rle(uncompressed_rle: Dict[str, Any]) -> Dict[str, Any]: function batched_mask_to_box (line 277) | def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: FILE: ultralytics/vit/sam/autosize.py class ResizeLongestSide (line 18) | class ResizeLongestSide: method __init__ (line 25) | def __init__(self, target_length: int) -> None: method apply_image (line 28) | def apply_image(self, image: np.ndarray) -> np.ndarray: method apply_coords (line 35) | def apply_coords(self, coords: np.ndarray, original_size: Tuple[int, .... method apply_boxes (line 47) | def apply_boxes(self, boxes: np.ndarray, original_size: Tuple[int, ...... method apply_image_torch (line 55) | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: method apply_coords_torch (line 65) | def apply_coords_torch(self, coords: torch.Tensor, original_size: Tupl... method apply_boxes_torch (line 77) | def apply_boxes_torch(self, boxes: torch.Tensor, original_size: Tuple[... method get_preprocess_shape (line 86) | def get_preprocess_shape(oldh: int, oldw: int, long_side_length: int) ... FILE: ultralytics/vit/sam/build.py function build_sam_vit_h (line 20) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 31) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 42) | def build_sam_vit_b(checkpoint=None): function _build_sam (line 53) | def _build_sam( function build_sam (line 117) | def build_sam(ckpt='sam_b.pt'): FILE: ultralytics/vit/sam/model.py class SAM (line 13) | class SAM: method __init__ (line 15) | def __init__(self, model='sam_b.pt') -> None: method predict (line 23) | def predict(self, source, stream=False, **kwargs): method train (line 34) | def train(self, **kwargs): method val (line 38) | def val(self, **kwargs): method __call__ (line 42) | def __call__(self, source=None, stream=False, **kwargs): method __getattr__ (line 46) | def __getattr__(self, attr): method info (line 51) | def info(self, detailed=False, verbose=True): FILE: ultralytics/vit/sam/modules/decoders.py class MaskDecoder (line 12) | class MaskDecoder(nn.Module): method __init__ (line 14) | def __init__( method forward (line 57) | def forward( method predict_masks (line 94) | def predict_masks( class MLP (line 133) | class MLP(nn.Module): method __init__ (line 139) | def __init__( method forward (line 153) | def forward(self, x): FILE: ultralytics/vit/sam/modules/encoders.py class ImageEncoderViT (line 14) | class ImageEncoderViT(nn.Module): method __init__ (line 16) | def __init__( method forward (line 102) | def forward(self, x: torch.Tensor) -> torch.Tensor: class PromptEncoder (line 115) | class PromptEncoder(nn.Module): method __init__ (line 117) | def __init__( method get_dense_pe (line 162) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 173) | def _embed_points( method _embed_boxes (line 193) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 202) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 206) | def _get_batch_size( method _get_device (line 224) | def _get_device(self) -> torch.device: method forward (line 227) | def forward( class PositionEmbeddingRandom (line 270) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 275) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 284) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 293) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 306) | def forward_with_coords(self, coords_input: torch.Tensor, image_size: ... class Block (line 314) | class Block(nn.Module): method __init__ (line 317) | def __init__( method forward (line 361) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 380) | class Attention(nn.Module): method __init__ (line 383) | def __init__( method forward (line 416) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 435) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 459) | def window_unpartition(windows: torch.Tensor, window_size: int, pad_hw: ... function get_rel_pos (line 483) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 516) | def add_decomposed_rel_pos( class PatchEmbed (line 554) | class PatchEmbed(nn.Module): method __init__ (line 559) | def __init__( method forward (line 579) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: ultralytics/vit/sam/modules/mask_generator.py class SamAutomaticMaskGenerator (line 23) | class SamAutomaticMaskGenerator: method __init__ (line 25) | def __init__( method __call__ (line 121) | def __call__(self, image: np.ndarray, augment=False, visualize=False) ... method generate (line 125) | def generate(self, image: np.ndarray) -> List[Dict[str, Any]]: method _generate_masks (line 183) | def _generate_masks(self, image: np.ndarray) -> MaskData: method _process_crop (line 209) | def _process_crop( method _process_batch (line 250) | def _process_batch( method postprocess_small_regions (line 307) | def postprocess_small_regions(mask_data: MaskData, min_area: int, nms_... FILE: ultralytics/vit/sam/modules/prompt_predictor.py class PromptPredictor (line 12) | class PromptPredictor: method __init__ (line 14) | def __init__(self, sam_model: Sam) -> None: method set_image (line 27) | def set_image(self, image: np.ndarray, image_format: str = 'RGB') -> N... method set_torch_image (line 49) | def set_torch_image(self, transformed_image: torch.Tensor, original_im... method predict (line 73) | def predict( method predict_torch (line 148) | def predict_torch( method get_image_embedding (line 220) | def get_image_embedding(self) -> torch.Tensor: method device (line 232) | def device(self) -> torch.device: method reset_image (line 235) | def reset_image(self) -> None: FILE: ultralytics/vit/sam/modules/sam.py class Sam (line 19) | class Sam(nn.Module): method __init__ (line 23) | def __init__(self, method device (line 53) | def device(self) -> Any: method forward (line 57) | def forward( method postprocess_masks (line 133) | def postprocess_masks( method preprocess (line 164) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: ultralytics/vit/sam/modules/transformer.py class TwoWayTransformer (line 12) | class TwoWayTransformer(nn.Module): method __init__ (line 14) | def __init__( method forward (line 56) | def forward( class TwoWayAttentionBlock (line 103) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 105) | def __init__( method forward (line 142) | def forward(self, queries: Tensor, keys: Tensor, query_pe: Tensor, key... class Attention (line 176) | class Attention(nn.Module): method __init__ (line 182) | def __init__( method _separate_heads (line 199) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 205) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 211) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: ultralytics/vit/sam/predict.py class Predictor (line 13) | class Predictor(BasePredictor): method preprocess (line 15) | def preprocess(self, im): method setup_model (line 23) | def setup_model(self, model): method postprocess (line 38) | def postprocess(self, preds, path, orig_imgs): FILE: ultralytics/vit/utils/loss.py class DETRLoss (line 12) | class DETRLoss(nn.Module): method __init__ (line 14) | def __init__(self, method _get_loss_class (line 48) | def _get_loss_class(self, pred_scores, targets, gt_scores, num_gts, po... method _get_loss_bbox (line 69) | def _get_loss_bbox(self, pred_bboxes, gt_bboxes, postfix=''): method _get_loss_mask (line 87) | def _get_loss_mask(self, masks, gt_mask, match_indices, postfix=''): method _dice_loss (line 107) | def _dice_loss(self, inputs, targets, num_gts): method _get_loss_aux (line 116) | def _get_loss_aux(self, method _get_index (line 165) | def _get_index(self, match_indices): method _get_assigned_bboxes (line 171) | def _get_assigned_bboxes(self, pred_bboxes, gt_bboxes, match_indices): method _get_loss (line 180) | def _get_loss(self, method forward (line 218) | def forward(self, pred_bboxes, pred_scores, batch, postfix='', **kwargs): class RTDETRDetectionLoss (line 249) | class RTDETRDetectionLoss(DETRLoss): method forward (line 251) | def forward(self, preds, batch, dn_bboxes=None, dn_scores=None, dn_met... method get_dn_match_indices (line 271) | def get_dn_match_indices(dn_pos_idx, dn_num_group, gt_groups): FILE: ultralytics/vit/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 45) | def forward(self, pred_bboxes, pred_scores, gt_bboxes, gt_cls, gt_grou... method _cost_mask (line 113) | def _cost_mask(self, bs, num_gts, masks=None, gt_mask=None): function get_cdn_group (line 143) | def get_cdn_group(batch, function inverse_sigmoid (line 257) | def inverse_sigmoid(x, eps=1e-6): FILE: ultralytics/yolo/cfg/__init__.py function cfg2dict (line 79) | def cfg2dict(cfg): function get_cfg (line 96) | def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_D... function _handle_deprecation (line 147) | def _handle_deprecation(custom): function check_cfg_mismatch (line 166) | def check_cfg_mismatch(base: Dict, custom: Dict, e=None): function merge_equals_args (line 188) | def merge_equals_args(args: List[str]) -> List[str]: function handle_yolo_hub (line 215) | def handle_yolo_hub(args: List[str]) -> None: function handle_yolo_settings (line 239) | def handle_yolo_settings(args: List[str]) -> None: function entrypoint (line 260) | def entrypoint(debug=''): function copy_default_cfg (line 409) | def copy_default_cfg(): FILE: ultralytics/yolo/data/annotator.py function auto_annotate (line 8) | def auto_annotate(data, det_model='yolov8x.pt', sam_model='sam_b.pt', de... FILE: ultralytics/yolo/data/augment.py class BaseTransform (line 23) | class BaseTransform: method __init__ (line 25) | def __init__(self) -> None: method apply_image (line 28) | def apply_image(self, labels): method apply_instances (line 32) | def apply_instances(self, labels): method apply_semantic (line 36) | def apply_semantic(self, labels): method __call__ (line 40) | def __call__(self, labels): class Compose (line 47) | class Compose: method __init__ (line 49) | def __init__(self, transforms): method __call__ (line 53) | def __call__(self, data): method append (line 59) | def append(self, transform): method tolist (line 63) | def tolist(self): method __repr__ (line 67) | def __repr__(self): class BaseMixTransform (line 77) | class BaseMixTransform: method __init__ (line 80) | def __init__(self, dataset, pre_transform=None, p=0.0) -> None: method __call__ (line 85) | def __call__(self, labels): method _mix_transform (line 108) | def _mix_transform(self, labels): method get_indexes (line 112) | def get_indexes(self): class Mosaic (line 117) | class Mosaic(BaseMixTransform): method __init__ (line 131) | def __init__(self, dataset, imgsz=640, p=1.0, n=4): method get_indexes (line 141) | def get_indexes(self, buffer=True): method _mix_transform (line 148) | def _mix_transform(self, labels): method _mosaic4 (line 154) | def _mosaic4(self, labels): method _mosaic9 (line 190) | def _mosaic9(self, labels): method _update_labels (line 239) | def _update_labels(labels, padw, padh): method _cat_labels (line 247) | def _cat_labels(self, mosaic_labels): class MixUp (line 270) | class MixUp(BaseMixTransform): method __init__ (line 272) | def __init__(self, dataset, pre_transform=None, p=0.0) -> None: method get_indexes (line 275) | def get_indexes(self): method _mix_transform (line 279) | def _mix_transform(self, labels): class RandomPerspective (line 289) | class RandomPerspective: method __init__ (line 291) | def __init__(self, method affine_transform (line 308) | def affine_transform(self, img, border): method apply_bboxes (line 348) | def apply_bboxes(self, bboxes, M): method apply_segments (line 373) | def apply_segments(self, segments, M): method apply_keypoints (line 398) | def apply_keypoints(self, keypoints, M): method __call__ (line 421) | def __call__(self, labels): method box_candidates (line 471) | def box_candidates(self, box1, box2, wh_thr=2, ar_thr=100, area_thr=0.... class RandomHSV (line 479) | class RandomHSV: method __init__ (line 481) | def __init__(self, hgain=0.5, sgain=0.5, vgain=0.5) -> None: method __call__ (line 486) | def __call__(self, labels): class RandomFlip (line 504) | class RandomFlip: method __init__ (line 506) | def __init__(self, p=0.5, direction='horizontal', flip_idx=None) -> None: method __call__ (line 514) | def __call__(self, labels): class LetterBox (line 538) | class LetterBox: method __init__ (line 541) | def __init__(self, new_shape=(640, 640), auto=False, scaleFill=False, ... method __call__ (line 549) | def __call__(self, labels=None, image=None): method _update_labels (line 595) | def _update_labels(self, labels, ratio, padw, padh): class CopyPaste (line 604) | class CopyPaste: method __init__ (line 606) | def __init__(self, p=0.5) -> None: method __call__ (line 609) | def __call__(self, labels): class Albumentations (line 644) | class Albumentations: method __init__ (line 646) | def __init__(self, p=1.0): method __call__ (line 672) | def __call__(self, labels): class Format (line 692) | class Format: method __init__ (line 694) | def __init__(self, method __call__ (line 710) | def __call__(self, labels): method _format_img (line 740) | def _format_img(self, img): method _format_segments (line 748) | def _format_segments(self, instances, cls, w, h): function v8_transforms (line 762) | def v8_transforms(dataset, imgsz, hyp, stretch=False): function classify_transforms (line 794) | def classify_transforms(size=224, mean=(0.0, 0.0, 0.0), std=(1.0, 1.0, 1... function hsv2colorjitter (line 804) | def hsv2colorjitter(h, s, v): function classify_albumentations (line 809) | def classify_albumentations( class ClassifyLetterBox (line 853) | class ClassifyLetterBox: method __init__ (line 855) | def __init__(self, size=(640, 640), auto=False, stride=32): method __call__ (line 862) | def __call__(self, im): # im = np.array HWC class CenterCrop (line 873) | class CenterCrop: method __init__ (line 875) | def __init__(self, size=640): method __call__ (line 880) | def __call__(self, im): # im = np.array HWC class ToTensor (line 887) | class ToTensor: method __init__ (line 889) | def __init__(self, half=False): method __call__ (line 894) | def __call__(self, im): # im = np.array HWC in BGR order FILE: ultralytics/yolo/data/base.py class BaseDataset (line 22) | class BaseDataset(Dataset): method __init__ (line 50) | def __init__(self, method get_img_files (line 98) | def get_img_files(self, img_path): method update_labels (line 124) | def update_labels(self, include_class: Optional[list]): method load_image (line 143) | def load_image(self, i): method cache_images (line 172) | def cache_images(self, cache): method cache_images_to_disk (line 188) | def cache_images_to_disk(self, i): method check_cache_ram (line 194) | def check_cache_ram(self, safety_margin=0.5): method set_rectangle (line 212) | def set_rectangle(self): method __getitem__ (line 237) | def __getitem__(self, index): method get_image_and_label (line 241) | def get_image_and_label(self, index): method __len__ (line 252) | def __len__(self): method update_labels_info (line 256) | def update_labels_info(self, label): method build_transforms (line 260) | def build_transforms(self, hyp=None): method get_labels (line 272) | def get_labels(self): FILE: ultralytics/yolo/data/build.py class InfiniteDataLoader (line 22) | class InfiniteDataLoader(dataloader.DataLoader): method __init__ (line 25) | def __init__(self, *args, **kwargs): method __len__ (line 31) | def __len__(self): method __iter__ (line 35) | def __iter__(self): method reset (line 40) | def reset(self): class _RepeatSampler (line 47) | class _RepeatSampler: method __init__ (line 55) | def __init__(self, sampler): method __iter__ (line 59) | def __iter__(self): function seed_worker (line 65) | def seed_worker(worker_id): # noqa function build_yolo_dataset (line 72) | def build_yolo_dataset(cfg, img_path, batch, data, mode='train', rect=Fa... function build_dataloader (line 93) | def build_dataloader(dataset, batch, workers, shuffle=True, rank=-1): function check_source (line 112) | def check_source(source): function load_inference_source (line 138) | def load_inference_source(source=None, imgsz=640, vid_stride=1): FILE: ultralytics/yolo/data/converter.py function coco91_to_coco80_class (line 13) | def coco91_to_coco80_class(): function convert_coco (line 28) | def convert_coco(labels_dir='../coco/annotations/', use_segments=False, ... function rle2polygon (line 118) | def rle2polygon(segmentation): function min_index (line 146) | def min_index(arr1, arr2): function merge_multi_segment (line 161) | def merge_multi_segment(segments): function delete_dsstore (line 212) | def delete_dsstore(path='../datasets'): FILE: ultralytics/yolo/data/dataloaders/stream_loaders.py class SourceTypes (line 24) | class SourceTypes: class LoadStreams (line 31) | class LoadStreams: method __init__ (line 33) | def __init__(self, sources='file.streams', imgsz=640, vid_stride=1): method update (line 73) | def update(self, i, cap, stream): method __iter__ (line 89) | def __iter__(self): method __next__ (line 94) | def __next__(self): method __len__ (line 104) | def __len__(self): class LoadScreenshots (line 109) | class LoadScreenshots: method __init__ (line 111) | def __init__(self, source, imgsz=640): method __iter__ (line 138) | def __iter__(self): method __next__ (line 142) | def __next__(self): class LoadImages (line 151) | class LoadImages: method __init__ (line 153) | def __init__(self, path, imgsz=640, vid_stride=1): method __iter__ (line 189) | def __iter__(self): method __next__ (line 194) | def __next__(self): method _new_video (line 229) | def _new_video(self, path): method _cv2_rotate (line 239) | def _cv2_rotate(self, im): method __len__ (line 249) | def __len__(self): class LoadPilAndNumpy (line 254) | class LoadPilAndNumpy: method __init__ (line 256) | def __init__(self, im0, imgsz=640): method _single_check (line 268) | def _single_check(im): method __len__ (line 278) | def __len__(self): method __next__ (line 282) | def __next__(self): method __iter__ (line 289) | def __iter__(self): class LoadTensor (line 295) | class LoadTensor: method __init__ (line 297) | def __init__(self, imgs) -> None: method __iter__ (line 302) | def __iter__(self): method __next__ (line 307) | def __next__(self): method __len__ (line 314) | def __len__(self): function autocast_list (line 319) | def autocast_list(source): function get_best_youtube_url (line 339) | def get_best_youtube_url(url, use_pafy=True): FILE: ultralytics/yolo/data/dataloaders/v5augmentations.py class Albumentations (line 24) | class Albumentations: method __init__ (line 26) | def __init__(self, size=640): method __call__ (line 51) | def __call__(self, im, labels, p=1.0): function normalize (line 59) | def normalize(x, mean=IMAGENET_MEAN, std=IMAGENET_STD, inplace=False): function denormalize (line 64) | def denormalize(x, mean=IMAGENET_MEAN, std=IMAGENET_STD): function augment_hsv (line 71) | def augment_hsv(im, hgain=0.5, sgain=0.5, vgain=0.5): function hist_equalize (line 87) | def hist_equalize(im, clahe=True, bgr=False): function replicate (line 98) | def replicate(im, labels): function letterbox (line 115) | def letterbox(im, new_shape=(640, 640), color=(114, 114, 114), auto=True... function random_perspective (line 148) | def random_perspective(im, function copy_paste (line 244) | def copy_paste(im, labels, segments, p=0.5): function cutout (line 269) | def cutout(im, labels, p=0.5): function mixup (line 296) | def mixup(im, labels, im2, labels2): function box_candidates (line 304) | def box_candidates(box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1... function classify_albumentations (line 312) | def classify_albumentations( function classify_transforms (line 354) | def classify_transforms(size=224): class LetterBox (line 361) | class LetterBox: method __init__ (line 363) | def __init__(self, size=(640, 640), auto=False, stride=32): method __call__ (line 370) | def __call__(self, im): # im = np.array HWC class CenterCrop (line 381) | class CenterCrop: method __init__ (line 383) | def __init__(self, size=640): method __call__ (line 388) | def __call__(self, im): # im = np.array HWC class ToTensor (line 395) | class ToTensor: method __init__ (line 397) | def __init__(self, half=False): method __call__ (line 402) | def __call__(self, im): # im = np.array HWC in BGR order FILE: ultralytics/yolo/data/dataloaders/v5loader.py function get_hash (line 52) | def get_hash(paths): function exif_size (line 60) | def exif_size(img): function exif_transpose (line 70) | def exif_transpose(image): function seed_worker (line 96) | def seed_worker(worker_id): function create_dataloader (line 103) | def create_dataloader(path, class InfiniteDataLoader (line 158) | class InfiniteDataLoader(dataloader.DataLoader): method __init__ (line 164) | def __init__(self, *args, **kwargs): method __len__ (line 170) | def __len__(self): method __iter__ (line 174) | def __iter__(self): class _RepeatSampler (line 180) | class _RepeatSampler: method __init__ (line 187) | def __init__(self, sampler): method __iter__ (line 191) | def __iter__(self): class LoadScreenshots (line 197) | class LoadScreenshots: method __init__ (line 199) | def __init__(self, source, img_size=640, stride=32, auto=True, transfo... method __iter__ (line 228) | def __iter__(self): method __next__ (line 232) | def __next__(self): class LoadImages (line 247) | class LoadImages: method __init__ (line 249) | def __init__(self, path, img_size=640, stride=32, auto=True, transform... method __iter__ (line 285) | def __iter__(self): method __next__ (line 290) | def __next__(self): method _new_video (line 331) | def _new_video(self, path): method _cv2_rotate (line 339) | def _cv2_rotate(self, im): method __len__ (line 349) | def __len__(self): class LoadStreams (line 354) | class LoadStreams: method __init__ (line 356) | def __init__(self, sources='file.streams', img_size=640, stride=32, au... method update (line 401) | def update(self, i, cap, stream): method __iter__ (line 417) | def __iter__(self): method __next__ (line 422) | def __next__(self): method __len__ (line 439) | def __len__(self): function img2label_paths (line 444) | def img2label_paths(img_paths): class LoadImagesAndLabels (line 450) | class LoadImagesAndLabels(Dataset): method __init__ (line 455) | def __init__(self, method check_cache_ram (line 606) | def check_cache_ram(self, safety_margin=0.1, prefix=''): method cache_labels (line 623) | def cache_labels(self, path=Path('./labels.cache'), prefix=''): method __len__ (line 663) | def __len__(self): method __getitem__ (line 667) | def __getitem__(self, index): method load_image (line 742) | def load_image(self, i): method cache_images_to_disk (line 759) | def cache_images_to_disk(self, i): method load_mosaic (line 765) | def load_mosaic(self, index): method load_mosaic9 (line 823) | def load_mosaic9(self, index): method collate_fn (line 901) | def collate_fn(batch): method collate_fn_old (line 917) | def collate_fn_old(batch): function flatten_recursive (line 926) | def flatten_recursive(path=DATASETS_DIR / 'coco128'): function extract_boxes (line 936) | def extract_boxes(path=DATASETS_DIR / 'coco128'): # from utils.dataload... function autosplit (line 970) | def autosplit(path=DATASETS_DIR / 'coco128/images', weights=(0.9, 0.1, 0... function verify_image_label (line 996) | def verify_image_label(args): class ClassificationDataset (line 1049) | class ClassificationDataset(torchvision.datasets.ImageFolder): method __init__ (line 1058) | def __init__(self, root, augment, imgsz, cache=False): method __getitem__ (line 1067) | def __getitem__(self, i): function create_classification_dataloader (line 1085) | def create_classification_dataloader(path, FILE: ultralytics/yolo/data/dataset.py class YOLODataset (line 19) | class YOLODataset(BaseDataset): method __init__ (line 34) | def __init__(self, *args, data=None, use_segments=False, use_keypoints... method cache_labels (line 41) | def cache_labels(self, path=Path('./labels.cache')): method get_labels (line 101) | def get_labels(self): method build_transforms (line 145) | def build_transforms(self, hyp=None): method close_mosaic (line 163) | def close_mosaic(self, hyp): method update_labels_info (line 170) | def update_labels_info(self, label): method collate_fn (line 183) | def collate_fn(batch): class ClassificationDataset (line 203) | class ClassificationDataset(torchvision.datasets.ImageFolder): method __init__ (line 218) | def __init__(self, root, args, augment=False, cache=False): method __getitem__ (line 248) | def __getitem__(self, i): method __len__ (line 265) | def __len__(self) -> int: class SemanticDataset (line 270) | class SemanticDataset(BaseDataset): method __init__ (line 272) | def __init__(self): FILE: ultralytics/yolo/data/dataset_wrappers.py class MixAndRectDataset (line 9) | class MixAndRectDataset: method __init__ (line 18) | def __init__(self, dataset): method __len__ (line 26) | def __len__(self): method __getitem__ (line 30) | def __getitem__(self, index): FILE: ultralytics/yolo/data/utils.py function img2label_paths (line 39) | def img2label_paths(img_paths): function get_hash (line 45) | def get_hash(paths): function exif_size (line 53) | def exif_size(img): function verify_image_label (line 63) | def verify_image_label(args): function polygon2mask (line 137) | def polygon2mask(imgsz, polygons, color=1, downsample_ratio=1): function polygons2masks (line 158) | def polygons2masks(imgsz, polygons, color, downsample_ratio=1): function polygons2masks_overlap (line 173) | def polygons2masks_overlap(imgsz, segments, downsample_ratio=1): function check_det_dataset (line 193) | def check_det_dataset(dataset, autodownload=True): function check_cls_dataset (line 269) | def check_cls_dataset(dataset: str, split=''): class HUBDatasetStats (line 313) | class HUBDatasetStats(): method __init__ (line 331) | def __init__(self, path='coco128.yaml', task='detect', autodownload=Fa... method _find_yaml (line 351) | def _find_yaml(dir): method _unzip (line 361) | def _unzip(self, path): method _hub_ops (line 370) | def _hub_ops(self, f): method get_json (line 374) | def get_json(self, save=False, verbose=False): method process_images (line 425) | def process_images(self): function compress_one_image (line 440) | def compress_one_image(f, f_new=None, max_dim=1920, quality=50): function delete_dsstore (line 474) | def delete_dsstore(path): function zip_directory (line 496) | def zip_directory(dir, use_zipfile_library=True): FILE: ultralytics/yolo/engine/exporter.py function export_formats (line 75) | def export_formats(): function gd_outputs (line 94) | def gd_outputs(gd): function try_export (line 103) | def try_export(inner_func): class Exporter (line 122) | class Exporter: method __init__ (line 131) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method __call__ (line 145) | def __call__(self, model=None): method export_torchscript (line 278) | def export_torchscript(self, prefix=colorstr('TorchScript:')): method export_onnx (line 294) | def export_onnx(self, prefix=colorstr('ONNX:')): method export_openvino (line 352) | def export_openvino(self, prefix=colorstr('OpenVINO:')): method export_paddle (line 384) | def export_paddle(self, prefix=colorstr('PaddlePaddle:')): method export_coreml (line 398) | def export_coreml(self, prefix=colorstr('CoreML:')): method export_engine (line 440) | def export_engine(self, prefix=colorstr('TensorRT:')): method export_saved_model (line 505) | def export_saved_model(self, prefix=colorstr('TensorFlow SavedModel:')): method export_pb (line 551) | def export_pb(self, keras_model, prefix=colorstr('TensorFlow GraphDef:... method export_tflite (line 567) | def export_tflite(self, keras_model, nms, agnostic_nms, prefix=colorst... method export_edgetpu (line 582) | def export_edgetpu(self, tflite_model='', prefix=colorstr('Edge TPU:')): method export_tfjs (line 609) | def export_tfjs(self, prefix=colorstr('TensorFlow.js:')): method _add_tflite_metadata (line 645) | def _add_tflite_metadata(self, file): method _pipeline_coreml (line 703) | def _pipeline_coreml(self, model, prefix=colorstr('CoreML Pipeline:')): method add_callback (line 820) | def add_callback(self, event: str, callback): method run_callbacks (line 826) | def run_callbacks(self, event: str): class iOSDetectModel (line 832) | class iOSDetectModel(torch.nn.Module): method __init__ (line 835) | def __init__(self, model, im): method forward (line 846) | def forward(self, x): function export (line 852) | def export(cfg=DEFAULT_CFG): FILE: ultralytics/yolo/engine/model.py class YOLO (line 32) | class YOLO: method __init__ (line 73) | def __init__(self, model: Union[str, Path] = 'yolov8n.pt', task=None) ... method __call__ (line 109) | def __call__(self, source=None, stream=False, **kwargs): method __getattr__ (line 113) | def __getattr__(self, attr): method is_hub_model (line 119) | def is_hub_model(model): method _new (line 126) | def _new(self, cfg: str, task=None, verbose=True): method _load (line 146) | def _load(self, weights: str, task=None): method _check_is_pytorch_model (line 168) | def _check_is_pytorch_model(self): method reset_weights (line 181) | def reset_weights(self): method load (line 194) | def load(self, weights='yolov8n.pt'): method info (line 204) | def info(self, detailed=False, verbose=True): method fuse (line 215) | def fuse(self): method predict (line 221) | def predict(self, source=None, stream=False, **kwargs): method track (line 257) | def track(self, source=None, stream=False, persist=False, **kwargs): method val (line 281) | def val(self, data=None, **kwargs): method benchmark (line 310) | def benchmark(self, **kwargs): method export (line 325) | def export(self, **kwargs): method train (line 344) | def train(self, **kwargs): method to (line 380) | def to(self, device): method tune (line 390) | def tune(self, method names (line 476) | def names(self): method device (line 481) | def device(self): method transforms (line 486) | def transforms(self): method add_callback (line 490) | def add_callback(self, event: str, func): method clear_callback (line 494) | def clear_callback(self, event: str): method _reset_ckpt_args (line 499) | def _reset_ckpt_args(args): method _reset_callbacks (line 504) | def _reset_callbacks(self): FILE: ultralytics/yolo/engine/predictor.py class BasePredictor (line 59) | class BasePredictor: method __init__ (line 78) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_save_dir (line 110) | def get_save_dir(self): method preprocess (line 115) | def preprocess(self, im): method pre_transform (line 132) | def pre_transform(self, im): method write_results (line 144) | def write_results(self, idx, results, batch): method postprocess (line 178) | def postprocess(self, preds, img, orig_imgs): method __call__ (line 182) | def __call__(self, source=None, model=None, stream=False): method predict_cli (line 190) | def predict_cli(self, source=None, model=None): method setup_source (line 196) | def setup_source(self, source): method stream_inference (line 210) | def stream_inference(self, source=None, model=None): method setup_model (line 295) | def setup_model(self, model, verbose=True): method show (line 310) | def show(self, p): method save_preds (line 320) | def save_preds(self, vid_cap, idx, save_path): method run_callbacks (line 341) | def run_callbacks(self, event: str): method add_callback (line 346) | def add_callback(self, event: str, func): FILE: ultralytics/yolo/engine/results.py class BaseTensor (line 20) | class BaseTensor(SimpleClass): method __init__ (line 25) | 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 93) | def __init__(self, orig_img, path, names, boxes=None, masks=None, prob... method __getitem__ (line 107) | def __getitem__(self, idx): method update (line 114) | def update(self, boxes=None, masks=None, probs=None): method cpu (line 123) | def cpu(self): method numpy (line 130) | def numpy(self): method cuda (line 137) | def cuda(self): method to (line 144) | def to(self, *args, **kwargs): method __len__ (line 151) | def __len__(self): method new (line 156) | def new(self): method keys (line 161) | def keys(self): method plot (line 165) | def plot( method verbose (line 248) | def verbose(self): method save_txt (line 265) | def save_txt(self, txt_file, save_conf=False): method save_crop (line 299) | def save_crop(self, save_dir, file_name=Path('im.jpg')): method pandas (line 320) | def pandas(self): method tojson (line 324) | def tojson(self, normalize=False): class Boxes (line 354) | class Boxes(BaseTensor): method __init__ (line 386) | def __init__(self, boxes, orig_shape) -> None: method xyxy (line 397) | def xyxy(self): method conf (line 402) | def conf(self): method cls (line 407) | def cls(self): method id (line 412) | def id(self): method xywh (line 418) | def xywh(self): method xyxyn (line 424) | def xyxyn(self): method xywhn (line 433) | def xywhn(self): method boxes (line 441) | def boxes(self): class Masks (line 447) | class Masks(BaseTensor): method __init__ (line 470) | def __init__(self, masks, orig_shape) -> None: method segments (line 478) | def segments(self): method xyn (line 486) | def xyn(self): method xy (line 494) | def xy(self): method masks (line 501) | def masks(self): method pandas (line 506) | def pandas(self): class Keypoints (line 511) | class Keypoints(BaseTensor): method __init__ (line 534) | def __init__(self, keypoints, orig_shape) -> None: method xy (line 542) | def xy(self): method xyn (line 547) | def xyn(self): method conf (line 555) | def conf(self): class Probs (line 559) | class Probs(BaseTensor): method __init__ (line 580) | def __init__(self, probs, orig_shape=None) -> None: method top5 (line 585) | def top5(self): method top1 (line 591) | def top1(self): method top5conf (line 597) | def top5conf(self): method top1conf (line 603) | def top1conf(self): FILE: ultralytics/yolo/engine/trainer.py class BaseTrainer (line 37) | class BaseTrainer: method __init__ (line 74) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method add_callback (line 150) | def add_callback(self, event: str, callback): method set_callback (line 156) | def set_callback(self, event: str, callback): method run_callbacks (line 162) | def run_callbacks(self, event: str): method train (line 167) | def train(self): method _setup_ddp (line 194) | def _setup_ddp(self, world_size): method _setup_train (line 205) | def _setup_train(self, world_size): method _do_train (line 270) | def _do_train(self, world_size=1): method save_model (line 406) | def save_model(self): method get_dataset (line 434) | def get_dataset(data): method setup_model (line 440) | def setup_model(self): method optimizer_step (line 457) | def optimizer_step(self): method preprocess_batch (line 467) | def preprocess_batch(self, batch): method validate (line 473) | def validate(self): method get_model (line 483) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 487) | def get_validator(self): method get_dataloader (line 491) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode='tr... method build_dataset (line 497) | def build_dataset(self, img_path, mode='train', batch=None): method label_loss_items (line 501) | def label_loss_items(self, loss_items=None, prefix='train'): method set_model_attributes (line 508) | def set_model_attributes(self): method build_targets (line 514) | def build_targets(self, preds, targets): method progress_string (line 518) | def progress_string(self): method plot_training_samples (line 523) | def plot_training_samples(self, batch, ni): method plot_training_labels (line 527) | def plot_training_labels(self): method save_metrics (line 531) | def save_metrics(self, metrics): method plot_metrics (line 539) | def plot_metrics(self): method on_plot (line 543) | def on_plot(self, name, data=None): method final_eval (line 547) | def final_eval(self): method check_resume (line 558) | def check_resume(self): method resume_training (line 578) | def resume_training(self, ckpt): method build_optimizer (line 609) | def build_optimizer(self, model, name='auto', lr=0.001, momentum=0.9, ... FILE: ultralytics/yolo/engine/validator.py class BaseValidator (line 38) | class BaseValidator: method __init__ (line 58) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method __call__ (line 92) | def __call__(self, trainer=None, model=None): method add_callback (line 199) | def add_callback(self, event: str, callback): method run_callbacks (line 203) | def run_callbacks(self, event: str): method get_dataloader (line 208) | def get_dataloader(self, dataset_path, batch_size): method build_dataset (line 212) | def build_dataset(self, img_path): method preprocess (line 216) | def preprocess(self, batch): method postprocess (line 220) | def postprocess(self, preds): method init_metrics (line 224) | def init_metrics(self, model): method update_metrics (line 228) | def update_metrics(self, preds, batch): method finalize_metrics (line 232) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 236) | def get_stats(self): method check_stats (line 240) | def check_stats(self, stats): method print_results (line 244) | def print_results(self): method get_desc (line 248) | def get_desc(self): method metric_keys (line 253) | def metric_keys(self): method on_plot (line 257) | def on_plot(self, name, data=None): method plot_val_samples (line 262) | def plot_val_samples(self, batch, ni): method plot_predictions (line 266) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 270) | def pred_to_json(self, preds, batch): method eval_json (line 274) | def eval_json(self, stats): FILE: ultralytics/yolo/nas/model.py class NAS (line 26) | class NAS: method __init__ (line 28) | def __init__(self, model='yolo_nas_s.pt') -> None: method _load (line 52) | def _load(self, weights: str): method predict (line 56) | def predict(self, source=None, stream=False, **kwargs): method train (line 82) | def train(self, **kwargs): method val (line 86) | def val(self, **kwargs): method export (line 98) | def export(self, **kwargs): method info (line 116) | def info(self, detailed=False, verbose=True): method __call__ (line 126) | def __call__(self, source=None, stream=False, **kwargs): method __getattr__ (line 130) | def __getattr__(self, attr): FILE: ultralytics/yolo/nas/predict.py class NASPredictor (line 11) | class NASPredictor(BasePredictor): method postprocess (line 13) | def postprocess(self, preds_in, img, orig_imgs): FILE: ultralytics/yolo/nas/val.py class NASValidator (line 12) | class NASValidator(DetectionValidator): method postprocess (line 14) | def postprocess(self, preds_in): FILE: ultralytics/yolo/utils/__init__.py class SimpleClass (line 108) | class SimpleClass: method __str__ (line 114) | def __str__(self): method __repr__ (line 128) | def __repr__(self): method __getattr__ (line 132) | def __getattr__(self, attr): class IterableSimpleNamespace (line 138) | class IterableSimpleNamespace(SimpleNamespace): method __iter__ (line 144) | def __iter__(self): method __str__ (line 148) | def __str__(self): method __getattr__ (line 152) | def __getattr__(self, attr): method get (line 162) | def get(self, key, default=None): function plt_settings (line 167) | def plt_settings(rcparams=None, backend='Agg'): function set_logging (line 206) | def set_logging(name=LOGGING_NAME, verbose=True): function emojis (line 228) | def emojis(string=''): class EmojiFilter (line 233) | class EmojiFilter(logging.Filter): method filter (line 241) | def filter(self, record): function yaml_save (line 254) | def yaml_save(file='data.yaml', data=None): function yaml_load (line 282) | def yaml_load(file='data.yaml', append_filename=False): function yaml_print (line 304) | def yaml_print(yaml_file: Union[str, Path, dict]) -> None: function is_colab (line 328) | def is_colab(): function is_kaggle (line 338) | def is_kaggle(): function is_jupyter (line 348) | def is_jupyter(): function is_docker (line 362) | def is_docker() -> bool: function is_online (line 377) | def is_online() -> bool: function is_pip_package (line 401) | def is_pip_package(filepath: str = __name__) -> bool: function is_dir_writeable (line 420) | def is_dir_writeable(dir_path: Union[str, Path]) -> bool: function is_pytest_running (line 433) | def is_pytest_running(): function is_github_actions_ci (line 443) | def is_github_actions_ci() -> bool: function is_git_dir (line 453) | def is_git_dir(): function get_git_dir (line 464) | def get_git_dir(): function get_git_origin_url (line 478) | def get_git_origin_url(): function get_git_branch (line 492) | def get_git_branch(): function get_default_args (line 506) | def get_default_args(func): function get_user_config_dir (line 519) | def get_user_config_dir(sub_dir='Ultralytics'): function colorstr (line 554) | def colorstr(*input): class TryExcept (line 580) | class TryExcept(contextlib.ContextDecorator): method __init__ (line 583) | def __init__(self, msg='', verbose=True): method __enter__ (line 588) | def __enter__(self): method __exit__ (line 592) | def __exit__(self, exc_type, value, traceback): function threaded (line 599) | def threaded(func): function set_sentry (line 611) | def set_sentry(): function get_settings (line 685) | def get_settings(file=SETTINGS_YAML, version='0.0.3'): function set_settings (line 734) | def set_settings(kwargs, file=SETTINGS_YAML): function deprecation_warn (line 743) | def deprecation_warn(arg, new_arg, version=None): function clean_url (line 751) | def clean_url(url): function url2file (line 757) | def url2file(url): FILE: ultralytics/yolo/utils/autobatch.py function check_train_batch_size (line 15) | def check_train_batch_size(model, imgsz=640, amp=True): function autobatch (line 32) | def autobatch(model, imgsz=640, fraction=0.67, batch_size=DEFAULT_CFG.ba... FILE: ultralytics/yolo/utils/benchmarks.py function benchmark (line 44) | def benchmark(model=Path(SETTINGS['weights_dir']) / 'yolov8n.pt', class ProfileModels (line 149) | class ProfileModels: method __init__ (line 167) | def __init__(self, method profile (line 183) | def profile(self): method get_files (line 224) | def get_files(self): method get_onnx_model_info (line 239) | def get_onnx_model_info(self, onnx_file: str): method iterative_sigma_clipping (line 243) | def iterative_sigma_clipping(self, data, sigma=2, max_iters=3): method profile_tensorrt_model (line 253) | def profile_tensorrt_model(self, engine_file: str): method profile_onnx_model (line 281) | def profile_onnx_model(self, onnx_file: str): method generate_table_row (line 333) | def generate_table_row(self, model_name, t_onnx, t_engine, model_info): method generate_results_dict (line 337) | def generate_results_dict(self, model_name, t_onnx, t_engine, model_in... method print_table (line 346) | def print_table(self, table_rows): FILE: ultralytics/yolo/utils/callbacks/base.py function on_pretrain_routine_start (line 12) | def on_pretrain_routine_start(trainer): function on_pretrain_routine_end (line 17) | def on_pretrain_routine_end(trainer): function on_train_start (line 22) | def on_train_start(trainer): function on_train_epoch_start (line 27) | def on_train_epoch_start(trainer): function on_train_batch_start (line 32) | def on_train_batch_start(trainer): function optimizer_step (line 37) | def optimizer_step(trainer): function on_before_zero_grad (line 42) | def on_before_zero_grad(trainer): function on_train_batch_end (line 47) | def on_train_batch_end(trainer): function on_train_epoch_end (line 52) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 57) | def on_fit_epoch_end(trainer): function on_model_save (line 62) | def on_model_save(trainer): function on_train_end (line 67) | def on_train_end(trainer): function on_params_update (line 72) | def on_params_update(trainer): function teardown (line 77) | def teardown(trainer): function on_val_start (line 85) | def on_val_start(validator): function on_val_batch_start (line 90) | def on_val_batch_start(validator): function on_val_batch_end (line 95) | def on_val_batch_end(validator): function on_val_end (line 100) | def on_val_end(validator): function on_predict_start (line 108) | def on_predict_start(predictor): function on_predict_batch_start (line 113) | def on_predict_batch_start(predictor): function on_predict_batch_end (line 118) | def on_predict_batch_end(predictor): function on_predict_postprocess_end (line 123) | def on_predict_postprocess_end(predictor): function on_predict_end (line 128) | def on_predict_end(predictor): function on_export_start (line 136) | def on_export_start(exporter): function on_export_end (line 141) | def on_export_end(exporter): function get_default_callbacks (line 181) | def get_default_callbacks(): function add_integration_callbacks (line 191) | def add_integration_callbacks(instance): FILE: ultralytics/yolo/utils/callbacks/clearml.py function _log_debug_samples (line 23) | def _log_debug_samples(files, title='Debug Samples') -> None: function _log_plot (line 43) | def _log_plot(title, plot_path) -> None: function on_pretrain_routine_start (line 62) | def on_pretrain_routine_start(trainer): function on_train_epoch_end (line 87) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 99) | def on_fit_epoch_end(trainer): function on_val_end (line 113) | def on_val_end(validator): function on_train_end (line 120) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/callbacks/comet.py function _get_comet_mode (line 27) | def _get_comet_mode(): function _get_comet_model_name (line 31) | def _get_comet_model_name(): function _get_eval_batch_logging_interval (line 35) | def _get_eval_batch_logging_interval(): function _get_max_image_predictions_to_log (line 39) | def _get_max_image_predictions_to_log(): function _scale_confidence_score (line 43) | def _scale_confidence_score(score): function _should_log_confusion_matrix (line 48) | def _should_log_confusion_matrix(): function _should_log_image_predictions (line 52) | def _should_log_image_predictions(): function _get_experiment_type (line 56) | def _get_experiment_type(mode, project_name): function _create_experiment (line 64) | def _create_experiment(args): function _fetch_trainer_metadata (line 84) | def _fetch_trainer_metadata(trainer): function _scale_bounding_box_to_original_image_shape (line 105) | def _scale_bounding_box_to_original_image_shape(box, resized_image_shape... function _format_ground_truth_annotations_for_detection (line 126) | def _format_ground_truth_annotations_for_detection(img_idx, image_path, ... function _format_prediction_annotations_for_detection (line 153) | def _format_prediction_annotations_for_detection(image_path, metadata, c... function _fetch_annotations (line 176) | def _fetch_annotations(img_idx, image_path, batch, prediction_metadata_m... function _create_prediction_metadata_map (line 188) | def _create_prediction_metadata_map(model_predictions): function _log_confusion_matrix (line 198) | def _log_confusion_matrix(experiment, trainer, curr_step, curr_epoch): function _log_images (line 211) | def _log_images(experiment, image_paths, curr_step, annotations=None): function _log_image_predictions (line 222) | def _log_image_predictions(experiment, validator, curr_step): function _log_plots (line 267) | def _log_plots(experiment, trainer): function _log_model (line 276) | def _log_model(experiment, trainer): function on_pretrain_routine_start (line 287) | def on_pretrain_routine_start(trainer): function on_train_epoch_end (line 295) | def on_train_epoch_end(trainer): function on_fit_epoch_end (line 315) | def on_fit_epoch_end(trainer): function on_train_end (line 341) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/callbacks/dvc.py function _logger_disabled (line 33) | def _logger_disabled(): function _log_images (line 37) | def _log_images(image_path, prefix=''): function _log_plots (line 42) | def _log_plots(plots, prefix=''): function _log_confusion_matrix (line 50) | def _log_confusion_matrix(validator): function on_pretrain_routine_start (line 66) | def on_pretrain_routine_start(trainer): function on_pretrain_routine_end (line 81) | def on_pretrain_routine_end(trainer): function on_train_start (line 85) | def on_train_start(trainer): function on_train_epoch_start (line 90) | def on_train_epoch_start(trainer): function on_fit_epoch_end (line 95) | def on_fit_epoch_end(trainer): function on_train_end (line 113) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/callbacks/hub.py function on_pretrain_routine_end (line 11) | def on_pretrain_routine_end(trainer): function on_fit_epoch_end (line 20) | def on_fit_epoch_end(trainer): function on_model_save (line 35) | def on_model_save(trainer): function on_train_end (line 47) | def on_train_end(trainer): function on_train_start (line 59) | def on_train_start(trainer): function on_val_start (line 64) | def on_val_start(validator): function on_predict_start (line 69) | def on_predict_start(predictor): function on_export_start (line 74) | def on_export_start(exporter): FILE: ultralytics/yolo/utils/callbacks/mlflow.py function on_pretrain_routine_end (line 18) | def on_pretrain_routine_end(trainer): function on_fit_epoch_end (line 48) | def on_fit_epoch_end(trainer): function on_train_end (line 55) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/callbacks/neptune.py function _log_scalars (line 21) | def _log_scalars(scalars, step=0): function _log_images (line 28) | def _log_images(imgs_dict, group=''): function _log_plot (line 35) | 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 76) | def on_val_end(validator): function on_train_end (line 83) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/callbacks/raytune.py function on_fit_epoch_end (line 11) | def on_fit_epoch_end(trainer): FILE: ultralytics/yolo/utils/callbacks/tensorboard.py function _log_scalars (line 15) | def _log_scalars(scalars, step=0): function on_pretrain_routine_start (line 22) | def on_pretrain_routine_start(trainer): function on_batch_end (line 34) | def on_batch_end(trainer): function on_fit_epoch_end (line 39) | def on_fit_epoch_end(trainer): FILE: ultralytics/yolo/utils/callbacks/wb.py function _log_plots (line 16) | def _log_plots(plots, step): function on_pretrain_routine_start (line 24) | def on_pretrain_routine_start(trainer): function on_fit_epoch_end (line 29) | def on_fit_epoch_end(trainer): function on_train_epoch_end (line 38) | def on_train_epoch_end(trainer): function on_train_end (line 46) | def on_train_end(trainer): FILE: ultralytics/yolo/utils/checks.py function is_ascii (line 27) | def is_ascii(s) -> bool: function check_imgsz (line 44) | def check_imgsz(imgsz, stride=32, min_dim=1, max_dim=2, floor=0): function check_version (line 91) | def check_version(current: str = '0.0.0', function check_latest_pypi_version (line 121) | def check_latest_pypi_version(package_name='ultralytics'): function check_pip_update_available (line 139) | def check_pip_update_available(): function check_font (line 157) | def check_font(font='Arial.ttf'): function check_python (line 186) | def check_python(minimum: str = '3.7.0') -> bool: function check_requirements (line 200) | def check_requirements(requirements=ROOT.parent / 'requirements.txt', ex... function check_suffix (line 253) | def check_suffix(file='yolov8n.pt', suffix='.pt', msg=''): function check_yolov5u_filename (line 264) | def check_yolov5u_filename(file: str, verbose: bool = True): function check_file (line 278) | def check_file(file, suffix='', download=True, hard=True): function check_yaml (line 304) | def check_yaml(file, suffix=('.yaml', '.yml'), hard=True): function check_imshow (line 309) | def check_imshow(warn=False): function check_yolo (line 324) | def check_yolo(verbose=True, device=''): function check_amp (line 350) | def check_amp(model): function git_describe (line 399) | def git_describe(path=ROOT): # path must be a directory function print_args (line 408) | def print_args(args: Optional[dict] = None, show_file=True, show_func=Fa... FILE: ultralytics/yolo/utils/dist.py function find_free_network_port (line 15) | def find_free_network_port() -> int: function generate_ddp_file (line 26) | def generate_ddp_file(trainer): function generate_ddp_command (line 49) | def generate_ddp_command(world_size, trainer): function ddp_cleanup (line 64) | def ddp_cleanup(trainer, file): FILE: ultralytics/yolo/utils/downloads.py function is_url (line 26) | def is_url(url, check=True): function unzip_file (line 39) | def unzip_file(file, path=None, exclude=('.DS_Store', '__MACOSX')): function check_disk_space (line 76) | def check_disk_space(url='https://ultralytics.com/assets/coco128.zip', s... function safe_download (line 108) | def safe_download(url, function attempt_download_asset (line 193) | def attempt_download_asset(file, repo='ultralytics/assets', release='v0.... function download (line 244) | def download(url, dir=Path.cwd(), unzip=True, delete=False, curl=False, ... FILE: ultralytics/yolo/utils/errors.py class HUBModelError (line 6) | class HUBModelError(Exception): method __init__ (line 8) | def __init__(self, message='Model not found. Please check model URL an... FILE: ultralytics/yolo/utils/files.py class WorkingDirectory (line 11) | class WorkingDirectory(contextlib.ContextDecorator): method __init__ (line 14) | def __init__(self, new_dir): method __enter__ (line 19) | def __enter__(self): method __exit__ (line 23) | def __exit__(self, exc_type, exc_val, exc_tb): function increment_path (line 28) | def increment_path(path, exist_ok=False, sep='', mkdir=False): function file_age (line 63) | def file_age(path=__file__): function file_date (line 69) | def file_date(path=__file__): function file_size (line 75) | def file_size(path): function get_latest_run (line 87) | def get_latest_run(search_dir='.'): function make_dirs (line 93) | def make_dirs(dir='new_dir/'): FILE: ultralytics/yolo/utils/instance.py function _ntuple (line 13) | def _ntuple(n): class Bboxes (line 33) | class Bboxes: method __init__ (line 36) | def __init__(self, bboxes, format='xyxy') -> None: method convert (line 67) | def convert(self, format): method areas (line 81) | def areas(self): method mul (line 102) | def mul(self, scale): method add (line 116) | def add(self, offset): method __len__ (line 130) | def __len__(self): method concatenate (line 135) | def concatenate(cls, boxes_list: List['Bboxes'], axis=0) -> 'Bboxes': method __getitem__ (line 159) | def __getitem__(self, index) -> 'Bboxes': class Instances (line 184) | class Instances: method __init__ (line 186) | def __init__(self, bboxes, segments=None, keypoints=None, bbox_format=... method convert_bbox (line 208) | def convert_bbox(self, format): method bbox_areas (line 213) | def bbox_areas(self): method scale (line 217) | def scale(self, scale_w, scale_h, bbox_only=False): method denormalize (line 228) | def denormalize(self, w, h): method normalize (line 240) | def normalize(self, w, h): method add_padding (line 252) | def add_padding(self, padw, padh): method __getitem__ (line 262) | def __getitem__(self, index) -> 'Instances': method flipud (line 290) | def flipud(self, h): method fliplr (line 303) | def fliplr(self, w): method clip (line 316) | def clip(self, w, h): method remove_zero_area_boxes (line 330) | def remove_zero_area_boxes(self): method update (line 341) | def update(self, bboxes, segments=None, keypoints=None): method __len__ (line 349) | def __len__(self): method concatenate (line 354) | def concatenate(cls, instances_list: List['Instances'], axis=0) -> 'In... method bboxes (line 389) | def bboxes(self): FILE: ultralytics/yolo/utils/loss.py class VarifocalLoss (line 15) | class VarifocalLoss(nn.Module): method __init__ (line 18) | def __init__(self): method forward (line 22) | def forward(self, pred_score, gt_score, label, alpha=0.75, gamma=2.0): class FocalLoss (line 32) | class FocalLoss(nn.Module): method __init__ (line 35) | def __init__(self, ): method forward (line 38) | def forward(self, pred, label, gamma=1.5, alpha=0.25): class BboxLoss (line 55) | class BboxLoss(nn.Module): method __init__ (line 57) | def __init__(self, reg_max, use_dfl=False): method forward (line 63) | def forward(self, pred_dist, pred_bboxes, anchor_points, target_bboxes... method _df_loss (line 80) | def _df_loss(pred_dist, target): class KeypointLoss (line 91) | class KeypointLoss(nn.Module): method __init__ (line 93) | def __init__(self, sigmas) -> None: method forward (line 97) | def forward(self, pred_kpts, gt_kpts, kpt_mask, area): class v8DetectionLoss (line 107) | class v8DetectionLoss: method __init__ (line 109) | def __init__(self, model): # model must be de-paralleled method preprocess (line 129) | def preprocess(self, targets, batch_size, scale_tensor): method bbox_decode (line 146) | def bbox_decode(self, anchor_points, pred_dist): method __call__ (line 155) | def __call__(self, preds, batch): class v8SegmentationLoss (line 203) | class v8SegmentationLoss(v8DetectionLoss): method __init__ (line 205) | def __init__(self, model): # model must be de-paralleled method __call__ (line 210) | def __call__(self, preds, batch): method single_mask_loss (line 290) | def single_mask_loss(self, gt_mask, pred, proto, xyxy, area): class v8PoseLoss (line 298) | class v8PoseLoss(v8DetectionLoss): method __init__ (line 300) | def __init__(self, model): # model must be de-paralleled method __call__ (line 309) | def __call__(self, preds, batch): method kpts_decode (line 377) | def kpts_decode(self, anchor_points, pred_kpts): class v8ClassificationLoss (line 386) | class v8ClassificationLoss: method __call__ (line 388) | def __call__(self, preds, batch): FILE: ultralytics/yolo/utils/metrics.py function box_area (line 19) | def box_area(box): function bbox_ioa (line 24) | def bbox_ioa(box1, box2, eps=1e-7): function box_iou (line 52) | def box_iou(box1, box2, eps=1e-7): function bbox_iou (line 75) | def bbox_iou(box1, box2, xywh=True, GIoU=False, DIoU=False, CIoU=False, ... function mask_iou (line 131) | def mask_iou(mask1, mask2, eps=1e-7): function kpt_iou (line 150) | def kpt_iou(kpt1, kpt2, area, sigma, eps=1e-7): function smooth_BCE (line 172) | def smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues... class ConfusionMatrix (line 177) | class ConfusionMatrix: method __init__ (line 189) | def __init__(self, nc, conf=0.25, iou_thres=0.45, task='detect'): method process_cls_preds (line 197) | def process_cls_preds(self, preds, targets): method process_batch (line 209) | def process_batch(self, detections, labels): method matrix (line 255) | def matrix(self): method tp_fp (line 259) | def tp_fp(self): method plot (line 268) | def plot(self, normalize=True, save_dir='', names=(), on_plot=None): method print (line 311) | def print(self): function smooth (line 319) | def smooth(y, f=0.05): function plot_pr_curve (line 328) | def plot_pr_curve(px, py, ap, save_dir=Path('pr_curve.png'), names=(), o... function plot_mc_curve (line 353) | def plot_mc_curve(px, py, save_dir=Path('mc_curve.png'), names=(), xlabe... function compute_ap (line 377) | def compute_ap(recall, precision): function ap_per_class (line 410) | def ap_per_class(tp, class Metric (line 500) | class Metric(SimpleClass): method __init__ (line 528) | def __init__(self) -> None: method ap50 (line 537) | def ap50(self): method ap (line 547) | def ap(self): method mp (line 557) | def mp(self): method mr (line 567) | def mr(self): method map50 (line 577) | def map50(self): method map75 (line 587) | def map75(self): method map (line 597) | def map(self): method mean_results (line 606) | def mean_results(self): method class_result (line 610) | def class_result(self, i): method maps (line 615) | def maps(self): method fitness (line 622) | def fitness(self): method update (line 627) | def update(self, results): class DetMetrics (line 635) | class DetMetrics(SimpleClass): method __init__ (line 665) | def __init__(self, save_dir=Path('.'), plot=False, on_plot=None, names... method process (line 673) | def process(self, tp, conf, pred_cls, target_cls): method keys (line 687) | def keys(self): method mean_results (line 691) | def mean_results(self): method class_result (line 695) | def class_result(self, i): method maps (line 700) | def maps(self): method fitness (line 705) | def fitness(self): method ap_class_index (line 710) | def ap_class_index(self): method results_dict (line 715) | def results_dict(self): class SegmentMetrics (line 720) | class SegmentMetrics(SimpleClass): method __init__ (line 749) | def __init__(self, save_dir=Path('.'), plot=False, on_plot=None, names... method process (line 758) | def process(self, tp_b, tp_m, conf, pred_cls, target_cls): method keys (line 794) | def keys(self): method mean_results (line 800) | def mean_results(self): method class_result (line 804) | def class_result(self, i): method maps (line 809) | def maps(self): method fitness (line 814) | def fitness(self): method ap_class_index (line 819) | def ap_class_index(self): method results_dict (line 824) | def results_dict(self): class PoseMetrics (line 829) | class PoseMetrics(SegmentMetrics): method __init__ (line 858) | def __init__(self, save_dir=Path('.'), plot=False, on_plot=None, names... method __getattr__ (line 868) | def __getattr__(self, attr): method process (line 873) | def process(self, tp_b, tp_p, conf, pred_cls, target_cls): method keys (line 909) | def keys(self): method mean_results (line 915) | def mean_results(self): method class_result (line 919) | def class_result(self, i): method maps (line 924) | def maps(self): method fitness (line 929) | def fitness(self): class ClassifyMetrics (line 934) | class ClassifyMetrics(SimpleClass): method __init__ (line 952) | def __init__(self) -> None: method process (line 957) | def process(self, targets, pred): method fitness (line 965) | def fitness(self): method results_dict (line 970) | def results_dict(self): method keys (line 975) | def keys(self): FILE: ultralytics/yolo/utils/ops.py class Profile (line 19) | class Profile(contextlib.ContextDecorator): method __init__ (line 25) | def __init__(self, t=0.0): method __enter__ (line 35) | def __enter__(self): method __exit__ (line 42) | def __exit__(self, type, value, traceback): method time (line 49) | def time(self): function coco80_to_coco91_class (line 58) | def coco80_to_coco91_class(): # converts 80-index (val2014) to 91-index... function segment2box (line 70) | def segment2box(segment, width=640, height=640): function scale_boxes (line 90) | def scale_boxes(img1_shape, boxes, img0_shape, ratio_pad=None): function make_divisible (line 120) | def make_divisible(x, divisor): function non_max_suppression (line 136) | def non_max_suppression( function clip_boxes (line 269) | def clip_boxes(boxes, shape): function clip_coords (line 288) | def clip_coords(coords, shape): function scale_image (line 307) | def scale_image(masks, im0_shape, ratio_pad=None): function xyxy2xywh (line 345) | def xyxy2xywh(x): function xywh2xyxy (line 362) | def xywh2xyxy(x): function xywhn2xyxy (line 380) | def xywhn2xyxy(x, w=640, h=640, padw=0, padh=0): function xyxy2xywhn (line 402) | def xyxy2xywhn(x, w=640, h=640, clip=False, eps=0.0): function xyn2xy (line 426) | def xyn2xy(x, w=640, h=640, padw=0, padh=0): function xywh2ltwh (line 445) | def xywh2ltwh(x): function xyxy2ltwh (line 460) | def xyxy2ltwh(x): function ltwh2xywh (line 475) | def ltwh2xywh(x): function ltwh2xyxy (line 488) | def ltwh2xyxy(x): function segments2boxes (line 504) | def segments2boxes(segments): function resample_segments (line 521) | def resample_segments(segments, n=1000): function crop_mask (line 541) | def crop_mask(masks, boxes): function process_mask_upsample (line 560) | def process_mask_upsample(protos, masks_in, bboxes, shape): function process_mask (line 581) | def process_mask(protos, masks_in, bboxes, shape, upsample=False): function process_mask_native (line 613) | def process_mask_native(protos, masks_in, bboxes, shape): function scale_coords (line 639) | def scale_coords(img1_shape, coords, img0_shape, ratio_pad=None, normali... function masks2segments (line 671) | def masks2segments(masks, strategy='largest'): function clean_str (line 696) | def clean_str(s): FILE: ultralytics/yolo/utils/patches.py function imread (line 16) | def imread(filename, flags=cv2.IMREAD_COLOR): function imwrite (line 20) | def imwrite(filename, img): function imshow (line 28) | def imshow(path, im): function torch_save (line 36) | def torch_save(*args, **kwargs): FILE: ultralytics/yolo/utils/plotting.py class Colors (line 22) | class Colors: method __init__ (line 24) | def __init__(self): method __call__ (line 36) | def __call__(self, i, bgr=False): method hex2rgb (line 42) | def hex2rgb(h): # rgb order (PIL) class Annotator (line 49) | class Annotator: method __init__ (line 51) | def __init__(self, im, line_width=None, font_size=None, font='Arial.tt... method box_label (line 78) | def box_label(self, box, label='', color=(128, 128, 128), txt_color=(2... method masks (line 111) | def masks(self, masks, colors, im_gpu, alpha=0.5, retina_masks=False): method kpts (line 144) | def kpts(self, kpts, shape=(640, 640), radius=5, kpt_line=True): method rectangle (line 191) | def rectangle(self, xy, fill=None, outline=None, width=1): method text (line 195) | def text(self, xy, text, txt_color=(255, 255, 255), anchor='top', box_... method fromarray (line 219) | def fromarray(self, im): method result (line 224) | def result(self): function plot_labels (line 231) | def plot_labels(boxes, cls, names=(), save_dir=Path(''), on_plot=None): function save_one_box (line 281) | def save_one_box(xyxy, im, file=Path('im.jpg'), gain=1.02, pad=10, squar... function plot_images (line 299) | def plot_images(images, function plot_results (line 431) | def plot_results(file='path/to/results.csv', dir='', segment=False, pose... function output_to_target (line 473) | def output_to_target(output, max_det=300): function feature_visualization (line 484) | def feature_visualization(x, module_type, stage, n=32, save_dir=Path('ru... FILE: ultralytics/yolo/utils/tal.py function select_candidates_in_gts (line 12) | def select_candidates_in_gts(xy_centers, gt_bboxes, eps=1e-9): function select_highest_overlaps (line 29) | def select_highest_overlaps(mask_pos, overlaps, n_max_boxes): class TaskAlignedAssigner (line 57) | class TaskAlignedAssigner(nn.Module): method __init__ (line 72) | def __init__(self, topk=13, num_classes=80, alpha=1.0, beta=6.0, eps=1... method forward (line 83) | def forward(self, pd_scores, pd_bboxes, anc_points, gt_labels, gt_bbox... method get_pos_mask (line 129) | def get_pos_mask(self, pd_scores, pd_bboxes, gt_labels, gt_bboxes, anc... method get_box_metrics (line 141) | def get_box_metrics(self, pd_scores, pd_bboxes, gt_labels, gt_bboxes, ... method select_topk_candidates (line 162) | def select_topk_candidates(self, metrics, largest=True, topk_mask=None): method get_targets (line 198) | def get_targets(self, gt_labels, gt_bboxes, target_gt_idx, fg_mask): function make_anchors (line 246) | def make_anchors(feats, strides, grid_cell_offset=0.5): function dist2bbox (line 261) | def dist2bbox(distance, anchor_points, xywh=True, dim=-1): function bbox2dist (line 273) | def bbox2dist(anchor_points, bbox, reg_max): FILE: ultralytics/yolo/utils/torch_utils.py function torch_distributed_zero_first (line 36) | def torch_distributed_zero_first(local_rank: int): function smart_inference_mode (line 46) | def smart_inference_mode(): function select_device (line 56) | def select_device(device='', batch=0, newline=False, verbose=True): function time_sync (line 107) | def time_sync(): function fuse_conv_and_bn (line 114) | def fuse_conv_and_bn(conv, bn): function fuse_deconv_and_bn (line 138) | def fuse_deconv_and_bn(deconv, bn): function model_info (line 163) | def model_info(model, detailed=False, verbose=True, imgsz=640): function get_num_params (line 187) | def get_num_params(model): function get_num_gradients (line 192) | def get_num_gradients(model): function model_info_for_loggers (line 197) | def model_info_for_loggers(trainer): function get_flops (line 220) | def get_flops(model, imgsz=640): function get_flops_with_torch_profiler (line 234) | def get_flops_with_torch_profiler(model, imgsz=640): function initialize_weights (line 248) | def initialize_weights(model): function scale_img (line 261) | def scale_img(img, ratio=1.0, same_shape=False, gs=32): # img(16,3,256,... function make_divisible (line 273) | def make_divisible(x, divisor): function copy_attr (line 280) | def copy_attr(a, b, include=(), exclude=()): function get_latest_opset (line 289) | def get_latest_opset(): function intersect_dicts (line 294) | def intersect_dicts(da, db, exclude=()): function is_parallel (line 299) | def is_parallel(model): function de_parallel (line 304) | def de_parallel(model): function one_cycle (line 309) | def one_cycle(y1=0.0, y2=1.0, steps=100): function init_seeds (line 314) | def init_seeds(seed=0, deterministic=False): class ModelEMA (line 335) | class ModelEMA: method __init__ (line 342) | def __init__(self, model, decay=0.9999, tau=2000, updates=0): method update (line 351) | def update(self, model): method update_attr (line 364) | def update_attr(self, model, include=(), exclude=('process_group', 're... function strip_optimizer (line 370) | def strip_optimizer(f: Union[str, Path] = 'best.pt', s: str = '') -> None: function profile (line 410) | def profile(input, ops, n=10, device=None): class EarlyStopping (line 463) | class EarlyStopping: method __init__ (line 468) | def __init__(self, patience=50): method __call__ (line 480) | def __call__(self, epoch, fitness): FILE: ultralytics/yolo/v8/classify/predict.py class ClassificationPredictor (line 10) | class ClassificationPredictor(BasePredictor): method __init__ (line 12) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method preprocess (line 16) | def preprocess(self, img): method postprocess (line 23) | def postprocess(self, preds, img, orig_imgs): function predict (line 35) | def predict(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/classify/train.py class ClassificationTrainer (line 15) | class ClassificationTrainer(BaseTrainer): method __init__ (line 17) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method set_model_attributes (line 26) | def set_model_attributes(self): method get_model (line 30) | def get_model(self, cfg=None, weights=None, verbose=True): method setup_model (line 45) | def setup_model(self): method build_dataset (line 70) | def build_dataset(self, img_path, mode='train', batch=None): method get_dataloader (line 73) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode='tr... method preprocess_batch (line 87) | def preprocess_batch(self, batch): method progress_string (line 93) | def progress_string(self): method get_validator (line 98) | def get_validator(self): method label_loss_items (line 103) | def label_loss_items(self, loss_items=None, prefix='train'): method resume_training (line 114) | def resume_training(self, ckpt): method plot_metrics (line 118) | def plot_metrics(self): method final_eval (line 122) | def final_eval(self): method plot_training_samples (line 136) | def plot_training_samples(self, batch, ni): function train (line 145) | def train(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/classify/val.py class ClassificationValidator (line 12) | class ClassificationValidator(BaseValidator): method __init__ (line 14) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method get_desc (line 20) | def get_desc(self): method init_metrics (line 24) | def init_metrics(self, model): method preprocess (line 32) | def preprocess(self, batch): method update_metrics (line 39) | def update_metrics(self, preds, batch): method finalize_metrics (line 45) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 57) | def get_stats(self): method build_dataset (line 62) | def build_dataset(self, img_path): method get_dataloader (line 65) | def get_dataloader(self, dataset_path, batch_size): method print_results (line 70) | def print_results(self): method plot_val_samples (line 75) | def plot_val_samples(self, batch, ni): method plot_predictions (line 84) | def plot_predictions(self, batch, preds, ni): function val (line 94) | def val(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/detect/predict.py class DetectionPredictor (line 10) | class DetectionPredictor(BasePredictor): method postprocess (line 12) | def postprocess(self, preds, img, orig_imgs): function predict (line 32) | def predict(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/detect/train.py class DetectionTrainer (line 17) | class DetectionTrainer(BaseTrainer): method build_dataset (line 19) | def build_dataset(self, img_path, mode='train', batch=None): method get_dataloader (line 30) | def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode='tr... method preprocess_batch (line 62) | def preprocess_batch(self, batch): method set_model_attributes (line 67) | def set_model_attributes(self): method get_model (line 77) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 84) | def get_validator(self): method label_loss_items (line 89) | def label_loss_items(self, loss_items=None, prefix='train'): method progress_string (line 101) | def progress_string(self): method plot_training_samples (line 106) | def plot_training_samples(self, batch, ni): method plot_metrics (line 116) | def plot_metrics(self): method plot_training_labels (line 120) | def plot_training_labels(self): function train (line 127) | def train(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/detect/val.py class DetectionValidator (line 19) | class DetectionValidator(BaseValidator): method __init__ (line 21) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 31) | def preprocess(self, batch): method init_metrics (line 44) | def init_metrics(self, model): method get_desc (line 59) | def get_desc(self): method postprocess (line 63) | def postprocess(self, preds): method update_metrics (line 73) | def update_metrics(self, preds, batch): method finalize_metrics (line 119) | def finalize_metrics(self, *args, **kwargs): method get_stats (line 124) | def get_stats(self): method print_results (line 132) | def print_results(self): method _process_batch (line 152) | def _process_batch(self, detections, labels): method build_dataset (line 177) | def build_dataset(self, img_path, mode='val', batch=None): method get_dataloader (line 188) | def get_dataloader(self, dataset_path, batch_size): method plot_val_samples (line 212) | def plot_val_samples(self, batch, ni): method plot_predictions (line 223) | def plot_predictions(self, batch, preds, ni): method save_one_txt (line 232) | def save_one_txt(self, predn, save_conf, shape, file): method pred_to_json (line 241) | def pred_to_json(self, predn, filename): method eval_json (line 254) | def eval_json(self, stats): function val (line 281) | def val(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/pose/predict.py class PosePredictor (line 8) | class PosePredictor(DetectionPredictor): method __init__ (line 10) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 14) | def postprocess(self, preds, img, orig_imgs): function predict (line 42) | def predict(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/pose/train.py class PoseTrainer (line 12) | class PoseTrainer(v8.detect.DetectionTrainer): method __init__ (line 14) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_model (line 21) | def get_model(self, cfg=None, weights=None, verbose=True): method set_model_attributes (line 29) | def set_model_attributes(self): method get_validator (line 34) | def get_validator(self): method plot_training_samples (line 39) | def plot_training_samples(self, batch, ni): method plot_metrics (line 56) | def plot_metrics(self): function train (line 61) | def train(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/pose/val.py class PoseValidator (line 15) | class PoseValidator(DetectionValidator): method __init__ (line 17) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 23) | def preprocess(self, batch): method get_desc (line 29) | def get_desc(self): method postprocess (line 34) | def postprocess(self, preds): method init_metrics (line 45) | def init_metrics(self, model): method update_metrics (line 53) | def update_metrics(self, preds, batch): method _process_batch (line 110) | def _process_batch(self, detections, labels, pred_kpts=None, gt_kpts=N... method plot_val_samples (line 143) | def plot_val_samples(self, batch, ni): method plot_predictions (line 155) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 166) | def pred_to_json(self, predn, filename): method eval_json (line 180) | def eval_json(self, stats): function val (line 209) | def val(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/segment/predict.py class SegmentationPredictor (line 10) | class SegmentationPredictor(DetectionPredictor): method __init__ (line 12) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method postprocess (line 16) | def postprocess(self, preds, img, orig_imgs): function predict (line 47) | def predict(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/segment/train.py class SegmentationTrainer (line 11) | class SegmentationTrainer(v8.detect.DetectionTrainer): method __init__ (line 13) | def __init__(self, cfg=DEFAULT_CFG, overrides=None, _callbacks=None): method get_model (line 20) | def get_model(self, cfg=None, weights=None, verbose=True): method get_validator (line 28) | def get_validator(self): method plot_training_samples (line 33) | def plot_training_samples(self, batch, ni): method plot_metrics (line 44) | def plot_metrics(self): function train (line 49) | def train(cfg=DEFAULT_CFG, use_python=False): FILE: ultralytics/yolo/v8/segment/val.py class SegmentationValidator (line 17) | class SegmentationValidator(DetectionValidator): method __init__ (line 19) | def __init__(self, dataloader=None, save_dir=None, pbar=None, args=Non... method preprocess (line 25) | def preprocess(self, batch): method init_metrics (line 31) | def init_metrics(self, model): method get_desc (line 41) | def get_desc(self): method postprocess (line 46) | def postprocess(self, preds): method update_metrics (line 59) | def update_metrics(self, preds, batch): method finalize_metrics (line 126) | def finalize_metrics(self, *args, **kwargs): method _process_batch (line 131) | def _process_batch(self, detections, labels, pred_masks=None, gt_masks... method plot_val_samples (line 168) | def plot_val_samples(self, batch, ni): method plot_predictions (line 180) | def plot_predictions(self, batch, preds, ni): method pred_to_json (line 192) | def pred_to_json(self, predn, filename, pred_masks): method eval_json (line 218) | def eval_json(self, stats): function val (line 247) | def val(cfg=DEFAULT_CFG, use_python=False): FILE: utils/tools.py function convert_box_xywh_to_xyxy (line 10) | def convert_box_xywh_to_xyxy(box): function segment_image (line 21) | def segment_image(image, bbox): function format_results (line 38) | def format_results(result, filter=0): function filter_masks (line 56) | def filter_masks(annotations): # filter the overlap mask function get_bbox_from_mask (line 74) | def get_bbox_from_mask(mask): function fast_process (line 94) | def fast_process( function fast_show_mask (line 194) | def fast_show_mask( function fast_show_mask_gpu (line 260) | def fast_show_mask_gpu( function retriev (line 327) | def retriev( function crop_image (line 342) | def crop_image(annotations, image_like): function box_prompt (line 366) | def box_prompt(masks, bbox, target_height, target_width): function point_prompt (line 394) | def point_prompt(masks, points, point_label, target_height, target_width... function text_prompt (line 418) | def text_prompt(annotations, text, img_path, device, wider=False, thresh... FILE: utils/tools_gradio.py function fast_process (line 8) | def fast_process( function fast_show_mask (line 88) | def fast_show_mask( function fast_show_mask_gpu (line 130) | def fast_show_mask_gpu(