MCPcopy Create free account

hub / github.com/JDSobek/MedYOLO / functions

Functions151 in github.com/JDSobek/MedYOLO

↓ 12 callersMethodplot
Plots confusion matrix Args: normalize (bool, optional): whether to normalize column values. Defaults to True. save_d
utils3D/lossandmetrics.py:429
↓ 10 callersMethodrun
Loop through the registered actions and fire all callbacks Args: hook The name of the hook to check, defaults to all
utils/callbacks.py:63
↓ 7 callersFunctioncolorstr
(*input)
utils/general.py:115
↓ 6 callersFunctionfitness
(x)
utils/metrics.py:12
↓ 5 callersMethod__init__
CSP Bottleneck with 3 convolutions. CSP Bottleneck https://github.com/WongKinYiu/CrossStagePartialNetworks Args: c1 (int)
models3D/model.py:177
↓ 5 callersFunctiontime_sync
()
utils/torch_utils.py:53
↓ 4 callersFunctioncheck_suffix
(file='yolo3Ds.pt', suffix=('.pt',), msg='')
utils/general.py:51
↓ 4 callersFunctionis_parallel
(model)
utils/torch_utils.py:60
↓ 4 callersFunctionmetric
(k)
utils3D/anchors.py:42
↓ 4 callersFunctionnifti_dataloader
This is the dataloader used in the training process The same as that of 2D YOLO, just built around a different Dataset definition Args:
utils3D/datasets.py:353
↓ 3 callersFunctionattempt_load
Loads an ensemble of models weights=[a,b,c] or a single model weights=[a] or weights=a Called during validation. Args: weights (str o
models3D/model.py:36
↓ 3 callersFunctionbox_iou
Return intersection-over-union (Jaccard index) of boxes. Both sets of boxes are expected to be in (z1, x1, y1, z2, x2, y2) format. https://git
utils3D/lossandmetrics.py:133
↓ 3 callersFunctioncheck_yaml
(file, suffix=('.yaml', '.yml'))
utils/general.py:62
↓ 3 callersFunctionincrement_path
(path, exist_ok=False, sep='', mkdir=False)
utils/general.py:204
↓ 3 callersFunctionmake_divisible
(x, divisor)
utils/general.py:105
↓ 3 callersFunctionplot_mc_curve
(px, py, save_dir='mc_curve.png', names=(), xlabel='Confidence', ylabel='Metric')
utils/metrics.py:134
↓ 3 callersFunctionprint_args
(name, opt)
utils/general.py:29
↓ 3 callersFunctionprint_results
(k)
utils3D/anchors.py:104
↓ 3 callersFunctionrun
(data, weights=None, # model.pt path(s) batch_size=32, # batch size imgsz=default_si
val.py:78
↓ 3 callersFunctionscale_coords
Rescale bounding box coordinates (zxyzxy) from img1_shape to img0_shape. Args: img1_shape (Tuple[int]): size of the resized image that pr
utils3D/general.py:147
↓ 3 callersFunctionselect_device
(device='', batch_size=None)
utils/torch_utils.py:29
↓ 3 callersMethodupdate
(self, model)
utils/torch_utils.py:125
↓ 3 callersFunctionzxyzxy2zxydwh
Convert nx6 boxes from [z1, x1, y1, z2, x2, y2] to [z, x, y, d, w, h] where zxy1=top-left, zxy2=bottom-right Args: labels (torch.tensor o
utils3D/general.py:127
↓ 2 callersFunctionanchor_fitness
(k)
utils3D/anchorcalculator.py:58
↓ 2 callersFunctionanchor_fitness
(k)
utils3D/anchors.py:100
↓ 2 callersFunctionbox_volume
(box)
utils3D/lossandmetrics.py:146
↓ 2 callersFunctionchange_nifti_size
Resizes a 3D tensor to a cube with edge length new_size. Also adds the channel dimension. Args: nifti_tensor (torch.Tensor): The tens
utils3D/datasets.py:512
↓ 2 callersFunctioncheck_dataset
(data)
utils/general.py:82
↓ 2 callersFunctioncheck_file
(file, suffix='')
utils/general.py:67
↓ 2 callersFunctioncheck_img_size
(imgsz, s=32, floor=0)
utils/general.py:40
↓ 2 callersFunctionclip_coords
In-place clip zxyzxy bounding boxes to image shape (depth, height, width) Args: boxes (torch.tensor or np.ndarray): bounding boxes to cli
utils3D/general.py:187
↓ 2 callersFunctionde_parallel
(model)
utils/torch_utils.py:65
↓ 2 callersFunctionget_hash
(paths)
utils/datasets.py:19
↓ 2 callersFunctionimg2label_paths
Defines label paths as a function of the image paths. Filters for .nii and .nii.gz files. Args: img_paths (List[str]): list of image fil
utils3D/datasets.py:398
↓ 2 callersFunctionmain
(opt, callbacks=Callbacks())
train.py:394
↓ 2 callersFunctionmetric
(k, dwh)
utils3D/anchorcalculator.py:42
↓ 2 callersFunctionnon_max_suppression
Runs Non-Maximum Suppression (NMS) on inference results for 3D bounding box predictions. Args: prediction (torch.tensor): tensor of predi
utils3D/general.py:310
↓ 2 callersFunctionopen_nifti
Reads a nifti file and converts it to a torch tensor Args: filepath (str): Path to the nifti file Returns: nifti (torch.tens
utils3D/datasets.py:475
↓ 2 callersFunctionparse_opt
(known=False)
train.py:360
↓ 2 callersFunctionprint_results
(k)
utils3D/anchorcalculator.py:62
↓ 2 callersFunctiontorch_distributed_zero_first
Decorator to make all processes in distributed training wait for each local_master to do something.
utils/torch_utils.py:18
↓ 2 callersFunctiontrain
(hyp, opt, device, callbacks)
train.py:60
↓ 2 callersFunctiontranspose_nifti_shape
Reshapes the tensor from height, width, depth order to depth, height, width to make it compatible with torch convolutions. Args: nift
utils3D/datasets.py:497
↓ 2 callersFunctionzxydwh2zxyzxy
Convert nx6 boxes from [z, x, y, d, w, h] to [z1, x1, y1, z2, x2, y2] where zxy1=top-left, zxy2=bottom-right Args: labels (torch.tensor o
utils3D/general.py:82
↓ 1 callersFunctionAnchorCalculator
(dataset, model, imgsz=default_size, thr=4.0, gen=1000, opt_hypers=False)
utils3D/anchorcalculator.py:33
↓ 1 callersFunction_3d_nms
Performs non-maximum suppression (NMS) on bounding boxes according to their intersection-over-union (IoU). NMS iteratively removes lowe
utils3D/general.py:207
↓ 1 callersMethod__init__
(self, sampler)
utils/datasets.py:53
↓ 1 callersMethod__iter__
(self)
utils/datasets.py:56
↓ 1 callersMethod_forward_once
(self, x)
models3D/model.py:443
↓ 1 callersMethod_initialize_biases
(self, cf=None)
models3D/model.py:452
↓ 1 callersMethod_make_grid
(self, nz=20, nx=20, ny=20, i=0)
models3D/model.py:278
↓ 1 callersFunctionap_per_class
Compute the average precision, given the recall and precision curves. Source: https://github.com/rafaelpadilla/Object-Detection-Metrics. # Ar
utils/metrics.py:18
↓ 1 callersFunctionautopad
(k, p=None)
models/common.py:10
↓ 1 callersFunctionbbox_centerDist
Measures the distance between the centers of two bounding boxes Args: box1 (torch.Tensor): First bounding box to calculate distance for.
utils3D/lossandmetrics.py:159
↓ 1 callersFunctionbbox_iou
Returns the IoU of box1 to box2. box1 is 6, box2 is nx6. Args: box1 (torch.Tensor): First bounding box to calculate IoU for.
utils3D/lossandmetrics.py:93
↓ 1 callersFunctionbbox_iov
Returns the intersection over box2 volume given box1, box2. Boxes are z1x1y1z2x2y2 box1: np.array of shape(6) box2: np.array of s
utils3D/lossandmetrics.py:68
↓ 1 callersFunctionbox_regression
Regression formula to convert model output into bounding box predictions.
utils3D/lossandmetrics.py:185
↓ 1 callersMethodbuild_targets
Build targets for compute_loss() input targets with format (image,class,z,x,y,d,w,h) Args: pred (torch.Tensor): Examp
utils3D/lossandmetrics.py:299
↓ 1 callersMethodcache_labels
Caches dataset labels, verifies images and reads their shapes. See: verify_image_label function Args: path (pathlib.Path,
utils3D/datasets.py:218
↓ 1 callersFunctioncompute_ap
Compute the average precision, given the recall and precision curves # Arguments recall: The recall curve (list) precision: Th
utils/metrics.py:83
↓ 1 callersFunctioncopy_attr
(a, b, include=(), exclude=())
utils/torch_utils.py:75
↓ 1 callersFunctionfile_lister_detect
Takes a parent directory and looks for files within those directories. Output organized to fit YOLO inference requirements. Args: par
utils3D/datasets.py:66
↓ 1 callersFunctionfile_lister_train
Takes a parent directory or list of parent directories and looks for files within those directories. Output organized to fit YOLO training re
utils3D/datasets.py:33
↓ 1 callersMethodforward
(self, x)
models3D/model.py:439
↓ 1 callersMethodfuse
(self)
models3D/model.py:463
↓ 1 callersFunctionfuse_conv_and_bn
Fuse convolution and batchnorm layers https://tehnokv.com/posts/fusing-batchnorm-and-conv/ Args: conv (torch.Module): Conv layer to fuse.
models3D/model.py:81
↓ 1 callersFunctionget_latest_run
(search_dir='.')
utils/general.py:34
↓ 1 callersFunctionhist2d
(x, y, n=100)
utils/plots.py:23
↓ 1 callersMethodinfo
(self, verbose=False)
models3D/model.py:472
↓ 1 callersFunctioninitialize_weights
Initializes parameters for layers that need extra parameters set. Args: model (torch.Module): YOLO model to initialize weights for
models3D/model.py:288
↓ 1 callersFunctionintersect_dicts
(da, db, exclude=())
utils/torch_utils.py:70
↓ 1 callersFunctionlabels_to_class_weights
(labels, nc=80)
utils/general.py:140
↓ 1 callersMethodload_nifti
Reads a nifti file, converts it to a torch.tensor, and reshapes and resizes it for use in the YOLO3D model. Args: i (int): Datase
utils3D/datasets.py:258
↓ 1 callersFunctionmain
(opt)
val.py:294
↓ 1 callersFunctionmain
(opt)
detect.py:172
↓ 1 callersFunctionmain
(opt)
utils3D/nifti_utils.py:205
↓ 1 callersFunctionmask_maker
Makes nifti masks out of YOLO label txt files. Only works for one label per mask. Labels should have one prediction without confidence metri
utils3D/nifti_utils.py:103
↓ 1 callersFunctionmodel_info
Model information. Args: model (torch.Module): Model to get information from verbose (bool, optional): Whether or not to print na
models3D/model.py:113
↓ 1 callersFunctionmultilabel_mask_maker
Makes nifti masks out of a YOLO label txt file. Saves highest confidence mask for each class. Args: bbox_path: path to the YOLO labe
utils3D/nifti_utils.py:34
↓ 1 callersFunctionnifti_check_anchors
Checks anchor fit to data and recomputes if necessary. Args: dataset (torch.Dataset): Dataset the anchors will be used with. mode
utils3D/anchors.py:23
↓ 1 callersFunctionnifti_kmean_anchors
Creates kmeans-evolved anchors from training dataset using niftis Arguments: dataset (str or torch.Dataset): path to dat
utils3D/anchors.py:73
↓ 1 callersFunctionnormalize_CT
Normalizes 3D CTs in Hounsfield Units (+/- 1024) to within 0 and 1. Args: imgs (torch.tensor): unnormalized model input Returns:
utils3D/datasets.py:534
↓ 1 callersFunctionnormalize_MR
Volume normalizes 3D MR images to mean 0 and standard deviation 1. Args: imgs (torch.tensor): unnormalized model input Returns:
utils3D/datasets.py:547
↓ 1 callersFunctionone_cycle
(y1=0.0, y2=1.0, steps=100)
utils/general.py:110
↓ 1 callersFunctionoptimize_hypers
(dwh, max_anch=99)
utils3D/anchorcalculator.py:73
↓ 1 callersFunctionparse_model
Configures the model using hyperparameters from the model yaml file. Note: model yaml file (e.g. yolov3Ds.yaml) is distinct from the training
models3D/model.py:330
↓ 1 callersFunctionparse_opt
()
val.py:267
↓ 1 callersFunctionparse_opt
()
detect.py:149
↓ 1 callersFunctionparse_opt
()
utils3D/nifti_utils.py:192
↓ 1 callersFunctionplot_evolve
(evolve_csv='path/to/evolve.csv')
utils/plots.py:69
↓ 1 callersFunctionplot_pr_curve
(px, py, ap, save_dir='pr_curve.png', names=())
utils/metrics.py:113
↓ 1 callersFunctionplot_val_study
(file='', dir='', x=None)
utils/plots.py:32
↓ 1 callersFunctionprint_mutation
(results, hyp, save_dir, bucket)
utils/general.py:171
↓ 1 callersFunctionprocess_batch
Return correct predictions matrix. Both sets of boxes are in (z1, x1, y1, z2, x2, y2) format. Arguments: detections (Array[N, 8]), z1
val.py:53
↓ 1 callersMethodprocess_batch
Return intersection-over-union (Jaccard index) of boxes. Both sets of boxes are expected to be in (z1, x1, y1, z2, x2, y2) format.
utils3D/lossandmetrics.py:386
↓ 1 callersFunctionrandom_zoom
Randomly zooms in or out of a random part of the input image. Args: im (torch.Tensor): 3-D tensor to be augmented. labels (List[f
utils3D/augmentations.py:64
↓ 1 callersFunctionreduce_loss
Reduce loss as specified. Args: loss (Tensor): Elementwise loss tensor. reduction (str): Options are "none", "mean" and "sum".
utils3D/lossandmetrics.py:23
↓ 1 callersFunctionrun
(weights, # model.pt path(s) source=ROOT / 'data/images', # directory containing images to run infer
detect.py:35
↓ 1 callersFunctionrun
Creates nifti masks for MedYOLO bounding boxes found in bbox_dir that have a corresponding nifti image in nifti_dir. See mask maker functions
utils3D/nifti_utils.py:161
↓ 1 callersFunctionsave_one_txt
(predn, save_conf, shape, file)
val.py:39
next →1–100 of 151, ranked by callers