MCPcopy Create free account

hub / github.com/darolt/mask_rcnn / functions

Functions216 in github.com/darolt/mask_rcnn

↓ 29 callersMethodto
Apply pytorch's to() to all tensors in this container.
mrcnn/structs/tensor_container.py:11
↓ 21 callersMethodzeros
(self, size)
mrcnn/structs/mrcnn_target.py:19
↓ 6 callersMethoditem
(self)
mrcnn/functions/losses.py:18
↓ 4 callersMethoddump
(filename)
tools/config.py:137
↓ 4 callersMethodload_mask
Load instance masks for the given image. Different datasets use different ways to store masks. Override this method to load instance
mrcnn/data/dataset_handler.py:165
↓ 4 callersMethodmake_layer
(self, block, planes, blocks, stride=1)
mrcnn/models/components/resnet.py:84
↓ 3 callersMethod_predict
(self, molded_images, proposal_count, mode='training', gt=None)
mrcnn/models/model.py:223
↓ 3 callersFunction_to_dict
(dict_node={}, node=Config)
tools/config.py:142
↓ 3 callersFunctionapply_mask
Apply the given mask to the image.
mrcnn/utils/visualize.py:73
↓ 3 callersMethoddisplay
(self)
mrcnn/utils/mrcnn_parser.py:58
↓ 3 callersMethodload_image
Load the specified image and return a [H,W,3] Numpy array.
mrcnn/data/dataset_handler.py:151
↓ 2 callersFunction_bbox_overlaps
Computes IoU overlaps between two sets of boxes. boxes1, boxes2: [N, (y1, x1, y2, x2)].
mrcnn/models/components/detection_target.py:141
↓ 2 callersFunction_get_tensors
()
tools/gpu_mem_profiling.py:96
↓ 2 callersMethod_load
Load configurations in config_fn as class attributes of this class. Args: config_fn: YAML file containing configuration.
tools/config.py:93
↓ 2 callersFunction_overlap_idx
(box1_x1, box1_x2, box2_x1, box2_x2)
mrcnn/functions/map_loss.py:44
↓ 2 callersMethod_prepare_inputs
(inputs)
mrcnn/models/model.py:437
↓ 2 callersFunctioncompute_losses
(rpn_target, rpn_out, mrcnn_targets, mrcnn_outs)
mrcnn/functions/losses.py:220
↓ 2 callersMethodcpu
Apply pytorch's cpu() to all tensors in this container.
mrcnn/structs/tensor_container.py:19
↓ 2 callersMethodfit
Train the model. train_dataset, val_dataset: Training and validation Dataset objects. learning_rate: The learning rate to train with
mrcnn/models/model.py:292
↓ 2 callersFunctionload_weights
Modified version of the correspoding Keras function with the addition of multi-GPU support and the ability to exclude some layers from loading
mrcnn/utils/model_utils.py:12
↓ 2 callersMethodnumpy
Apply pytorch's numpy() to all tensors in this container.
mrcnn/structs/tensor_container.py:25
↓ 2 callersMethodprint
Call in a loop to create terminal progress bar. Args: losses: Loss object
mrcnn/utils/progress_bar.py:14
↓ 2 callersFunctionpyramid_roi_align
Implements ROI Pooling on multiple levels of the feature pyramid. Params: - pool_size: [height, width] of the output pooled regions. Usually
mrcnn/models/components/align.py:12
↓ 2 callersFunctionrandom_colors
Generate random colors. To get visually distinct colors, generate them in HSV space then convert to RGB.
mrcnn/utils/visualize.py:60
↓ 2 callersFunctionremove_zero_area
(boxes, class_ids, masks, scores=None)
mrcnn/utils/utils.py:502
↓ 2 callersFunctionresize_image
Resizes an image keeping the aspect ratio unchanged. min_dim: if provided, resizes the image such that it's smaller dimension == min_dim
mrcnn/utils/utils.py:276
↓ 2 callersMethodselect
Apply same indexing to all tensors in container
mrcnn/structs/tensor_container.py:31
↓ 2 callersFunctionset_log_dir
Sets the model log directory and epoch counter. model_path: If None, or a format different from what this code uses then set a new log di
mrcnn/utils/model_utils.py:61
↓ 2 callersFunctionto_img_domain
(boxes, image_metas)
mrcnn/utils/utils.py:523
↓ 2 callersFunctionunmold_boxes_x
Reformats the detections of one image from the format of the neural network output to a format suitable for use in the rest of the application
mrcnn/utils/differentiable_map.py:6
↓ 1 callersMethod__init__
(self)
mrcnn/utils/exceptions.py:9
↓ 1 callersMethod__init__
(self, architecture, stage5=False)
mrcnn/models/components/resnet.py:49
↓ 1 callersFunction_apply_nms
(class_ids, class_probs, refined_rois, keep)
mrcnn/models/components/detection.py:38
↓ 1 callersMethod_build_config_tree
Convert a dictionary to class attributes in a tree-fashion. The root object is Config class. Note: Recursive function. Args:
tools/config.py:107
↓ 1 callersFunction_compute_factor2
(pred_box, gt_box)
mrcnn/functions/map_loss.py:176
↓ 1 callersFunction_compute_intersection
(pred_mask, gt_mask, pred_inter_idx, gt_inter_idx)
mrcnn/functions/map_loss.py:146
↓ 1 callersFunction_compute_iou
(gt_box, gt_mask, pred_box, pred_mask)
mrcnn/functions/map_loss.py:186
↓ 1 callersFunction_compute_ious
Compute Intersection over Union of ground truth and predicted masks. gt_masks and pred_masks must be in mini-mask format. Boxes indicate mask
mrcnn/functions/map_loss.py:219
↓ 1 callersFunction_compute_map
Compute mean average precision.
mrcnn/functions/map_loss.py:261
↓ 1 callersMethod_compute_means
(self, imgs)
samples/microscope_model.py:18
↓ 1 callersMethod_foreground_background_layer
(self, molded_images)
mrcnn/models/model.py:176
↓ 1 callersFunction_gen_grid
(mask, y1, x1, y2, x2)
mrcnn/functions/map_loss.py:127
↓ 1 callersMethod_get_generators
(self, train_dataset, val_dataset, augmentation)
mrcnn/models/model.py:280
↓ 1 callersFunction_get_gpu_mem_used
()
tools/gpu_mem_profiling.py:72
↓ 1 callersFunction_get_intersection_idx
Compute the intersections between box1 and box2 and return the indexes of the intersection box relative to both boxes. Note: Boxes co
mrcnn/functions/map_loss.py:90
↓ 1 callersFunction_get_printer
This function returns a printer function, that prints a message and then print a tensor. Used by register_hook in the backward pass.
tools/grad_debugging.py:9
↓ 1 callersFunction_handle_crowds
(proposals, gt_class_ids, gt_boxes, gt_masks)
mrcnn/models/components/detection_target.py:177
↓ 1 callersMethod_inference
(self, mrcnn_feature_maps, rpn_rois)
mrcnn/models/model.py:200
↓ 1 callersFunction_print_tensors
(file, where_str)
tools/gpu_mem_profiling.py:82
↓ 1 callersFunction_save_or_show_plot
(fig_name, train, val, save, log_dir)
mrcnn/utils/visualize.py:518
↓ 1 callersFunction_take_top_detections
For each ROI, takes TOP probs, ids and deltas.
mrcnn/models/components/detection.py:10
↓ 1 callersFunction_to_input_domain
(rois, probs, deltas)
mrcnn/models/components/detection.py:17
↓ 1 callersMethod_train_epoch
Trains a single epoch.
mrcnn/models/model.py:361
↓ 1 callersMethod_validation_epoch
Validation step. Usually called with torch.no_grad().
mrcnn/models/model.py:407
↓ 1 callersMethodadd_class
(self, source, class_id, class_name)
mrcnn/data/dataset_handler.py:35
↓ 1 callersMethodadd_image
(self, source, image_id, path, **kwargs)
mrcnn/data/dataset_handler.py:49
↓ 1 callersMethodbackward
(self, grad_outputs)
mrcnn/models/components/roialign/crop_and_resize_function.py:28
↓ 1 callersMethodboxes_stats
Stores min, max and avg box sides (for height and width)
mrcnn/actions/analyze.py:21
↓ 1 callersMethodbuild
Build Mask R-CNN architecture.
mrcnn/models/model.py:66
↓ 1 callersFunctionbuild_rpn_targets
Given the anchors and GT boxes, compute overlaps and identify positive anchors and deltas to refine them to match their corresponding GT boxes.
mrcnn/data/data_generator.py:92
↓ 1 callersFunctioncheck_config
All configuration checks must be placed here.
mrcnn/config/mrcnn_config.py:76
↓ 1 callersFunctionclip_boxes
boxes: [N, 4] each col is y1, x1, y2, x2 window: [4] in the form y1, x1, y2, x2
mrcnn/utils/utils.py:62
↓ 1 callersFunctioncompute_iou
Calculates IoU of the given box with the array of the given boxes. box: 1D vector [y1, x1, y2, x2] boxes: [boxes_count, (y1, x1, y2, x2)]
mrcnn/utils/utils.py:105
↓ 1 callersFunctioncompute_ious
Compute Intersection over Union of ground truth and predicted masks. Args: gt_masks (torch.IntTensor((img_height, img_width, nb_gt_masks)
mrcnn/functions/metrics.py:52
↓ 1 callersFunctioncompute_map
Compute mean average precision. Args: ious (torch.FloatTensor((nb_gt_masks, nb_pred_masks))): Intersection over Union. R
mrcnn/functions/metrics.py:93
↓ 1 callersFunctioncompute_map_metric
(gt_masks, pred_masks, gt_boxes, pred_boxes)
mrcnn/functions/metrics.py:10
↓ 1 callersFunctioncompute_mrcnn_bbox_loss
Loss for Mask R-CNN bounding box refinement. target_bbox: [batch, num_rois, (dy, dx, log(dh), log(dw))] target_class_ids: [batch, num_rois].
mrcnn/functions/losses.py:129
↓ 1 callersFunctioncompute_mrcnn_class_loss
Loss for the classifier head of Mask RCNN. target_class_ids: [batch, num_rois]. Integer class IDs. Uses zero padding to fill in the array
mrcnn/functions/losses.py:113
↓ 1 callersFunctioncompute_mrcnn_losses
(mrcnn_targets, mrcnn_outs)
mrcnn/functions/losses.py:197
↓ 1 callersFunctioncompute_mrcnn_mask_loss
Mask binary cross-entropy loss for the masks head. target_masks: [batch, num_rois, height, width]. A float32 tensor of values 0 or 1. Use
mrcnn/functions/losses.py:156
↓ 1 callersFunctioncompute_rpn_bbox_loss
Return the RPN bounding box loss graph. target_bbox: [batch, max positive anchors, (dy, dx, log(dh), log(dw))]. Uses 0 padding to fill in
mrcnn/functions/losses.py:79
↓ 1 callersFunctioncompute_rpn_class_loss
RPN anchor classifier loss. rpn_match: [batch, anchors, 1]. Anchor match type. 1=positive, -1=negative, 0=neutral anchor. rpn_
mrcnn/functions/losses.py:50
↓ 1 callersFunctioncompute_rpn_losses
(rpn_target, rpn_out)
mrcnn/functions/losses.py:185
↓ 1 callersMethoddetect
Runs the detection pipeline. images: Image Returns a list of dicts, one dict per image. The dict contains: rois: [N, (y1, x1
mrcnn/models/model.py:139
↓ 1 callersFunctiondetection_layer
Refine classified proposals and filter overlaps and return final detections. Inputs: rois: [N, (y1, x1, y2, x2)] in normalized coordi
mrcnn/models/components/detection.py:67
↓ 1 callersFunctiondetection_target_layer
Subsamples proposals and generates target box refinement, class_ids, and masks for each. Inputs: proposals: [batch, N, (y1, x1, y2, x2)]
mrcnn/models/components/detection_target.py:20
↓ 1 callersFunctiondisplay_images
Display the given set of images, optionally with titles. images: list or array of image tensors in HWC format. titles: optional. A list of tit
mrcnn/utils/visualize.py:36
↓ 1 callersFunctiondisplay_instances
boxes: [num_instance, (y1, x1, y2, x2, class_id)] in image coordinates. masks: [height, width, num_instances] class_ids: [num_instances]
mrcnn/utils/visualize.py:84
↓ 1 callersFunctiondisplay_table
Display values in a table format. table: an iterable of rows, and each row is an iterable of values.
mrcnn/utils/visualize.py:462
↓ 1 callersMethodfill_zeros
(self, fill_size)
mrcnn/structs/mrcnn_target.py:26
↓ 1 callersMethodfilter
Filter results according to stats.
mrcnn/actions/analyze.py:60
↓ 1 callersFunctionfind_last
Finds the last checkpoint file of the last trained model in the model directory. Returns: log_dir: The directory where events and weig
mrcnn/utils/model_utils.py:35
↓ 1 callersMethodfit
(self, imgs)
samples/microscope_model.py:13
↓ 1 callersMethodfreeze
Blocks the configuration so it cannot be modified. Used to prevent changes in the configuration during execution.
tools/config.py:82
↓ 1 callersFunctiongenerate_anchors
scale: 1D array of anchor sizes in pixels. Example: [32, 64, 128] ratios: 1D array of anchor ratios of width/height. Example: [0.5, 1, 2]
mrcnn/models/components/anchors.py:6
↓ 1 callersFunctiongenerate_pyramid_anchors
Generate anchors at different levels of a feature pyramid. Each scale is associated with a level of the pyramid, but each ratio is used in all
mrcnn/models/components/anchors.py:46
↓ 1 callersFunctionimage_resize_test
()
samples/image_resize_test.py:22
↓ 1 callersFunctioninit_profiler
(device, debug_function)
tools/gpu_mem_profiling.py:26
↓ 1 callersMethodinitialize_weights
Initialize model weights.
mrcnn/models/model.py:113
↓ 1 callersMethodload_default
Load configurations in config_fn as class attributes of this class. Args: config_fn: PATH to YAML file containing configu
tools/config.py:49
↓ 1 callersFunctionload_image_gt
Load and return ground truth data for an image (image, mask, bounding boxes). augment: If true, apply random image augmentation. Currently
mrcnn/data/data_generator.py:20
↓ 1 callersMethodload_nuclei
Load a subset of the nuclei dataset. dataset_dir: Root directory of the dataset subset: Subset to load. Either the name of the sub-di
samples/nucleus_dataset_handler.py:51
↓ 1 callersFunctionmask_to_rle
Encodes instance masks to submission format.
mrcnn/utils/rle.py:39
↓ 1 callersMethodmerge
Merge configuration present at config_fn into this class. Args: config_fn: YAML file containing configuration.
tools/config.py:60
↓ 1 callersFunctionmold_image
Takes RGB images with 0-255 values and subtraces the mean pixel and converts it to float. Expects image colors in RGB order.
mrcnn/utils/utils.py:175
↓ 1 callersFunctionnms_indexes
mrcnn/models/components/nms/nms_wrapper.cpp:41
↓ 1 callersFunctionnms_test
()
tests/nms_test.py:24
↓ 1 callersMethodprepare
Prepares the Dataset class for use. TODO: class map is not supported yet. When done, it should handle mapping classes from diff
mrcnn/data/dataset_handler.py:67
↓ 1 callersFunctionproposal_layer
Receives anchor scores and selects a subset to pass as proposals to the second stage. Filtering is done based on anchor scores and non-max sup
mrcnn/models/components/proposal.py:9
↓ 1 callersFunctionrle_encode
Encodes a mask in Run Length Encoding (RLE). Returns a string of space-separated values.
mrcnn/utils/rle.py:6
next →1–100 of 216, ranked by callers