Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Westlake-AGI-Lab/Distill-Any-Depth
/ functions
Functions
3,350 in github.com/Westlake-AGI-Lab/Distill-Any-Depth
⨍
Functions
3,350
◇
Types & classes
677
↳
Endpoints
2
↓ 189 callers
Method
to
(self, device: torch.device)
detectron2/detectron2/structures/boxes.py:168
↓ 152 callers
Method
get
Access an attribute and return its value if exists. Otherwise return default.
detectron2/detectron2/data/catalog.py:170
↓ 118 callers
Method
cat
Concatenates a list of Boxes into a single Boxes Arguments: boxes_list (list[Boxes]) Returns: Boxes
detectron2/detectron2/structures/boxes.py:279
↓ 77 callers
Method
get
(self, rank: int, record_id: int)
detectron2/projects/DensePose/densepose/evaluation/tensor_storage.py:180
↓ 75 callers
Method
has
(self, name)
detectron2/detectron2/export/c10.py:73
↓ 67 callers
Method
update
Args: predictions: D2 Instances for predictions of the current frame Return: D2 Instances for predictions of
detectron2/detectron2/tracking/base_tracker.py:32
↓ 62 callers
Method
flatten
(cls, obj)
detectron2/detectron2/export/flatten.py:37
↓ 59 callers
Function
get_norm
Args: norm (str or callable): either one of BN, SyncBN, FrozenBN, GN; or a callable that takes a channel number and returns
detectron2/detectron2/layers/batch_norm.py:169
↓ 59 callers
Function
instantiate
Recursively instantiate objects defined in dictionaries by "_target_" and arguments. Args: cfg: a dict-like object with "_target
detectron2/detectron2/config/instantiate.py:37
↓ 56 callers
Function
cat
Efficient version of torch.cat that avoids a copy if there is only a single element in a list
detectron2/detectron2/layers/wrappers.py:65
↓ 55 callers
Method
clone
Clone the Boxes. Returns: Boxes
detectron2/detectron2/structures/boxes.py:159
↓ 52 callers
Method
to
(self, device: torch.device)
detectron2/projects/DensePose/densepose/structures/mesh.py:81
↓ 48 callers
Method
device
(self)
detectron2/detectron2/structures/boxes.py:299
↓ 45 callers
Function
get_cfg
Get a copy of the default config. Returns: a detectron2 CfgNode instance.
detectron2/detectron2/config/config.py:99
↓ 45 callers
Method
write
(self)
detectron2/detectron2/utils/events.py:115
↓ 43 callers
Method
get
(self)
detectron2/demo/predictor.py:191
↓ 42 callers
Method
put_scalar
Add a scalar `value` to the `HistoryBuffer` associated with `name`. Args: smoothing_hint (bool): a 'hint' on whether thi
detectron2/detectron2/utils/events.py:356
↓ 40 callers
Method
load
Load a config file. Args: filename: absolute path or relative path w.r.t. the current working directory keys
detectron2/detectron2/config/lazy.py:197
↓ 37 callers
Method
norm
(c)
detectron2/detectron2/modeling/meta_arch/retinanet.py:350
↓ 35 callers
Method
save
Save a config object to a yaml file. Note that when the config dictionary contains complex objects (e.g. lambda), it can't be
detectron2/detectron2/config/lazy.py:252
↓ 29 callers
Method
set
Set multiple metadata with kwargs.
detectron2/detectron2/data/catalog.py:162
↓ 27 callers
Method
clip
Clip (in place) the boxes by limiting x coordinates to the range [0, width] and y coordinates to the range [0, height]. Args
detectron2/detectron2/structures/boxes.py:183
↓ 27 callers
Method
train
Args: start_iter, max_iter (int): See docs above
detectron2/detectron2/engine/train_loop.py:139
↓ 26 callers
Function
setup_logger
Initialize the detectron2 logger and set its verbosity level to "DEBUG". Args: output (str): a file name or a directory to save log.
detectron2/detectron2/utils/logger.py:43
↓ 25 callers
Method
step
User should either: (1) Call this function to increment storage.iter when needed. Or (2) Set `storage.iter` to the correct iteration
detectron2/detectron2/utils/events.py:498
↓ 24 callers
Function
get_event_storage
Returns: The :class:`EventStorage` object that's currently being used. Throws an error if no :class:`EventStorage` is currently e
detectron2/detectron2/utils/events.py:28
↓ 22 callers
Method
freeze
Make this block not trainable. This method sets all parameters to `requires_grad=False`, and convert all BatchNorm layers to
detectron2/detectron2/layers/blocks.py:43
↓ 22 callers
Method
resume_or_load
If `resume==True` and `cfg.OUTPUT_DIR` contains the last checkpoint (defined by a `last_checkpoint` file), resume from the file. Resu
detectron2/detectron2/engine/defaults.py:400
↓ 21 callers
Method
convert
Args: box: can be a k-tuple, k-list or an Nxk array/tensor, where k = 4 or 5 from_mode, to_mode (BoxMode) Re
detectron2/detectron2/structures/boxes.py:44
↓ 21 callers
Method
convert
Convert an instance to the destination type using some registered converter. Does recursive lookup for base classes, so there's no ne
detectron2/projects/DensePose/densepose/converters/base.py:66
↓ 21 callers
Method
get_image
Returns: ndarray: the visualized image of shape (H, W, 3) (RGB) in uint8 type. The shape is scale
detectron2/detectron2/utils/visualizer.py:310
↓ 21 callers
Function
to_device
This function is a replacement of .to(another_device) such that it allows the casting to be traced properly by explicitly calling the underly
detectron2/detectron2/export/shared.py:24
↓ 20 callers
Method
merge_from_file
Load content from the given config file and merge it into self. Args: cfg_filename: config filename allow_un
detectron2/detectron2/config/config.py:37
↓ 19 callers
Method
close
(self)
detectron2/detectron2/utils/events.py:137
↓ 19 callers
Function
func
(device, n=3)
detectron2/tests/layers/test_mask_ops.py:181
↓ 18 callers
Method
_initialize_extra_fields
If input instances don't have ID, ID_period, lost_frame_count fields, this method is used to initialize these fields. Args:
detectron2/detectron2/tracking/bbox_iou_tracker.py:151
↓ 18 callers
Method
from_tensors
Args: tensors: a tuple or list of `torch.Tensor`, each of shape (Hi, Wi) or (C_1, ..., C_K, Hi, Wi) where K >= 1.
detectron2/detectron2/structures/image_list.py:59
↓ 17 callers
Function
get_activation
(name)
distillanydepth/midas/backbones/utils.py:56
↓ 17 callers
Method
inference
Arguments: pred_logits, pred_deltas, pred_masks: Same as the output of: meth:`TensorMaskHead.forward`
detectron2/projects/TensorMask/tensormask/arch.py:633
↓ 17 callers
Method
output_shape
(self)
detectron2/detectron2/modeling/backbone/fpn.py:169
↓ 16 callers
Function
build_model
Build the whole model architecture, defined by ``cfg.MODEL.META_ARCHITECTURE``. Note that it does not load any weights from ``cfg``.
detectron2/detectron2/modeling/meta_arch/build.py:16
↓ 16 callers
Function
maybe_prepend_base_path
Prepends the provided path with a base path prefix if: 1) base path is not None; 2) path is a local path
detectron2/projects/DensePose/densepose/data/utils.py:16
↓ 16 callers
Function
patch_instances
A contextmanager, under which the Instances class in detectron2 is replaced by a statically-typed scriptable class, defined by `fields`.
detectron2/detectron2/export/torchscript_patch.py:51
↓ 15 callers
Function
alias
(x, name, is_backward=False)
detectron2/detectron2/export/shared.py:598
↓ 15 callers
Method
overlay_instances
Args: boxes (Boxes, RotatedBoxes or ndarray): either a :class:`Boxes`, or an Nx4 numpy array of XYXY_ABS format f
detectron2/detectron2/utils/visualizer.py:621
↓ 15 callers
Function
pairwise_iou_rotated
Return intersection-over-union (Jaccard index) of boxes. Both sets of boxes are expected to be in (x_center, y_center, width, height, an
detectron2/detectron2/layers/rotated_boxes.py:6
↓ 15 callers
Function
random_boxes
Create a random Nx4 boxes tensor, with coordinates < max_coord.
detectron2/detectron2/utils/testing.py:42
↓ 15 callers
Method
register
Args: name (str): the name that identifies a dataset, e.g. "coco_2014_train". func (callable): a callable which takes
detectron2/detectron2/data/catalog.py:29
↓ 15 callers
Method
register_sampler
Register sampler for a field Args: prediction_attr (str): field to replace with a sampled value gt_attr (Optiona
detectron2/projects/DensePose/densepose/data/samplers/prediction_to_gt.py:69
↓ 14 callers
Method
_init
(self, params=None)
detectron2/detectron2/data/transforms/augmentation.py:109
↓ 14 callers
Function
_make_scratch
(in_shape, out_shape, groups=1, expand=False)
distillanydepth/midas/blocks.py:133
↓ 14 callers
Function
default_setup
Perform some basic common setups at the beginning of a job, including: 1. Set up the detectron2 logger 2. Log basic information about en
detectron2/detectron2/engine/defaults.py:174
↓ 14 callers
Method
dump
Returns: str: a yaml string representation of the config
detectron2/detectron2/config/config.py:87
↓ 14 callers
Method
set
Set the field named `name` to `value`. The length of `value` must be the number of instances, and must agree with other exist
detectron2/detectron2/structures/instances.py:69
↓ 13 callers
Method
area
Computes the area of all the boxes. Returns: torch.Tensor: a vector with areas of each box.
detectron2/detectron2/structures/boxes.py:172
↓ 13 callers
Method
backward
(ctx, grad_output)
detectron2/detectron2/layers/deform_conv.py:85
↓ 13 callers
Function
check_set_pb_arg
(pb, arg_name, arg_attr, arg_value, allow_override=False)
detectron2/detectron2/export/shared.py:209
↓ 13 callers
Function
conv2d
Helper for building a conv2d layer.
detectron2/detectron2/modeling/backbone/regnet.py:28
↓ 13 callers
Function
default_argument_parser
Create a parser with some common arguments used by detectron2 users. Args: epilog (str): epilog passed to ArgumentParser describing
detectron2/detectron2/engine/defaults.py:82
↓ 13 callers
Method
load_state_dict
(self, state_dict)
detectron2/detectron2/engine/hooks.py:370
↓ 12 callers
Method
__init__
Args: shape: (h, w) tuple or a int interp: PIL interpolation method
detectron2/detectron2/data/transforms/augmentation_impl.py:117
↓ 12 callers
Function
build_detection_test_loader
Similar to `build_detection_train_loader`, with default batch size = 1, and sampler = :class:`InferenceSampler`. This sampler coordinates all
detectron2/detectron2/data/build.py:621
↓ 12 callers
Method
device
(self)
detectron2/projects/TensorMask/tensormask/arch.py:355
↓ 12 callers
Function
get_config
Returns a config object for a model in model zoo. Args: config_path (str): config file name relative to detectron2's "configs/"
detectron2/detectron2/model_zoo/model_zoo.py:147
↓ 12 callers
Function
launch
Launch multi-process or distributed training. This function must be called on all machines involved in the training. It will spawn child
detectron2/detectron2/engine/launch.py:27
↓ 12 callers
Method
register_hooks
Register hooks to the trainer. The hooks are executed in the order they are registered. Args: hooks (list[Option
detectron2/detectron2/engine/train_loop.py:121
↓ 12 callers
Method
remove
Alias of ``pop``.
detectron2/detectron2/data/catalog.py:69
↓ 12 callers
Function
ssf_ada
(x, scale, shift)
distillanydepth/modeling/backbones/vit/ViT_DINO_reg.py:38
↓ 11 callers
Method
__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
distillanydepth/modeling/backbones/vit/ViT_DINO.py:166
↓ 11 callers
Method
assertEqualsArrays
(self, a1, a2)
detectron2/tests/data/test_rotation_transform.py:9
↓ 11 callers
Function
build_backbone
Build a backbone from `cfg.MODEL.BACKBONE.NAME`. Returns: an instance of :class:`Backbone`
detectron2/detectron2/modeling/backbone/build.py:20
↓ 11 callers
Method
interp2d
Bilinear interpolation method to be used for upscaling Args: tensor_nchw (tensor): tensor of shape (N, C, H, W)
detectron2/projects/DensePose/densepose/modeling/predictors/chart.py:68
↓ 11 callers
Function
point_sample
A wrapper around :function:`torch.nn.functional.grid_sample` to support 3D point_coords tensors. Unlike :function:`torch.nn.functional.grid_s
detectron2/projects/PointRend/point_rend/point_features.py:19
↓ 10 callers
Method
__init__
(self, w_in, w_se, activation_class)
detectron2/detectron2/modeling/backbone/regnet.py:94
↓ 10 callers
Method
__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
distillanydepth/modeling/backbones/vit/ViT_DINO_reg.py:257
↓ 10 callers
Method
build_model
Returns: torch.nn.Module: It now calls :func:`detectron2.modeling.build_model`. Overwrite it if you'd like a dif
detectron2/detectron2/engine/defaults.py:510
↓ 10 callers
Method
extract_at_points
Extract ground truth values z_gt for valid point indices and estimated values z_est using bilinear interpolation over top-left (y_lo,
detectron2/projects/DensePose/densepose/modeling/losses/utils.py:160
↓ 10 callers
Function
get_pb_arg
(pb, arg_name)
detectron2/detectron2/export/shared.py:172
↓ 10 callers
Method
history
Returns: HistoryBuffer: the scalar history for name
detectron2/detectron2/utils/events.py:427
↓ 10 callers
Function
init_ssf_scale_shift
(dim)
distillanydepth/modeling/backbones/vit/ViT_DINO_reg.py:29
↓ 10 callers
Method
load
Args: io: (str or binary file-like object): input file to load data from Returns: An instance of `DensePoseTr
detectron2/projects/DensePose/densepose/structures/transform_data.py:54
↓ 10 callers
Method
load
Load model from file. Args: path (str): file path
distillanydepth/midas/base_model.py:6
↓ 9 callers
Method
_data_loader
(self, device)
detectron2/tests/test_engine.py:40
↓ 9 callers
Method
apply_deltas
Apply transformation `deltas` (dx, dy, dw, dh) to `boxes`. Args: deltas (Tensor): transformation deltas of shape (N, k*4
detectron2/detectron2/modeling/box_regression.py:78
↓ 9 callers
Function
batched_nms
Same as torchvision.ops.boxes.batched_nms, but with float().
detectron2/detectron2/layers/nms.py:11
↓ 9 callers
Function
detector_postprocess
Resize the output instances. The input images are often resized when entering an object detector. As a result, we often need the outputs
detectron2/detectron2/modeling/postprocessing.py:9
↓ 9 callers
Method
draw_dataset_dict
Draw annotations/segmentations in Detectron2 Dataset format. Args: dic (dict): annotation/segmentation data of one image
detectron2/detectron2/utils/visualizer.py:550
↓ 9 callers
Method
draw_instance_predictions
Draw instance-level prediction results on an image. Args: predictions (Instances): the output of an instance detection/s
detectron2/detectron2/utils/visualizer.py:387
↓ 9 callers
Method
get_fields
like `get_fields` in the Instances object, but return each field in tensor representations
detectron2/detectron2/export/c10.py:59
↓ 9 callers
Function
get_world_size
()
detectron2/detectron2/utils/comm.py:21
↓ 9 callers
Function
move_device_like
Tracing friendly way to cast tensor to another tensor's device. Device will be treated as constant during tracing, scripting the casting proc
detectron2/detectron2/layers/wrappers.py:172
↓ 9 callers
Function
pairwise_iou
Given two lists of boxes of size N and M, compute the IoU (intersection over union) between **all** N x M pairs of boxes. The box order m
detectron2/detectron2/structures/boxes.py:336
↓ 8 callers
Method
__setattr__
(self, name, value)
distillanydepth/utils/mmcv_config.py:626
↓ 8 callers
Function
_rename
(cfg: CN, old: str, new: str)
detectron2/detectron2/config/compat.py:116
↓ 8 callers
Method
apply_image
(self, img)
detectron2/detectron2/data/transforms/transform.py:269
↓ 8 callers
Function
assert_instances_allclose
Args: input, other (Instances): size_as_tensor: compare image_size of the Instances as tensors (instead of tuples).
detectron2/detectron2/utils/testing.py:95
↓ 8 callers
Function
build_detection_train_loader
Build a dataloader for object detection with some default features. Args: dataset (list or torch.utils.data.Dataset): a list of data
detectron2/detectron2/data/build.py:521
↓ 8 callers
Function
get_fed_loss_cls_weights
Get frequency weight for each class sorted by class id. We now calcualte freqency weight using image_count to the power freq_weight_power.
detectron2/detectron2/data/detection_utils.py:549
↓ 8 callers
Method
load
(self, path, *args, **kwargs)
detectron2/detectron2/checkpoint/detection_checkpoint.py:34
↓ 8 callers
Method
nonempty
Find boxes that are non-empty. A box is considered empty, if either of its side is no larger than threshold. Returns:
detectron2/detectron2/structures/boxes.py:199
next →
1–100 of 3,350, ranked by callers