SYMBOL INDEX (4547 symbols across 475 files) FILE: app/__init__.py function load_demo_image (line 16) | def load_demo_image(): FILE: app/calculate_coco_features.py function load_demo_image (line 22) | def load_demo_image(): function read_img (line 31) | def read_img(filepath): FILE: app/caption.py function app (line 15) | def app(): function generate_caption (line 72) | def generate_caption( FILE: app/classification.py function load_demo_image (line 23) | def load_demo_image(img_url=None): function load_model_cache (line 38) | def load_model_cache(model_type, device): function app (line 63) | def app(): FILE: app/dataset_browser.py function sample_dataset (line 26) | def sample_dataset(dataset, indices): function get_concat_v (line 32) | def get_concat_v(im1, im2): function resize_img_w (line 43) | def resize_img_w(raw_img, new_w=224): function get_visual_key (line 58) | def get_visual_key(dataset): function gather_items (line 69) | def gather_items(samples, exclude=[]): function load_dataset_cache (line 84) | def load_dataset_cache(name): function format_text (line 88) | def format_text(text): function show_samples (line 94) | def show_samples(dataset, offset=0, is_next=False): FILE: app/image_text_match.py function app (line 19) | def app(): FILE: app/multimodal_search.py function load_feat (line 34) | def load_feat(): function load_feature_extractor_model (line 61) | def load_feature_extractor_model(device): function app (line 72) | def app(): function read_and_process_images (line 183) | def read_and_process_images(image_paths, vis_processor): function compute_gradcam_batch (line 191) | def compute_gradcam_batch(model, visual_input, text_input, tokenized_tex... FILE: app/multipage.py class MultiPage (line 17) | class MultiPage: method __init__ (line 20) | def __init__(self) -> None: method add_page (line 24) | def add_page(self, title, func) -> None: method run (line 34) | def run(self): FILE: app/text_localization.py function app (line 20) | def app(): FILE: app/utils.py function resize_img (line 18) | def resize_img(raw_img): function read_img (line 25) | def read_img(filepath): function load_model_cache (line 39) | def load_model_cache(name, model_type, is_eval, device): function init_bert_tokenizer (line 44) | def init_bert_tokenizer(): function getAttMap (line 49) | def getAttMap(img, attMap, blur=True, overlap=True): function load_blip_itm_model (line 77) | def load_blip_itm_model(device, model_type="base"): FILE: app/vqa.py function app (line 15) | def app(): FILE: evaluate.py function parse_args (line 33) | def parse_args(): function setup_seeds (line 52) | def setup_seeds(config): function main (line 63) | def main(): FILE: lavis/common/annotator/canny/__init__.py class CannyDetector (line 4) | class CannyDetector: method __call__ (line 5) | def __call__(self, img, low_threshold, high_threshold): FILE: lavis/common/annotator/hed/__init__.py class Network (line 9) | class Network(torch.nn.Module): method __init__ (line 10) | def __init__(self, model_path): method forward (line 71) | def forward(self, tenInput): class HEDdetector (line 96) | class HEDdetector: method __init__ (line 97) | def __init__(self): method __call__ (line 105) | def __call__(self, input_image): function nms (line 117) | def nms(x, t, s): FILE: lavis/common/annotator/midas/__init__.py class MidasDetector (line 9) | class MidasDetector: method __init__ (line 10) | def __init__(self): method __call__ (line 13) | def __call__(self, input_image, a=np.pi * 2.0, bg_th=0.1): FILE: lavis/common/annotator/midas/api.py function disabled_train (line 26) | def disabled_train(self, mode=True): function load_midas_transform (line 32) | def load_midas_transform(model_type): function load_model (line 77) | def load_model(model_type): class MiDaSInference (line 145) | class MiDaSInference(nn.Module): method __init__ (line 158) | def __init__(self, model_type): method forward (line 165) | def forward(self, x): FILE: lavis/common/annotator/midas/midas/base_model.py class BaseModel (line 4) | class BaseModel(torch.nn.Module): method load (line 5) | def load(self, path): FILE: lavis/common/annotator/midas/midas/blocks.py function _make_encoder (line 11) | def _make_encoder(backbone, features, use_pretrained, groups=1, expand=F... function _make_scratch (line 49) | def _make_scratch(in_shape, out_shape, groups=1, expand=False): function _make_pretrained_efficientnet_lite3 (line 78) | def _make_pretrained_efficientnet_lite3(use_pretrained, exportable=False): function _make_efficientnet_backbone (line 88) | def _make_efficientnet_backbone(effnet): function _make_resnet_backbone (line 101) | def _make_resnet_backbone(resnet): function _make_pretrained_resnext101_wsl (line 114) | def _make_pretrained_resnext101_wsl(use_pretrained): class Interpolate (line 120) | class Interpolate(nn.Module): method __init__ (line 124) | def __init__(self, scale_factor, mode, align_corners=False): method forward (line 138) | def forward(self, x): class ResidualConvUnit (line 155) | class ResidualConvUnit(nn.Module): method __init__ (line 159) | def __init__(self, features): method forward (line 177) | def forward(self, x): class FeatureFusionBlock (line 194) | class FeatureFusionBlock(nn.Module): method __init__ (line 198) | def __init__(self, features): method forward (line 209) | def forward(self, *xs): class ResidualConvUnit_custom (line 231) | class ResidualConvUnit_custom(nn.Module): method __init__ (line 235) | def __init__(self, features, activation, bn): method forward (line 263) | def forward(self, x): class FeatureFusionBlock_custom (line 291) | class FeatureFusionBlock_custom(nn.Module): method __init__ (line 295) | def __init__(self, features, activation, deconv=False, bn=False, expan... method forward (line 320) | def forward(self, *xs): FILE: lavis/common/annotator/midas/midas/dpt_depth.py function _make_fusion_block (line 15) | def _make_fusion_block(features, use_bn): class DPT (line 26) | class DPT(BaseModel): method __init__ (line 27) | def __init__( method forward (line 67) | def forward(self, x): class DPTDepthModel (line 88) | class DPTDepthModel(DPT): method __init__ (line 89) | def __init__(self, path=None, non_negative=True, **kwargs): method forward (line 107) | def forward(self, x): FILE: lavis/common/annotator/midas/midas/midas_net.py class MidasNet (line 12) | class MidasNet(BaseModel): method __init__ (line 16) | def __init__(self, path=None, features=256, non_negative=True): method forward (line 49) | def forward(self, x): FILE: lavis/common/annotator/midas/midas/midas_net_custom.py class MidasNet_small (line 12) | class MidasNet_small(BaseModel): method __init__ (line 16) | def __init__(self, path=None, features=64, backbone="efficientnet_lite... method forward (line 73) | def forward(self, x): function fuse_model (line 109) | def fuse_model(m): FILE: lavis/common/annotator/midas/midas/transforms.py function apply_min_size (line 6) | def apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AR... class Resize (line 48) | class Resize(object): method __init__ (line 52) | def __init__( method constrain_to_multiple_of (line 94) | def constrain_to_multiple_of(self, x, min_val=0, max_val=None): method get_size (line 105) | def get_size(self, width, height): method __call__ (line 162) | def __call__(self, sample): class NormalizeImage (line 197) | class NormalizeImage(object): method __init__ (line 201) | def __init__(self, mean, std): method __call__ (line 205) | def __call__(self, sample): class PrepareForNet (line 211) | class PrepareForNet(object): method __init__ (line 215) | def __init__(self): method __call__ (line 218) | def __call__(self, sample): FILE: lavis/common/annotator/midas/midas/vit.py class Slice (line 9) | class Slice(nn.Module): method __init__ (line 10) | def __init__(self, start_index=1): method forward (line 14) | def forward(self, x): class AddReadout (line 18) | class AddReadout(nn.Module): method __init__ (line 19) | def __init__(self, start_index=1): method forward (line 23) | def forward(self, x): class ProjectReadout (line 31) | class ProjectReadout(nn.Module): method __init__ (line 32) | def __init__(self, in_features, start_index=1): method forward (line 38) | def forward(self, x): class Transpose (line 45) | class Transpose(nn.Module): method __init__ (line 46) | def __init__(self, dim0, dim1): method forward (line 51) | def forward(self, x): function forward_vit (line 56) | def forward_vit(pretrained, x): function _resize_pos_embed (line 100) | def _resize_pos_embed(self, posemb, gs_h, gs_w): function forward_flex (line 117) | def forward_flex(self, x): function get_activation (line 159) | def get_activation(name): function get_readout_oper (line 166) | def get_readout_oper(vit_features, features, use_readout, start_index=1): function _make_vit_b16_backbone (line 183) | def _make_vit_b16_backbone( function _make_pretrained_vitl16_384 (line 297) | def _make_pretrained_vitl16_384(pretrained, use_readout="ignore", hooks=... function _make_pretrained_vitb16_384 (line 310) | def _make_pretrained_vitb16_384(pretrained, use_readout="ignore", hooks=... function _make_pretrained_deitb16_384 (line 319) | def _make_pretrained_deitb16_384(pretrained, use_readout="ignore", hooks... function _make_pretrained_deitb16_distil_384 (line 328) | def _make_pretrained_deitb16_distil_384(pretrained, use_readout="ignore"... function _make_vit_b_rn50_backbone (line 343) | def _make_vit_b_rn50_backbone( function _make_pretrained_vitb_rn50_384 (line 478) | def _make_pretrained_vitb_rn50_384( FILE: lavis/common/annotator/midas/utils.py function read_pfm (line 9) | def read_pfm(path): function write_pfm (line 58) | def write_pfm(path, image, scale=1): function read_image (line 97) | def read_image(path): function resize_image (line 116) | def resize_image(img): function resize_depth (line 146) | def resize_depth(depth, width, height): function write_depth (line 165) | def write_depth(path, depth, bits=1): FILE: lavis/common/annotator/mlsd/__init__.py class MLSDdetector (line 17) | class MLSDdetector: method __init__ (line 18) | def __init__(self): method __call__ (line 27) | def __call__(self, input_image, thr_v, thr_d): FILE: lavis/common/annotator/mlsd/models/mbv2_mlsd_large.py class BlockTypeA (line 9) | class BlockTypeA(nn.Module): method __init__ (line 10) | def __init__(self, in_c1, in_c2, out_c1, out_c2, upscale = True): method forward (line 24) | def forward(self, a, b): class BlockTypeB (line 32) | class BlockTypeB(nn.Module): method __init__ (line 33) | def __init__(self, in_c, out_c): method forward (line 46) | def forward(self, x): class BlockTypeC (line 51) | class BlockTypeC(nn.Module): method __init__ (line 52) | def __init__(self, in_c, out_c): method forward (line 66) | def forward(self, x): function _make_divisible (line 72) | def _make_divisible(v, divisor, min_value=None): class ConvBNReLU (line 92) | class ConvBNReLU(nn.Sequential): method __init__ (line 93) | def __init__(self, in_planes, out_planes, kernel_size=3, stride=1, gro... method forward (line 112) | def forward(self, x): class InvertedResidual (line 124) | class InvertedResidual(nn.Module): method __init__ (line 125) | def __init__(self, inp, oup, stride, expand_ratio): method forward (line 146) | def forward(self, x): class MobileNetV2 (line 153) | class MobileNetV2(nn.Module): method __init__ (line 154) | def __init__(self, pretrained=True): method _forward_impl (line 218) | def _forward_impl(self, x): method forward (line 233) | def forward(self, x): method _load_pretrained_model (line 236) | def _load_pretrained_model(self): class MobileV2_MLSD_Large (line 247) | class MobileV2_MLSD_Large(nn.Module): method __init__ (line 248) | def __init__(self): method forward (line 275) | def forward(self, x): FILE: lavis/common/annotator/mlsd/models/mbv2_mlsd_tiny.py class BlockTypeA (line 9) | class BlockTypeA(nn.Module): method __init__ (line 10) | def __init__(self, in_c1, in_c2, out_c1, out_c2, upscale = True): method forward (line 24) | def forward(self, a, b): class BlockTypeB (line 31) | class BlockTypeB(nn.Module): method __init__ (line 32) | def __init__(self, in_c, out_c): method forward (line 45) | def forward(self, x): class BlockTypeC (line 50) | class BlockTypeC(nn.Module): method __init__ (line 51) | def __init__(self, in_c, out_c): method forward (line 65) | def forward(self, x): function _make_divisible (line 71) | def _make_divisible(v, divisor, min_value=None): class ConvBNReLU (line 91) | class ConvBNReLU(nn.Sequential): method __init__ (line 92) | def __init__(self, in_planes, out_planes, kernel_size=3, stride=1, gro... method forward (line 111) | def forward(self, x): class InvertedResidual (line 123) | class InvertedResidual(nn.Module): method __init__ (line 124) | def __init__(self, inp, oup, stride, expand_ratio): method forward (line 145) | def forward(self, x): class MobileNetV2 (line 152) | class MobileNetV2(nn.Module): method __init__ (line 153) | def __init__(self, pretrained=True): method _forward_impl (line 218) | def _forward_impl(self, x): method forward (line 233) | def forward(self, x): method _load_pretrained_model (line 236) | def _load_pretrained_model(self): class MobileV2_MLSD_Tiny (line 247) | class MobileV2_MLSD_Tiny(nn.Module): method __init__ (line 248) | def __init__(self): method forward (line 263) | def forward(self, x): FILE: lavis/common/annotator/mlsd/utils.py function deccode_output_score_and_ptss (line 19) | def deccode_output_score_and_ptss(tpMap, topk_n = 200, ksize = 5): function pred_lines (line 47) | def pred_lines(image, model, function pred_squares (line 89) | def pred_squares(image, FILE: lavis/common/annotator/openpose/__init__.py class OpenposeDetector (line 16) | class OpenposeDetector: method __init__ (line 17) | def __init__(self): method __call__ (line 29) | def __call__(self, oriImg, hand=False): FILE: lavis/common/annotator/openpose/body.py class Body (line 14) | class Body(object): method __init__ (line 15) | def __init__(self, model_path): method __call__ (line 24) | def __call__(self, oriImg): FILE: lavis/common/annotator/openpose/hand.py class Hand (line 15) | class Hand(object): method __init__ (line 16) | def __init__(self, model_path): method __call__ (line 25) | def __call__(self, oriImg): FILE: lavis/common/annotator/openpose/model.py function make_layers (line 7) | def make_layers(block, no_relu_layers): class bodypose_model (line 24) | class bodypose_model(nn.Module): method __init__ (line 25) | def __init__(self): method forward (line 114) | def forward(self, x): class handpose_model (line 143) | class handpose_model(nn.Module): method __init__ (line 144) | def __init__(self): method forward (line 204) | def forward(self, x): FILE: lavis/common/annotator/openpose/util.py function padRightDownCorner (line 7) | def padRightDownCorner(img, stride, padValue): function transfer (line 30) | def transfer(model, model_weights): function draw_bodypose (line 37) | def draw_bodypose(canvas, candidate, subset): function draw_handpose (line 74) | def draw_handpose(canvas, all_hand_peaks, show_number=False): function handDetect (line 94) | def handDetect(candidate, subset, oriImg): function npmax (line 159) | def npmax(array): FILE: lavis/common/annotator/uniformer/__init__.py class UniformerDetector (line 11) | class UniformerDetector: method __init__ (line 12) | def __init__(self): method __call__ (line 20) | def __call__(self, img): FILE: lavis/common/annotator/uniformer/mmcv/arraymisc/quantization.py function quantize (line 5) | def quantize(arr, min_val, max_val, levels, dtype=np.int64): function dequantize (line 32) | def dequantize(arr, min_val, max_val, levels, dtype=np.float64): FILE: lavis/common/annotator/uniformer/mmcv/cnn/alexnet.py class AlexNet (line 7) | class AlexNet(nn.Module): method __init__ (line 14) | def __init__(self, num_classes=-1): method init_weights (line 43) | def init_weights(self, pretrained=None): method forward (line 54) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/activation.py class Clamp (line 18) | class Clamp(nn.Module): method __init__ (line 31) | def __init__(self, min=-1., max=1.): method forward (line 36) | def forward(self, x): class GELU (line 48) | class GELU(nn.Module): method forward (line 70) | def forward(self, input): function build_activation_layer (line 81) | def build_activation_layer(cfg): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/context_block.py function last_zero_init (line 9) | def last_zero_init(m): class ContextBlock (line 17) | class ContextBlock(nn.Module): method __init__ (line 36) | def __init__(self, method reset_parameters (line 75) | def reset_parameters(self): method spatial_pool (line 85) | def spatial_pool(self, x): method forward (line 111) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/conv.py function build_conv_layer (line 12) | def build_conv_layer(cfg, *args, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/conv2d_adaptive_padding.py class Conv2dAdaptivePadding (line 11) | class Conv2dAdaptivePadding(nn.Conv2d): method __init__ (line 33) | def __init__(self, method forward (line 45) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/conv_module.py class ConvModule (line 16) | class ConvModule(nn.Module): method __init__ (line 70) | def __init__(self, method norm (line 169) | def norm(self): method init_weights (line 175) | def init_weights(self): method forward (line 196) | def forward(self, x, activate=True, norm=True): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/conv_ws.py function conv_ws_2d (line 9) | def conv_ws_2d(input, class ConvWS2d (line 26) | class ConvWS2d(nn.Conv2d): method __init__ (line 28) | def __init__(self, method forward (line 49) | def forward(self, x): class ConvAWS2d (line 55) | class ConvAWS2d(nn.Conv2d): method __init__ (line 78) | def __init__(self, method _get_weight (line 101) | def _get_weight(self, weight): method forward (line 109) | def forward(self, x): method _load_from_state_dict (line 114) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/depthwise_separable_conv_module.py class DepthwiseSeparableConvModule (line 7) | class DepthwiseSeparableConvModule(nn.Module): method __init__ (line 48) | def __init__(self, method forward (line 93) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/drop.py function drop_path (line 9) | def drop_path(x, drop_prob=0., training=False): class DropPath (line 28) | class DropPath(nn.Module): method __init__ (line 39) | def __init__(self, drop_prob=0.1): method forward (line 43) | def forward(self, x): class Dropout (line 48) | class Dropout(nn.Dropout): method __init__ (line 59) | def __init__(self, drop_prob=0.5, inplace=False): function build_dropout (line 63) | def build_dropout(cfg, default_args=None): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/generalized_attention.py class GeneralizedAttention (line 14) | class GeneralizedAttention(nn.Module): method __init__ (line 47) | def __init__(self, method get_position_embedding (line 166) | def get_position_embedding(self, method forward (line 216) | def forward(self, x_input): method init_weights (line 403) | def init_weights(self): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/hsigmoid.py class HSigmoid (line 8) | class HSigmoid(nn.Module): method __init__ (line 23) | def __init__(self, bias=1.0, divisor=2.0, min_value=0.0, max_value=1.0): method forward (line 31) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/hswish.py class HSwish (line 8) | class HSwish(nn.Module): method __init__ (line 24) | def __init__(self, inplace=False): method forward (line 28) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/non_local.py class _NonLocalNd (line 12) | class _NonLocalNd(nn.Module, metaclass=ABCMeta): method __init__ (line 35) | def __init__(self, method init_weights (line 99) | def init_weights(self, std=0.01, zeros_init=True): method gaussian (line 116) | def gaussian(self, theta_x, phi_x): method embedded_gaussian (line 124) | def embedded_gaussian(self, theta_x, phi_x): method dot_product (line 135) | def dot_product(self, theta_x, phi_x): method concatenation (line 143) | def concatenation(self, theta_x, phi_x): method forward (line 160) | def forward(self, x): class NonLocal1d (line 214) | class NonLocal1d(_NonLocalNd): method __init__ (line 226) | def __init__(self, class NonLocal2d (line 246) | class NonLocal2d(_NonLocalNd): method __init__ (line 260) | def __init__(self, class NonLocal3d (line 279) | class NonLocal3d(_NonLocalNd): method __init__ (line 291) | def __init__(self, FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/norm.py function infer_abbr (line 23) | def infer_abbr(class_type): function build_norm_layer (line 72) | def build_norm_layer(cfg, num_features, postfix=''): function is_norm (line 122) | def is_norm(layer, exclude=None): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/padding.py function build_padding_layer (line 11) | def build_padding_layer(cfg, *args, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/plugin.py function infer_abbr (line 12) | def infer_abbr(class_type): function build_plugin_layer (line 55) | def build_plugin_layer(cfg, postfix='', **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/scale.py class Scale (line 6) | class Scale(nn.Module): method __init__ (line 16) | def __init__(self, scale=1.0): method forward (line 20) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/swish.py class Swish (line 9) | class Swish(nn.Module): method __init__ (line 21) | def __init__(self): method forward (line 24) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/transformer.py function build_positional_encoding (line 33) | def build_positional_encoding(cfg, default_args=None): function build_attention (line 38) | def build_attention(cfg, default_args=None): function build_feedforward_network (line 43) | def build_feedforward_network(cfg, default_args=None): function build_transformer_layer (line 48) | def build_transformer_layer(cfg, default_args=None): function build_transformer_layer_sequence (line 53) | def build_transformer_layer_sequence(cfg, default_args=None): class MultiheadAttention (line 59) | class MultiheadAttention(BaseModule): method __init__ (line 81) | def __init__(self, method forward (line 112) | def forward(self, class FFN (line 206) | class FFN(BaseModule): method __init__ (line 234) | def __init__(self, method forward (line 269) | def forward(self, x, identity=None): class BaseTransformerLayer (line 283) | class BaseTransformerLayer(BaseModule): method __init__ (line 319) | def __init__(self, method forward (line 412) | def forward(self, class TransformerLayerSequence (line 514) | class TransformerLayerSequence(BaseModule): method __init__ (line 533) | def __init__(self, transformerlayers=None, num_layers=None, init_cfg=N... method forward (line 549) | def forward(self, FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/upsample.py class PixelShufflePack (line 13) | class PixelShufflePack(nn.Module): method __init__ (line 27) | def __init__(self, in_channels, out_channels, scale_factor, method init_weights (line 41) | def init_weights(self): method forward (line 44) | def forward(self, x): function build_upsample_layer (line 50) | def build_upsample_layer(cfg, *args, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/cnn/bricks/wrappers.py function obsolete_torch_version (line 24) | def obsolete_torch_version(torch_version, version_threshold): class NewEmptyTensorOp (line 28) | class NewEmptyTensorOp(torch.autograd.Function): method forward (line 31) | def forward(ctx, x, new_shape): method backward (line 36) | def backward(ctx, grad): class Conv2d (line 42) | class Conv2d(nn.Conv2d): method forward (line 44) | def forward(self, x): class Conv3d (line 63) | class Conv3d(nn.Conv3d): method forward (line 65) | def forward(self, x): class ConvTranspose2d (line 86) | class ConvTranspose2d(nn.ConvTranspose2d): method forward (line 88) | def forward(self, x): class ConvTranspose3d (line 109) | class ConvTranspose3d(nn.ConvTranspose3d): method forward (line 111) | def forward(self, x): class MaxPool2d (line 129) | class MaxPool2d(nn.MaxPool2d): method forward (line 131) | def forward(self, x): class MaxPool3d (line 147) | class MaxPool3d(nn.MaxPool3d): method forward (line 149) | def forward(self, x): class Linear (line 166) | class Linear(torch.nn.Linear): method forward (line 168) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/cnn/builder.py function build_model_from_cfg (line 6) | def build_model_from_cfg(cfg, registry, default_args=None): FILE: lavis/common/annotator/uniformer/mmcv/cnn/resnet.py function conv3x3 (line 10) | def conv3x3(in_planes, out_planes, stride=1, dilation=1): class BasicBlock (line 22) | class BasicBlock(nn.Module): method __init__ (line 25) | def __init__(self, method forward (line 45) | def forward(self, x): class Bottleneck (line 64) | class Bottleneck(nn.Module): method __init__ (line 67) | def __init__(self, method forward (line 110) | def forward(self, x): function make_res_layer (line 143) | def make_res_layer(block, class ResNet (line 181) | class ResNet(nn.Module): method __init__ (line 210) | def __init__(self, method init_weights (line 265) | def init_weights(self, pretrained=None): method forward (line 279) | def forward(self, x): method train (line 295) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmcv/cnn/utils/flops_counter.py function get_model_complexity_info (line 36) | def get_model_complexity_info(model, function flops_to_string (line 118) | def flops_to_string(flops, units='GFLOPs', precision=2): function params_to_string (line 161) | def params_to_string(num_params, units=None, precision=2): function print_model_with_flops (line 198) | def print_model_with_flops(model, function get_model_parameters_number (line 307) | def get_model_parameters_number(model): function add_flops_counting_methods (line 320) | def add_flops_counting_methods(net_main_module): function compute_average_flops_cost (line 337) | def compute_average_flops_cost(self): function start_flops_count (line 355) | def start_flops_count(self): function stop_flops_count (line 378) | def stop_flops_count(self): function reset_flops_count (line 389) | def reset_flops_count(self): function empty_flops_counter_hook (line 400) | def empty_flops_counter_hook(module, input, output): function upsample_flops_counter_hook (line 404) | def upsample_flops_counter_hook(module, input, output): function relu_flops_counter_hook (line 413) | def relu_flops_counter_hook(module, input, output): function linear_flops_counter_hook (line 418) | def linear_flops_counter_hook(module, input, output): function pool_flops_counter_hook (line 425) | def pool_flops_counter_hook(module, input, output): function norm_flops_counter_hook (line 430) | def norm_flops_counter_hook(module, input, output): function deconv_flops_counter_hook (line 440) | def deconv_flops_counter_hook(conv_module, input, output): function conv_flops_counter_hook (line 467) | def conv_flops_counter_hook(conv_module, input, output): function batch_counter_hook (line 498) | def batch_counter_hook(module, input, output): function add_batch_counter_variables_or_reset (line 511) | def add_batch_counter_variables_or_reset(module): function add_batch_counter_hook_function (line 516) | def add_batch_counter_hook_function(module): function remove_batch_counter_hook_function (line 524) | def remove_batch_counter_hook_function(module): function add_flops_counter_variable_or_reset (line 530) | def add_flops_counter_variable_or_reset(module): function is_supported_instance (line 540) | def is_supported_instance(module): function remove_flops_counter_hook_function (line 546) | def remove_flops_counter_hook_function(module): function get_modules_mapping (line 553) | def get_modules_mapping(): FILE: lavis/common/annotator/uniformer/mmcv/cnn/utils/fuse_conv_bn.py function _fuse_conv_bn (line 6) | def _fuse_conv_bn(conv, bn): function fuse_conv_bn (line 27) | def fuse_conv_bn(module): FILE: lavis/common/annotator/uniformer/mmcv/cnn/utils/sync_bn.py class _BatchNormXd (line 6) | class _BatchNormXd(torch.nn.modules.batchnorm._BatchNorm): method _check_input_dim (line 17) | def _check_input_dim(self, input): function revert_sync_batchnorm (line 21) | def revert_sync_batchnorm(module): FILE: lavis/common/annotator/uniformer/mmcv/cnn/utils/weight_init.py function update_init_info (line 16) | def update_init_info(module, init_info): function constant_init (line 48) | def constant_init(module, val, bias=0): function xavier_init (line 55) | def xavier_init(module, gain=1, bias=0, distribution='normal'): function normal_init (line 66) | def normal_init(module, mean=0, std=1, bias=0): function trunc_normal_init (line 73) | def trunc_normal_init(module: nn.Module, function uniform_init (line 85) | def uniform_init(module, a=0, b=1, bias=0): function kaiming_init (line 92) | def kaiming_init(module, function caffe2_xavier_init (line 110) | def caffe2_xavier_init(module, bias=0): function bias_init_with_prob (line 122) | def bias_init_with_prob(prior_prob): function _get_bases_name (line 128) | def _get_bases_name(m): class BaseInit (line 132) | class BaseInit(object): method __init__ (line 134) | def __init__(self, *, bias=0, bias_prob=None, layer=None): method _get_init_info (line 157) | def _get_init_info(self): class ConstantInit (line 163) | class ConstantInit(BaseInit): method __init__ (line 175) | def __init__(self, val, **kwargs): method __call__ (line 179) | def __call__(self, module): method _get_init_info (line 194) | def _get_init_info(self): class XavierInit (line 200) | class XavierInit(BaseInit): method __init__ (line 217) | def __init__(self, gain=1, distribution='normal', **kwargs): method __call__ (line 222) | def __call__(self, module): method _get_init_info (line 237) | def _get_init_info(self): class NormalInit (line 244) | class NormalInit(BaseInit): method __init__ (line 260) | def __init__(self, mean=0, std=1, **kwargs): method __call__ (line 265) | def __call__(self, module): method _get_init_info (line 280) | def _get_init_info(self): class TruncNormalInit (line 287) | class TruncNormalInit(BaseInit): method __init__ (line 306) | def __init__(self, method __call__ (line 318) | def __call__(self, module: nn.Module) -> None: method _get_init_info (line 335) | def _get_init_info(self): class UniformInit (line 342) | class UniformInit(BaseInit): method __init__ (line 358) | def __init__(self, a=0, b=1, **kwargs): method __call__ (line 363) | def __call__(self, module): method _get_init_info (line 378) | def _get_init_info(self): class KaimingInit (line 385) | class KaimingInit(BaseInit): method __init__ (line 411) | def __init__(self, method __call__ (line 423) | def __call__(self, module): method _get_init_info (line 440) | def _get_init_info(self): class Caffe2XavierInit (line 448) | class Caffe2XavierInit(KaimingInit): method __init__ (line 451) | def __init__(self, **kwargs): method __call__ (line 459) | def __call__(self, module): class PretrainedInit (line 464) | class PretrainedInit(object): method __init__ (line 478) | def __init__(self, checkpoint, prefix=None, map_location=None): method __call__ (line 483) | def __call__(self, module): method _get_init_info (line 506) | def _get_init_info(self): function _initialize (line 511) | def _initialize(module, cfg, wholemodule=False): function _initialize_override (line 520) | def _initialize_override(module, override, cfg): function initialize (line 550) | def initialize(module, init_cfg): function _no_grad_trunc_normal_ (line 622) | def _no_grad_trunc_normal_(tensor: Tensor, mean: float, std: float, a: f... function trunc_normal_ (line 662) | def trunc_normal_(tensor: Tensor, FILE: lavis/common/annotator/uniformer/mmcv/cnn/vgg.py function conv3x3 (line 9) | def conv3x3(in_planes, out_planes, dilation=1): function make_vgg_layer (line 19) | def make_vgg_layer(inplanes, class VGG (line 37) | class VGG(nn.Module): method __init__ (line 61) | def __init__(self, method init_weights (line 125) | def init_weights(self, pretrained=None): method forward (line 141) | def forward(self, x): method train (line 159) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmcv/engine/test.py function single_gpu_test (line 15) | def single_gpu_test(model, data_loader): function multi_gpu_test (line 44) | def multi_gpu_test(model, data_loader, tmpdir=None, gpu_collect=False): function collect_results_cpu (line 91) | def collect_results_cpu(result_part, size, tmpdir=None): function collect_results_gpu (line 155) | def collect_results_gpu(result_part, size): FILE: lavis/common/annotator/uniformer/mmcv/fileio/file_client.py class BaseStorageBackend (line 19) | class BaseStorageBackend(metaclass=ABCMeta): method name (line 31) | def name(self): method allow_symlink (line 35) | def allow_symlink(self): method get (line 39) | def get(self, filepath): method get_text (line 43) | def get_text(self, filepath): class CephBackend (line 47) | class CephBackend(BaseStorageBackend): method __init__ (line 60) | def __init__(self, path_mapping=None): method get (line 72) | def get(self, filepath): method get_text (line 81) | def get_text(self, filepath, encoding=None): class PetrelBackend (line 85) | class PetrelBackend(BaseStorageBackend): method __init__ (line 108) | def __init__(self, method _map_path (line 121) | def _map_path(self, filepath: Union[str, Path]) -> str: method _format_path (line 134) | def _format_path(self, filepath: str) -> str: method get (line 147) | def get(self, filepath: Union[str, Path]) -> memoryview: method get_text (line 164) | def get_text(self, method put (line 179) | def put(self, obj: bytes, filepath: Union[str, Path]) -> None: method put_text (line 190) | def put_text(self, method remove (line 204) | def remove(self, filepath: Union[str, Path]) -> None: method exists (line 220) | def exists(self, filepath: Union[str, Path]) -> bool: method isdir (line 240) | def isdir(self, filepath: Union[str, Path]) -> bool: method isfile (line 261) | def isfile(self, filepath: Union[str, Path]) -> bool: method join_path (line 281) | def join_path(self, filepath: Union[str, Path], method get_local_path (line 300) | def get_local_path(self, filepath: Union[str, Path]) -> Iterable[str]: method list_dir_or_file (line 331) | def list_dir_or_file(self, class MemcachedBackend (line 413) | class MemcachedBackend(BaseStorageBackend): method __init__ (line 423) | def __init__(self, server_list_cfg, client_cfg, sys_path=None): method get (line 440) | def get(self, filepath): method get_text (line 447) | def get_text(self, filepath, encoding=None): class LmdbBackend (line 451) | class LmdbBackend(BaseStorageBackend): method __init__ (line 469) | def __init__(self, method get (line 488) | def get(self, filepath): method get_text (line 499) | def get_text(self, filepath, encoding=None): class HardDiskBackend (line 503) | class HardDiskBackend(BaseStorageBackend): method get (line 508) | def get(self, filepath: Union[str, Path]) -> bytes: method get_text (line 521) | def get_text(self, method put (line 538) | def put(self, obj: bytes, filepath: Union[str, Path]) -> None: method put_text (line 553) | def put_text(self, method remove (line 573) | def remove(self, filepath: Union[str, Path]) -> None: method exists (line 581) | def exists(self, filepath: Union[str, Path]) -> bool: method isdir (line 592) | def isdir(self, filepath: Union[str, Path]) -> bool: method isfile (line 605) | def isfile(self, filepath: Union[str, Path]) -> bool: method join_path (line 617) | def join_path(self, filepath: Union[str, Path], method get_local_path (line 633) | def get_local_path( method list_dir_or_file (line 638) | def list_dir_or_file(self, class HTTPBackend (line 691) | class HTTPBackend(BaseStorageBackend): method get (line 694) | def get(self, filepath): method get_text (line 698) | def get_text(self, filepath, encoding='utf-8'): method get_local_path (line 703) | def get_local_path(self, filepath: str) -> Iterable[str]: class FileClient (line 729) | class FileClient: method __new__ (line 787) | def __new__(cls, backend=None, prefix=None, **kwargs): method name (line 823) | def name(self): method allow_symlink (line 827) | def allow_symlink(self): method parse_uri_prefix (line 831) | def parse_uri_prefix(uri: Union[str, Path]) -> Optional[str]: method infer_client (line 858) | def infer_client(cls, method _register_backend (line 886) | def _register_backend(cls, name, backend, force=False, prefixes=None): method register_backend (line 922) | def register_backend(cls, name, backend=None, force=False, prefixes=No... method get (line 976) | def get(self, filepath: Union[str, Path]) -> Union[bytes, memoryview]: method get_text (line 994) | def get_text(self, filepath: Union[str, Path], encoding='utf-8') -> str: method put (line 1007) | def put(self, obj: bytes, filepath: Union[str, Path]) -> None: method put_text (line 1020) | def put_text(self, obj: str, filepath: Union[str, Path]) -> None: method remove (line 1035) | def remove(self, filepath: Union[str, Path]) -> None: method exists (line 1043) | def exists(self, filepath: Union[str, Path]) -> bool: method isdir (line 1054) | def isdir(self, filepath: Union[str, Path]) -> bool: method isfile (line 1067) | def isfile(self, filepath: Union[str, Path]) -> bool: method join_path (line 1079) | def join_path(self, filepath: Union[str, Path], method get_local_path (line 1095) | def get_local_path(self, filepath: Union[str, Path]) -> Iterable[str]: method list_dir_or_file (line 1123) | def list_dir_or_file(self, FILE: lavis/common/annotator/uniformer/mmcv/fileio/handlers/base.py class BaseFileHandler (line 5) | class BaseFileHandler(metaclass=ABCMeta): method load_from_fileobj (line 13) | def load_from_fileobj(self, file, **kwargs): method dump_to_fileobj (line 17) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 21) | def dump_to_str(self, obj, **kwargs): method load_from_path (line 24) | def load_from_path(self, filepath, mode='r', **kwargs): method dump_to_path (line 28) | def dump_to_path(self, obj, filepath, mode='w', **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/fileio/handlers/json_handler.py function set_default (line 9) | def set_default(obj): class JsonHandler (line 25) | class JsonHandler(BaseFileHandler): method load_from_fileobj (line 27) | def load_from_fileobj(self, file): method dump_to_fileobj (line 30) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 34) | def dump_to_str(self, obj, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/fileio/handlers/pickle_handler.py class PickleHandler (line 7) | class PickleHandler(BaseFileHandler): method load_from_fileobj (line 11) | def load_from_fileobj(self, file, **kwargs): method load_from_path (line 14) | def load_from_path(self, filepath, **kwargs): method dump_to_str (line 18) | def dump_to_str(self, obj, **kwargs): method dump_to_fileobj (line 22) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_path (line 26) | def dump_to_path(self, obj, filepath, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/fileio/handlers/yaml_handler.py class YamlHandler (line 12) | class YamlHandler(BaseFileHandler): method load_from_fileobj (line 14) | def load_from_fileobj(self, file, **kwargs): method dump_to_fileobj (line 18) | def dump_to_fileobj(self, obj, file, **kwargs): method dump_to_str (line 22) | def dump_to_str(self, obj, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/fileio/io.py function load (line 18) | def load(file, file_format=None, file_client_args=None, **kwargs): function dump (line 69) | def dump(obj, file=None, file_format=None, file_client_args=None, **kwar... function _register_handler (line 126) | def _register_handler(handler, file_formats): function register_handler (line 145) | def register_handler(file_formats, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/fileio/parse.py function list_from_file (line 8) | def list_from_file(filename, function dict_from_file (line 55) | def dict_from_file(filename, FILE: lavis/common/annotator/uniformer/mmcv/image/colorspace.py function imconvert (line 6) | def imconvert(img, src, dst): function bgr2gray (line 22) | def bgr2gray(img, keepdim=False): function rgb2gray (line 39) | def rgb2gray(img, keepdim=False): function gray2bgr (line 56) | def gray2bgr(img): function gray2rgb (line 70) | def gray2rgb(img): function _convert_input_type_range (line 84) | def _convert_input_type_range(img): function _convert_output_type_range (line 112) | def _convert_output_type_range(img, dst_type): function rgb2ycbcr (line 143) | def rgb2ycbcr(img, y_only=False): function bgr2ycbcr (line 177) | def bgr2ycbcr(img, y_only=False): function ycbcr2rgb (line 211) | def ycbcr2rgb(img): function ycbcr2bgr (line 243) | def ycbcr2bgr(img): function convert_color_factory (line 275) | def convert_color_factory(src, dst): FILE: lavis/common/annotator/uniformer/mmcv/image/geometric.py function _scale_size (line 16) | def _scale_size(size, scale): function imresize (line 51) | def imresize(img, function imresize_to_multiple (line 98) | def imresize_to_multiple(img, function imresize_like (line 162) | def imresize_like(img, function rescale_size (line 184) | def rescale_size(old_size, scale, return_scale=False): function imrescale (line 221) | def imrescale(img, function imflip (line 252) | def imflip(img, direction='horizontal'): function imflip_ (line 272) | def imflip_(img, direction='horizontal'): function imrotate (line 292) | def imrotate(img, function bbox_clip (line 342) | def bbox_clip(bboxes, img_shape): function bbox_scaling (line 360) | def bbox_scaling(bboxes, scale, clip_shape=None): function imcrop (line 386) | def imcrop(img, bboxes, scale=1.0, pad_fill=None): function impad (line 440) | def impad(img, function impad_to_multiple (line 522) | def impad_to_multiple(img, divisor, pad_val=0): function cutout (line 538) | def cutout(img, shape, pad_val=0): function _get_shear_matrix (line 593) | def _get_shear_matrix(magnitude, direction='horizontal'): function imshear (line 611) | def imshear(img, function _get_translate_matrix (line 662) | def _get_translate_matrix(offset, direction='horizontal'): function imtranslate (line 680) | def imtranslate(img, FILE: lavis/common/annotator/uniformer/mmcv/image/io.py function use_backend (line 43) | def use_backend(backend): function _jpegflag (line 69) | def _jpegflag(flag='color', channel_order='bgr'): function _pillow2array (line 85) | def _pillow2array(img, flag='color', channel_order='bgr'): function imread (line 140) | def imread(img_or_path, flag='color', channel_order='bgr', backend=None): function imfrombytes (line 203) | def imfrombytes(content, flag='color', channel_order='bgr', backend=None): function imwrite (line 242) | def imwrite(img, file_path, params=None, auto_mkdir=True): FILE: lavis/common/annotator/uniformer/mmcv/image/misc.py function tensor2imgs (line 12) | def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True): FILE: lavis/common/annotator/uniformer/mmcv/image/photometric.py function imnormalize (line 9) | def imnormalize(img, mean, std, to_rgb=True): function imnormalize_ (line 25) | def imnormalize_(img, mean, std, to_rgb=True): function imdenormalize (line 48) | def imdenormalize(img, mean, std, to_bgr=True): function iminvert (line 59) | def iminvert(img): function solarize (line 71) | def solarize(img, thr=128): function posterize (line 85) | def posterize(img, bits): function adjust_color (line 100) | def adjust_color(img, alpha=1, beta=None, gamma=0): function imequalize (line 131) | def imequalize(img): function adjust_brightness (line 176) | def adjust_brightness(img, factor=1.): function adjust_contrast (line 208) | def adjust_contrast(img, factor=1.): function auto_contrast (line 238) | def auto_contrast(img, cutoff=0): function adjust_sharpness (line 294) | def adjust_sharpness(img, factor=1., kernel=None): function adjust_lighting (line 338) | def adjust_lighting(img, eigval, eigvec, alphastd=0.1, to_rgb=True): function lut_transform (line 381) | def lut_transform(img, lut_table): function clahe (line 405) | def clahe(img, clip_limit=40.0, tile_grid_size=(8, 8)): FILE: lavis/common/annotator/uniformer/mmcv/ops/assign_score_withk.py class AssignScoreWithK (line 9) | class AssignScoreWithK(Function): method forward (line 29) | def forward(ctx, method backward (line 81) | def backward(ctx, grad_out): FILE: lavis/common/annotator/uniformer/mmcv/ops/ball_query.py class BallQuery (line 10) | class BallQuery(Function): method forward (line 14) | def forward(ctx, min_radius: float, max_radius: float, sample_num: int, method backward (line 51) | def backward(ctx, a=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/bbox.py function bbox_overlaps (line 7) | def bbox_overlaps(bboxes1, bboxes2, mode='iou', aligned=False, offset=0): FILE: lavis/common/annotator/uniformer/mmcv/ops/border_align.py class BorderAlignFunction (line 16) | class BorderAlignFunction(Function): method symbolic (line 19) | def symbolic(g, input, boxes, pool_size): method forward (line 24) | def forward(ctx, input, boxes, pool_size): method backward (line 48) | def backward(ctx, grad_output): class BorderAlign (line 65) | class BorderAlign(nn.Module): method __init__ (line 88) | def __init__(self, pool_size): method forward (line 92) | def forward(self, input, boxes): method __repr__ (line 106) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/box_iou_rotated.py function box_iou_rotated (line 7) | def box_iou_rotated(bboxes1, bboxes2, mode='iou', aligned=False): FILE: lavis/common/annotator/uniformer/mmcv/ops/carafe.py class CARAFENaiveFunction (line 17) | class CARAFENaiveFunction(Function): method symbolic (line 20) | def symbolic(g, features, masks, kernel_size, group_size, scale_factor): method forward (line 30) | def forward(ctx, features, masks, kernel_size, group_size, scale_factor): method backward (line 58) | def backward(ctx, grad_output): class CARAFENaive (line 84) | class CARAFENaive(Module): method __init__ (line 86) | def __init__(self, kernel_size, group_size, scale_factor): method forward (line 95) | def forward(self, features, masks): class CARAFEFunction (line 100) | class CARAFEFunction(Function): method symbolic (line 103) | def symbolic(g, features, masks, kernel_size, group_size, scale_factor): method forward (line 113) | def forward(ctx, features, masks, kernel_size, group_size, scale_factor): method backward (line 147) | def backward(ctx, grad_output): class CARAFE (line 180) | class CARAFE(Module): method __init__ (line 194) | def __init__(self, kernel_size, group_size, scale_factor): method forward (line 203) | def forward(self, features, masks): class CARAFEPack (line 209) | class CARAFEPack(nn.Module): method __init__ (line 230) | def __init__(self, method init_weights (line 258) | def init_weights(self): method kernel_normalizer (line 264) | def kernel_normalizer(self, mask): method feature_reassemble (line 277) | def feature_reassemble(self, x, mask): method forward (line 281) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/ops/cc_attention.py function NEG_INF_DIAG (line 9) | def NEG_INF_DIAG(n, device): class CrissCrossAttention (line 19) | class CrissCrossAttention(nn.Module): method __init__ (line 44) | def __init__(self, in_channels): method forward (line 52) | def forward(self, x): method __repr__ (line 80) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/contour_expand.py function contour_expand (line 10) | def contour_expand(kernel_mask, internal_kernel_label, min_kernel_area, FILE: lavis/common/annotator/uniformer/mmcv/ops/corner_pool.py class TopPoolFunction (line 17) | class TopPoolFunction(Function): method symbolic (line 20) | def symbolic(g, input): method forward (line 26) | def forward(ctx, input): method backward (line 32) | def backward(ctx, grad_output): class BottomPoolFunction (line 38) | class BottomPoolFunction(Function): method symbolic (line 41) | def symbolic(g, input): method forward (line 47) | def forward(ctx, input): method backward (line 53) | def backward(ctx, grad_output): class LeftPoolFunction (line 59) | class LeftPoolFunction(Function): method symbolic (line 62) | def symbolic(g, input): method forward (line 68) | def forward(ctx, input): method backward (line 74) | def backward(ctx, grad_output): class RightPoolFunction (line 80) | class RightPoolFunction(Function): method symbolic (line 83) | def symbolic(g, input): method forward (line 89) | def forward(ctx, input): method backward (line 95) | def backward(ctx, grad_output): class CornerPool (line 101) | class CornerPool(nn.Module): method __init__ (line 136) | def __init__(self, mode): method forward (line 142) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/ops/correlation.py class CorrelationFunction (line 14) | class CorrelationFunction(Function): method forward (line 17) | def forward(ctx, method backward (line 63) | def backward(ctx, grad_output): method _output_size (line 96) | def _output_size(ctx, input1): class Correlation (line 114) | class Correlation(nn.Module): method __init__ (line 167) | def __init__(self, method forward (line 182) | def forward(self, input1: Tensor, input2: Tensor) -> Tensor: method __repr__ (line 188) | def __repr__(self) -> str: FILE: lavis/common/annotator/uniformer/mmcv/ops/deform_conv.py class DeformConv2dFunction (line 22) | class DeformConv2dFunction(Function): method symbolic (line 25) | def symbolic(g, method forward (line 50) | def forward(ctx, method backward (line 114) | def backward(ctx, grad_output): method _output_size (line 173) | def _output_size(ctx, input, weight): class DeformConv2d (line 192) | class DeformConv2d(nn.Module): method __init__ (line 228) | def __init__(self, method reset_parameters (line 269) | def reset_parameters(self): method forward (line 276) | def forward(self, x: Tensor, offset: Tensor) -> Tensor: method __repr__ (line 315) | def __repr__(self): class DeformConv2dPack (line 331) | class DeformConv2dPack(DeformConv2d): method __init__ (line 358) | def __init__(self, *args, **kwargs): method init_offset (line 370) | def init_offset(self): method forward (line 374) | def forward(self, x): method _load_from_state_dict (line 380) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... FILE: lavis/common/annotator/uniformer/mmcv/ops/deform_roi_pool.py class DeformRoIPoolFunction (line 13) | class DeformRoIPoolFunction(Function): method symbolic (line 16) | def symbolic(g, input, rois, offset, output_size, spatial_scale, method forward (line 30) | def forward(ctx, method backward (line 67) | def backward(ctx, grad_output): class DeformRoIPool (line 92) | class DeformRoIPool(nn.Module): method __init__ (line 94) | def __init__(self, method forward (line 105) | def forward(self, input, rois, offset=None): class DeformRoIPoolPack (line 111) | class DeformRoIPoolPack(DeformRoIPool): method __init__ (line 113) | def __init__(self, method forward (line 138) | def forward(self, input, rois): class ModulatedDeformRoIPoolPack (line 152) | class ModulatedDeformRoIPoolPack(DeformRoIPool): method __init__ (line 154) | def __init__(self, method forward (line 190) | def forward(self, input, rois): FILE: lavis/common/annotator/uniformer/mmcv/ops/deprecated_wrappers.py class Conv2d_deprecated (line 9) | class Conv2d_deprecated(Conv2d): method __init__ (line 11) | def __init__(self, *args, **kwargs): class ConvTranspose2d_deprecated (line 18) | class ConvTranspose2d_deprecated(ConvTranspose2d): method __init__ (line 20) | def __init__(self, *args, **kwargs): class MaxPool2d_deprecated (line 28) | class MaxPool2d_deprecated(MaxPool2d): method __init__ (line 30) | def __init__(self, *args, **kwargs): class Linear_deprecated (line 37) | class Linear_deprecated(Linear): method __init__ (line 39) | def __init__(self, *args, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/ops/focal_loss.py class SigmoidFocalLossFunction (line 15) | class SigmoidFocalLossFunction(Function): method symbolic (line 18) | def symbolic(g, input, target, gamma, alpha, weight, reduction): method forward (line 29) | def forward(ctx, method backward (line 66) | def backward(ctx, grad_output): class SigmoidFocalLoss (line 88) | class SigmoidFocalLoss(nn.Module): method __init__ (line 90) | def __init__(self, gamma, alpha, weight=None, reduction='mean'): method forward (line 97) | def forward(self, input, target): method __repr__ (line 101) | def __repr__(self): class SoftmaxFocalLossFunction (line 109) | class SoftmaxFocalLossFunction(Function): method symbolic (line 112) | def symbolic(g, input, target, gamma, alpha, weight, reduction): method forward (line 123) | def forward(ctx, method backward (line 171) | def backward(ctx, grad_output): class SoftmaxFocalLoss (line 194) | class SoftmaxFocalLoss(nn.Module): method __init__ (line 196) | def __init__(self, gamma, alpha, weight=None, reduction='mean'): method forward (line 203) | def forward(self, input, target): method __repr__ (line 207) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/furthest_point_sample.py class FurthestPointSampling (line 12) | class FurthestPointSampling(Function): method forward (line 17) | def forward(ctx, points_xyz: torch.Tensor, method backward (line 46) | def backward(xyz, a=None): class FurthestPointSamplingWithDist (line 50) | class FurthestPointSamplingWithDist(Function): method forward (line 55) | def forward(ctx, points_dist: torch.Tensor, method backward (line 78) | def backward(xyz, a=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/fused_bias_leakyrelu.py class FusedBiasLeakyReLUFunctionBackward (line 108) | class FusedBiasLeakyReLUFunctionBackward(Function): method forward (line 116) | def forward(ctx, grad_output, out, negative_slope, scale): method backward (line 142) | def backward(ctx, gradgrad_input, gradgrad_bias): class FusedBiasLeakyReLUFunction (line 160) | class FusedBiasLeakyReLUFunction(Function): method forward (line 163) | def forward(ctx, input, bias, negative_slope, scale): method backward (line 181) | def backward(ctx, grad_output): class FusedBiasLeakyReLU (line 190) | class FusedBiasLeakyReLU(nn.Module): method __init__ (line 213) | def __init__(self, num_channels, negative_slope=0.2, scale=2**0.5): method forward (line 220) | def forward(self, input): function fused_bias_leakyrelu (line 225) | def fused_bias_leakyrelu(input, bias, negative_slope=0.2, scale=2**0.5): function bias_leakyrelu_ref (line 257) | def bias_leakyrelu_ref(x, bias, negative_slope=0.2, scale=2**0.5): FILE: lavis/common/annotator/uniformer/mmcv/ops/gather_points.py class GatherPoints (line 10) | class GatherPoints(Function): method forward (line 14) | def forward(ctx, features: torch.Tensor, method backward (line 40) | def backward(ctx, grad_out): FILE: lavis/common/annotator/uniformer/mmcv/ops/group_points.py class QueryAndGroup (line 16) | class QueryAndGroup(nn.Module): method __init__ (line 39) | def __init__(self, method forward (line 67) | def forward(self, points_xyz, center_xyz, features=None): class GroupAll (line 134) | class GroupAll(nn.Module): method __init__ (line 141) | def __init__(self, use_xyz: bool = True): method forward (line 145) | def forward(self, class GroupingOperation (line 173) | class GroupingOperation(Function): method forward (line 177) | def forward(ctx, features: torch.Tensor, method backward (line 202) | def backward(ctx, FILE: lavis/common/annotator/uniformer/mmcv/ops/info.py function get_compiler_version (line 10) | def get_compiler_version(): function get_compiling_cuda_version (line 13) | def get_compiling_cuda_version(): function get_compiler_version (line 20) | def get_compiler_version(): function get_compiling_cuda_version (line 23) | def get_compiling_cuda_version(): function get_onnxruntime_op_path (line 27) | def get_onnxruntime_op_path(): FILE: lavis/common/annotator/uniformer/mmcv/ops/iou3d.py function boxes_iou_bev (line 12) | def boxes_iou_bev(boxes_a, boxes_b): function nms_bev (line 31) | def nms_bev(boxes, scores, thresh, pre_max_size=None, post_max_size=None): function nms_normal_bev (line 65) | def nms_normal_bev(boxes, scores, thresh): FILE: lavis/common/annotator/uniformer/mmcv/ops/knn.py class KNN (line 9) | class KNN(Function): method forward (line 18) | def forward(ctx, method backward (line 73) | def backward(ctx, a=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/masked_conv.py class MaskedConv2dFunction (line 16) | class MaskedConv2dFunction(Function): method symbolic (line 19) | def symbolic(g, features, mask, weight, bias, padding, stride): method forward (line 30) | def forward(ctx, features, mask, weight, bias, padding=0, stride=1): method backward (line 79) | def backward(ctx, grad_output): class MaskedConv2d (line 86) | class MaskedConv2d(nn.Conv2d): method __init__ (line 93) | def __init__(self, method forward (line 106) | def forward(self, input, mask=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/merge_cells.py class BaseMergeCell (line 11) | class BaseMergeCell(nn.Module): method __init__ (line 43) | def __init__(self, method _build_input_conv (line 78) | def _build_input_conv(self, channel, conv_cfg, norm_cfg): method _binary_op (line 89) | def _binary_op(self, x1, x2): method _resize (line 92) | def _resize(self, x, size): method forward (line 103) | def forward(self, x1, x2, out_size=None): class SumCell (line 121) | class SumCell(BaseMergeCell): method __init__ (line 123) | def __init__(self, in_channels, out_channels, **kwargs): method _binary_op (line 126) | def _binary_op(self, x1, x2): class ConcatCell (line 130) | class ConcatCell(BaseMergeCell): method __init__ (line 132) | def __init__(self, in_channels, out_channels, **kwargs): method _binary_op (line 136) | def _binary_op(self, x1, x2): class GlobalPoolingCell (line 141) | class GlobalPoolingCell(BaseMergeCell): method __init__ (line 143) | def __init__(self, in_channels=None, out_channels=None, **kwargs): method _binary_op (line 147) | def _binary_op(self, x1, x2): FILE: lavis/common/annotator/uniformer/mmcv/ops/modulated_deform_conv.py class ModulatedDeformConv2dFunction (line 19) | class ModulatedDeformConv2dFunction(Function): method symbolic (line 22) | def symbolic(g, input, offset, mask, weight, bias, stride, padding, method forward (line 37) | def forward(ctx, method backward (line 97) | def backward(ctx, grad_output): method _output_size (line 137) | def _output_size(ctx, input, weight): class ModulatedDeformConv2d (line 156) | class ModulatedDeformConv2d(nn.Module): method __init__ (line 160) | def __init__(self, method init_weights (line 192) | def init_weights(self): method forward (line 201) | def forward(self, x, offset, mask): class ModulatedDeformConv2dPack (line 209) | class ModulatedDeformConv2dPack(ModulatedDeformConv2d): method __init__ (line 228) | def __init__(self, *args, **kwargs): method init_weights (line 240) | def init_weights(self): method forward (line 246) | def forward(self, x): method _load_from_state_dict (line 256) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... FILE: lavis/common/annotator/uniformer/mmcv/ops/multi_scale_deform_attn.py class MultiScaleDeformableAttnFunction (line 20) | class MultiScaleDeformableAttnFunction(Function): method forward (line 23) | def forward(ctx, value, value_spatial_shapes, value_level_start_index, method backward (line 61) | def backward(ctx, grad_output): function multi_scale_deformable_attn_pytorch (line 94) | def multi_scale_deformable_attn_pytorch(value, value_spatial_shapes, class MultiScaleDeformableAttention (line 155) | class MultiScaleDeformableAttention(BaseModule): method __init__ (line 182) | def __init__(self, method init_weights (line 230) | def init_weights(self): method forward (line 252) | def forward(self, FILE: lavis/common/annotator/uniformer/mmcv/ops/nms.py class NMSop (line 14) | class NMSop(torch.autograd.Function): method forward (line 17) | def forward(ctx, bboxes, scores, iou_threshold, offset, score_threshold, method symbolic (line 36) | def symbolic(g, bboxes, scores, iou_threshold, offset, score_threshold, class SoftNMSop (line 82) | class SoftNMSop(torch.autograd.Function): method forward (line 85) | def forward(ctx, boxes, scores, iou_threshold, sigma, min_score, method, method symbolic (line 100) | def symbolic(g, boxes, scores, iou_threshold, sigma, min_score, method, function nms (line 118) | def nms(boxes, scores, iou_threshold, offset=0, score_threshold=0, max_n... function soft_nms (line 181) | def soft_nms(boxes, function batched_nms (line 260) | def batched_nms(boxes, scores, idxs, nms_cfg, class_agnostic=False): function nms_match (line 339) | def nms_match(dets, iou_threshold): function nms_rotated (line 376) | def nms_rotated(dets, scores, iou_threshold, labels=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/pixel_group.py function pixel_group (line 10) | def pixel_group(score, mask, embedding, kernel_label, kernel_contour, FILE: lavis/common/annotator/uniformer/mmcv/ops/point_sample.py function bilinear_grid_sample (line 12) | def bilinear_grid_sample(im, grid, align_corners=False): function is_in_onnx_export_without_custom_ops (line 87) | def is_in_onnx_export_without_custom_ops(): function normalize (line 94) | def normalize(grid): function denormalize (line 105) | def denormalize(grid): function generate_grid (line 116) | def generate_grid(num_grid, size, device): function rel_roi_point_to_abs_img_point (line 137) | def rel_roi_point_to_abs_img_point(rois, rel_roi_points): function get_shape_from_feature_map (line 168) | def get_shape_from_feature_map(x): function abs_img_point_to_rel_img_point (line 186) | def abs_img_point_to_rel_img_point(abs_img_points, img, spatial_scale=1.): function rel_roi_point_to_rel_img_point (line 216) | def rel_roi_point_to_rel_img_point(rois, function point_sample (line 242) | def point_sample(input, points, align_corners=False, **kwargs): class SimpleRoIAlign (line 276) | class SimpleRoIAlign(nn.Module): method __init__ (line 278) | def __init__(self, output_size, spatial_scale, aligned=True): method forward (line 296) | def forward(self, features, rois): method __repr__ (line 332) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/points_in_boxes.py function points_in_boxes_part (line 11) | def points_in_boxes_part(points, boxes): function points_in_boxes_cpu (line 58) | def points_in_boxes_cpu(points, boxes): function points_in_boxes_all (line 95) | def points_in_boxes_all(points, boxes): FILE: lavis/common/annotator/uniformer/mmcv/ops/points_sampler.py function calc_square_dist (line 11) | def calc_square_dist(point_feat_a, point_feat_b, norm=True): function get_sampler_cls (line 37) | def get_sampler_cls(sampler_type): class PointsSampler (line 60) | class PointsSampler(nn.Module): method __init__ (line 74) | def __init__(self, method forward (line 92) | def forward(self, points_xyz, features): class DFPSSampler (line 133) | class DFPSSampler(nn.Module): method __init__ (line 136) | def __init__(self): method forward (line 139) | def forward(self, points, features, npoint): class FFPSSampler (line 145) | class FFPSSampler(nn.Module): method __init__ (line 148) | def __init__(self): method forward (line 151) | def forward(self, points, features, npoint): class FSSampler (line 162) | class FSSampler(nn.Module): method __init__ (line 165) | def __init__(self): method forward (line 168) | def forward(self, points, features, npoint): FILE: lavis/common/annotator/uniformer/mmcv/ops/psa_mask.py class PSAMaskFunction (line 12) | class PSAMaskFunction(Function): method symbolic (line 15) | def symbolic(g, input, psa_type, mask_size): method forward (line 23) | def forward(ctx, input, psa_type, mask_size): method backward (line 48) | def backward(ctx, grad_output): class PSAMask (line 72) | class PSAMask(nn.Module): method __init__ (line 74) | def __init__(self, psa_type, mask_size=None): method forward (line 85) | def forward(self, input): method __repr__ (line 88) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/roi_align.py class RoIAlignFunction (line 14) | class RoIAlignFunction(Function): method symbolic (line 17) | def symbolic(g, input, rois, output_size, spatial_scale, sampling_ratio, method forward (line 64) | def forward(ctx, method backward (line 110) | def backward(ctx, grad_output): class RoIAlign (line 133) | class RoIAlign(nn.Module): method __init__ (line 176) | def __init__(self, method forward (line 192) | def forward(self, input, rois): method __repr__ (line 215) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/roi_align_rotated.py class RoIAlignRotatedFunction (line 11) | class RoIAlignRotatedFunction(Function): method symbolic (line 14) | def symbolic(g, features, rois, out_size, spatial_scale, sample_num, method forward (line 39) | def forward(ctx, method backward (line 82) | def backward(ctx, grad_output): class RoIAlignRotated (line 116) | class RoIAlignRotated(nn.Module): method __init__ (line 159) | def __init__(self, method forward (line 173) | def forward(self, features, rois): FILE: lavis/common/annotator/uniformer/mmcv/ops/roi_pool.py class RoIPoolFunction (line 14) | class RoIPoolFunction(Function): method symbolic (line 17) | def symbolic(g, input, rois, output_size, spatial_scale): method forward (line 26) | def forward(ctx, input, rois, output_size, spatial_scale=1.0): method backward (line 52) | def backward(ctx, grad_output): class RoIPool (line 71) | class RoIPool(nn.Module): method __init__ (line 73) | def __init__(self, output_size, spatial_scale=1.0): method forward (line 79) | def forward(self, input, rois): method __repr__ (line 82) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/roiaware_pool3d.py class RoIAwarePool3d (line 13) | class RoIAwarePool3d(nn.Module): method __init__ (line 28) | def __init__(self, out_size, max_pts_per_voxel=128, mode='max'): method forward (line 37) | def forward(self, rois, pts, pts_feature): class RoIAwarePool3dFunction (line 54) | class RoIAwarePool3dFunction(Function): method forward (line 57) | def forward(ctx, rois, pts, pts_feature, out_size, max_pts_per_voxel, method backward (line 105) | def backward(ctx, grad_out): FILE: lavis/common/annotator/uniformer/mmcv/ops/roipoint_pool3d.py class RoIPointPool3d (line 9) | class RoIPointPool3d(nn.Module): method __init__ (line 20) | def __init__(self, num_sampled_points=512): method forward (line 24) | def forward(self, points, point_features, boxes3d): class RoIPointPool3dFunction (line 41) | class RoIPointPool3dFunction(Function): method forward (line 44) | def forward(ctx, points, point_features, boxes3d, num_sampled_points=5... method backward (line 76) | def backward(ctx, grad_out): FILE: lavis/common/annotator/uniformer/mmcv/ops/saconv.py class SAConv2d (line 12) | class SAConv2d(ConvAWS2d): method __init__ (line 37) | def __init__(self, method init_weights (line 81) | def init_weights(self): method forward (line 90) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmcv/ops/scatter_points.py class _DynamicScatter (line 13) | class _DynamicScatter(Function): method forward (line 16) | def forward(ctx, feats, coors, reduce_type='max'): method backward (line 44) | def backward(ctx, grad_voxel_feats, grad_voxel_coors=None): class DynamicScatter (line 59) | class DynamicScatter(nn.Module): method __init__ (line 75) | def __init__(self, voxel_size, point_cloud_range, average_points: bool): method forward_single (line 82) | def forward_single(self, points, coors): method forward (line 98) | def forward(self, points, coors): method __repr__ (line 129) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/sync_bn.py class SyncBatchNormFunction (line 19) | class SyncBatchNormFunction(Function): method symbolic (line 22) | def symbolic(g, input, running_mean, running_var, weight, bias, momentum, method forward (line 38) | def forward(self, input, running_mean, running_var, weight, bias, mome... method backward (line 129) | def backward(self, grad_output): class SyncBatchNorm (line 159) | class SyncBatchNorm(Module): method __init__ (line 193) | def __init__(self, method reset_running_stats (line 230) | def reset_running_stats(self): method reset_parameters (line 236) | def reset_parameters(self): method forward (line 242) | def forward(self, input): method __repr__ (line 270) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/ops/three_interpolate.py class ThreeInterpolate (line 12) | class ThreeInterpolate(Function): method forward (line 20) | def forward(ctx, features: torch.Tensor, indices: torch.Tensor, method backward (line 47) | def backward( FILE: lavis/common/annotator/uniformer/mmcv/ops/three_nn.py class ThreeNN (line 11) | class ThreeNN(Function): method forward (line 19) | def forward(ctx, target: torch.Tensor, method backward (line 47) | def backward(ctx, a=None, b=None): FILE: lavis/common/annotator/uniformer/mmcv/ops/tin_shift.py class TINShiftFunction (line 17) | class TINShiftFunction(Function): method forward (line 20) | def forward(ctx, input, shift): method backward (line 35) | def backward(ctx, grad_output): class TINShift (line 48) | class TINShift(nn.Module): method forward (line 58) | def forward(self, input, shift): FILE: lavis/common/annotator/uniformer/mmcv/ops/upfirdn2d.py class UpFirDn2dBackward (line 108) | class UpFirDn2dBackward(Function): method forward (line 111) | def forward(ctx, grad_output, kernel, grad_kernel, up, down, pad, g_pad, method backward (line 152) | def backward(ctx, gradgrad_input): class UpFirDn2d (line 177) | class UpFirDn2d(Function): method forward (line 180) | def forward(ctx, input, kernel, up, down, pad): method backward (line 225) | def backward(ctx, grad_output): function upfirdn2d (line 243) | def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)): function upfirdn2d_native (line 290) | def upfirdn2d_native(input, kernel, up_x, up_y, down_x, down_y, pad_x0, ... FILE: lavis/common/annotator/uniformer/mmcv/ops/voxelize.py class _Voxelization (line 13) | class _Voxelization(Function): method forward (line 16) | def forward(ctx, class Voxelization (line 71) | class Voxelization(nn.Module): method __init__ (line 89) | def __init__(self, method forward (line 116) | def forward(self, input): method __repr__ (line 125) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmcv/parallel/_functions.py function scatter (line 6) | def scatter(input, devices, streams=None): function synchronize_stream (line 34) | def synchronize_stream(output, devices, streams): function get_input_device (line 51) | def get_input_device(input): class Scatter (line 64) | class Scatter: method forward (line 67) | def forward(target_gpus, input): FILE: lavis/common/annotator/uniformer/mmcv/parallel/collate.py function collate (line 11) | def collate(batch, samples_per_gpu=1): FILE: lavis/common/annotator/uniformer/mmcv/parallel/data_container.py function assert_tensor_type (line 7) | def assert_tensor_type(func): class DataContainer (line 20) | class DataContainer: method __init__ (line 37) | def __init__(self, method __repr__ (line 50) | def __repr__(self): method __len__ (line 53) | def __len__(self): method data (line 57) | def data(self): method datatype (line 61) | def datatype(self): method cpu_only (line 68) | def cpu_only(self): method stack (line 72) | def stack(self): method padding_value (line 76) | def padding_value(self): method pad_dims (line 80) | def pad_dims(self): method size (line 84) | def size(self, *args, **kwargs): method dim (line 88) | def dim(self): FILE: lavis/common/annotator/uniformer/mmcv/parallel/data_parallel.py class MMDataParallel (line 9) | class MMDataParallel(DataParallel): method __init__ (line 26) | def __init__(self, *args, dim=0, **kwargs): method forward (line 30) | def forward(self, *inputs, **kwargs): method scatter (line 44) | def scatter(self, inputs, kwargs, device_ids): method train_step (line 47) | def train_step(self, *inputs, **kwargs): method val_step (line 69) | def val_step(self, *inputs, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/parallel/distributed.py class MMDistributedDataParallel (line 11) | class MMDistributedDataParallel(DistributedDataParallel): method to_kwargs (line 21) | def to_kwargs(self, inputs, kwargs, device_id): method scatter (line 26) | def scatter(self, inputs, kwargs, device_ids): method train_step (line 29) | def train_step(self, *inputs, **kwargs): method val_step (line 72) | def val_step(self, *inputs, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/parallel/distributed_deprecated.py class MMDistributedDataParallel (line 14) | class MMDistributedDataParallel(nn.Module): method __init__ (line 16) | def __init__(self, method _dist_broadcast_coalesced (line 29) | def _dist_broadcast_coalesced(self, tensors, buffer_size): method _sync_params (line 37) | def _sync_params(self): method scatter (line 52) | def scatter(self, inputs, kwargs, device_ids): method forward (line 55) | def forward(self, *inputs, **kwargs): method train_step (line 60) | def train_step(self, *inputs, **kwargs): method val_step (line 66) | def val_step(self, *inputs, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/parallel/scatter_gather.py function scatter (line 9) | def scatter(inputs, target_gpus, dim=0): function scatter_kwargs (line 49) | def scatter_kwargs(inputs, kwargs, target_gpus, dim=0): FILE: lavis/common/annotator/uniformer/mmcv/parallel/utils.py function is_module_wrapper (line 5) | def is_module_wrapper(module): FILE: lavis/common/annotator/uniformer/mmcv/runner/base_module.py class BaseModule (line 14) | class BaseModule(nn.Module, metaclass=ABCMeta): method __init__ (line 33) | def __init__(self, init_cfg=None): method is_init (line 53) | def is_init(self): method init_weights (line 56) | def init_weights(self): method _dump_init_info (line 137) | def _dump_init_info(self, logger_name): method __repr__ (line 166) | def __repr__(self): class Sequential (line 173) | class Sequential(BaseModule, nn.Sequential): method __init__ (line 180) | def __init__(self, *args, init_cfg=None): class ModuleList (line 185) | class ModuleList(BaseModule, nn.ModuleList): method __init__ (line 193) | def __init__(self, modules=None, init_cfg=None): FILE: lavis/common/annotator/uniformer/mmcv/runner/base_runner.py class BaseRunner (line 21) | class BaseRunner(metaclass=ABCMeta): method __init__ (line 51) | def __init__(self, method model_name (line 139) | def model_name(self): method rank (line 144) | def rank(self): method world_size (line 149) | def world_size(self): method hooks (line 155) | def hooks(self): method epoch (line 160) | def epoch(self): method iter (line 165) | def iter(self): method inner_iter (line 170) | def inner_iter(self): method max_epochs (line 175) | def max_epochs(self): method max_iters (line 180) | def max_iters(self): method train (line 185) | def train(self): method val (line 189) | def val(self): method run (line 193) | def run(self, data_loaders, workflow, **kwargs): method save_checkpoint (line 197) | def save_checkpoint(self, method current_lr (line 205) | def current_lr(self): method current_momentum (line 224) | def current_momentum(self): method register_hook (line 255) | def register_hook(self, hook, priority='NORMAL'): method register_hook_from_cfg (line 283) | def register_hook_from_cfg(self, hook_cfg): method call_hook (line 299) | def call_hook(self, fn_name): method get_hook_info (line 309) | def get_hook_info(self): method load_checkpoint (line 332) | def load_checkpoint(self, method resume (line 345) | def resume(self, method register_lr_hook (line 399) | def register_lr_hook(self, lr_config): method register_momentum_hook (line 420) | def register_momentum_hook(self, momentum_config): method register_optimizer_hook (line 441) | def register_optimizer_hook(self, optimizer_config): method register_checkpoint_hook (line 451) | def register_checkpoint_hook(self, checkpoint_config): method register_logger_hooks (line 461) | def register_logger_hooks(self, log_config): method register_timer_hook (line 470) | def register_timer_hook(self, timer_config): method register_custom_hooks (line 480) | def register_custom_hooks(self, custom_config): method register_profiler_hook (line 493) | def register_profiler_hook(self, profiler_config): method register_training_hooks (line 503) | def register_training_hooks(self, FILE: lavis/common/annotator/uniformer/mmcv/runner/builder.py function build_runner_constructor (line 10) | def build_runner_constructor(cfg): function build_runner (line 14) | def build_runner(cfg, default_args=None): FILE: lavis/common/annotator/uniformer/mmcv/runner/checkpoint.py function _get_mmcv_home (line 30) | def _get_mmcv_home(): function load_state_dict (line 41) | def load_state_dict(module, state_dict, strict=False, logger=None): function get_torchvision_models (line 109) | def get_torchvision_models(): function get_external_models (line 121) | def get_external_models(): function get_mmcls_models (line 135) | def get_mmcls_models(): function get_deprecated_model_names (line 142) | def get_deprecated_model_names(): function _process_mmcls_checkpoint (line 151) | def _process_mmcls_checkpoint(checkpoint): class CheckpointLoader (line 162) | class CheckpointLoader: method _register_scheme (line 168) | def _register_scheme(cls, prefixes, loader, force=False): method register_scheme (line 185) | def register_scheme(cls, prefixes, loader=None, force=False): method _get_checkpoint_loader (line 211) | def _get_checkpoint_loader(cls, path): method load_checkpoint (line 227) | def load_checkpoint(cls, filename, map_location=None, logger=None): function load_from_local (line 249) | def load_from_local(filename, map_location): function load_from_http (line 267) | def load_from_http(filename, map_location=None, model_dir=None): function load_from_pavi (line 295) | def load_from_pavi(filename, map_location=None): function load_from_ceph (line 327) | def load_from_ceph(filename, map_location=None, backend='petrel'): function load_from_torchvision (line 368) | def load_from_torchvision(filename, map_location=None): function load_from_openmmlab (line 391) | def load_from_openmmlab(filename, map_location=None): function load_from_mmcls (line 431) | def load_from_mmcls(filename, map_location=None): function _load_checkpoint (line 450) | def _load_checkpoint(filename, map_location=None, logger=None): function _load_checkpoint_with_prefix (line 470) | def _load_checkpoint_with_prefix(prefix, filename, map_location=None): function load_checkpoint (line 503) | def load_checkpoint(model, function weights_to_cpu (line 553) | def weights_to_cpu(state_dict): function _save_to_state_dict (line 570) | def _save_to_state_dict(module, destination, prefix, keep_vars): function get_state_dict (line 590) | def get_state_dict(module, destination=None, prefix='', keep_vars=False): function save_checkpoint (line 634) | def save_checkpoint(model, FILE: lavis/common/annotator/uniformer/mmcv/runner/default_constructor.py class DefaultRunnerConstructor (line 5) | class DefaultRunnerConstructor: method __init__ (line 36) | def __init__(self, runner_cfg, default_args=None): method __call__ (line 43) | def __call__(self): FILE: lavis/common/annotator/uniformer/mmcv/runner/dist_utils.py function init_dist (line 14) | def init_dist(launcher, backend='nccl', **kwargs): function _init_dist_pytorch (line 27) | def _init_dist_pytorch(backend, **kwargs): function _init_dist_mpi (line 35) | def _init_dist_mpi(backend, **kwargs): function _init_dist_slurm (line 43) | def _init_dist_slurm(backend, port=None): function get_dist_info (line 78) | def get_dist_info(): function master_only (line 88) | def master_only(func): function allreduce_params (line 99) | def allreduce_params(params, coalesce=True, bucket_size_mb=-1): function allreduce_grads (line 121) | def allreduce_grads(params, coalesce=True, bucket_size_mb=-1): function _allreduce_coalesced (line 145) | def _allreduce_coalesced(tensors, world_size, bucket_size_mb=-1): FILE: lavis/common/annotator/uniformer/mmcv/runner/epoch_based_runner.py class EpochBasedRunner (line 18) | class EpochBasedRunner(BaseRunner): method run_iter (line 24) | def run_iter(self, data_batch, train_mode, **kwargs): method train (line 40) | def train(self, data_loader, **kwargs): method val (line 58) | def val(self, data_loader, **kwargs): method run (line 72) | def run(self, data_loaders, workflow, max_epochs=None, **kwargs): method save_checkpoint (line 132) | def save_checkpoint(self, class Runner (line 181) | class Runner(EpochBasedRunner): method __init__ (line 184) | def __init__(self, *args, **kwargs): FILE: lavis/common/annotator/uniformer/mmcv/runner/fp16_utils.py function cast_tensor_type (line 24) | def cast_tensor_type(inputs, src_type, dst_type): function auto_fp16 (line 55) | def auto_fp16(apply_to=None, out_fp32=False): function force_fp32 (line 141) | def force_fp32(apply_to=None, out_fp16=False): function allreduce_grads (line 227) | def allreduce_grads(params, coalesce=True, bucket_size_mb=-1): function wrap_fp16_model (line 234) | def wrap_fp16_model(model): function patch_norm_fp32 (line 263) | def patch_norm_fp32(module): function patch_forward_method (line 283) | def patch_forward_method(func, src_type, dst_type, convert_output=True): class LossScaler (line 306) | class LossScaler: method __init__ (line 335) | def __init__(self, method has_overflow (line 349) | def has_overflow(self, params): method _has_inf_or_nan (line 358) | def _has_inf_or_nan(x): method update_scale (line 372) | def update_scale(self, overflow): method state_dict (line 385) | def state_dict(self): method load_state_dict (line 395) | def load_state_dict(self, state_dict): method loss_scale (line 409) | def loss_scale(self): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/checkpoint.py class CheckpointHook (line 11) | class CheckpointHook(Hook): method __init__ (line 51) | def __init__(self, method before_run (line 71) | def before_run(self, runner): method after_train_epoch (line 102) | def after_train_epoch(self, runner): method _save_checkpoint (line 119) | def _save_checkpoint(self, runner): method after_train_iter (line 153) | def after_train_iter(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/closure.py class ClosureHook (line 6) | class ClosureHook(Hook): method __init__ (line 8) | def __init__(self, fn_name, fn): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/ema.py class EMAHook (line 7) | class EMAHook(Hook): method __init__ (line 29) | def __init__(self, method before_run (line 41) | def before_run(self, runner): method after_train_iter (line 60) | def after_train_iter(self, runner): method after_train_epoch (line 73) | def after_train_epoch(self, runner): method before_train_epoch (line 78) | def before_train_epoch(self, runner): method _swap_ema_parameters (line 83) | def _swap_ema_parameters(self): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/evaluation.py class EvalHook (line 16) | class EvalHook(Hook): method __init__ (line 85) | def __init__(self, method _init_rule (line 153) | def _init_rule(self, rule, key_indicator): method before_run (line 202) | def before_run(self, runner): method before_train_iter (line 228) | def before_train_iter(self, runner): method before_train_epoch (line 236) | def before_train_epoch(self, runner): method after_train_iter (line 244) | def after_train_iter(self, runner): method after_train_epoch (line 264) | def after_train_epoch(self, runner): method _do_evaluate (line 269) | def _do_evaluate(self, runner): method _should_evaluate (line 279) | def _should_evaluate(self, runner): method _save_ckpt (line 314) | def _save_ckpt(self, runner, key_score): method evaluate (line 354) | def evaluate(self, runner, results): class DistEvalHook (line 387) | class DistEvalHook(EvalHook): method __init__ (line 439) | def __init__(self, method _do_evaluate (line 478) | def _do_evaluate(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/hook.py class Hook (line 7) | class Hook: method before_run (line 13) | def before_run(self, runner): method after_run (line 16) | def after_run(self, runner): method before_epoch (line 19) | def before_epoch(self, runner): method after_epoch (line 22) | def after_epoch(self, runner): method before_iter (line 25) | def before_iter(self, runner): method after_iter (line 28) | def after_iter(self, runner): method before_train_epoch (line 31) | def before_train_epoch(self, runner): method before_val_epoch (line 34) | def before_val_epoch(self, runner): method after_train_epoch (line 37) | def after_train_epoch(self, runner): method after_val_epoch (line 40) | def after_val_epoch(self, runner): method before_train_iter (line 43) | def before_train_iter(self, runner): method before_val_iter (line 46) | def before_val_iter(self, runner): method after_train_iter (line 49) | def after_train_iter(self, runner): method after_val_iter (line 52) | def after_val_iter(self, runner): method every_n_epochs (line 55) | def every_n_epochs(self, runner, n): method every_n_inner_iters (line 58) | def every_n_inner_iters(self, runner, n): method every_n_iters (line 61) | def every_n_iters(self, runner, n): method end_of_epoch (line 64) | def end_of_epoch(self, runner): method is_last_epoch (line 67) | def is_last_epoch(self, runner): method is_last_iter (line 70) | def is_last_iter(self, runner): method get_triggered_stages (line 73) | def get_triggered_stages(self): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/iter_timer.py class IterTimerHook (line 8) | class IterTimerHook(Hook): method before_epoch (line 10) | def before_epoch(self, runner): method before_iter (line 13) | def before_iter(self, runner): method after_iter (line 16) | def after_iter(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/base.py class LoggerHook (line 11) | class LoggerHook(Hook): method __init__ (line 24) | def __init__(self, method log (line 35) | def log(self, runner): method is_scalar (line 39) | def is_scalar(val, include_np=True, include_torch=True): method get_mode (line 59) | def get_mode(self, runner): method get_epoch (line 72) | def get_epoch(self, runner): method get_iter (line 84) | def get_iter(self, runner, inner_iter=False): method get_lr_tags (line 92) | def get_lr_tags(self, runner): method get_momentum_tags (line 102) | def get_momentum_tags(self, runner): method get_loggable_tags (line 112) | def get_loggable_tags(self, method before_run (line 133) | def before_run(self, runner): method before_epoch (line 139) | def before_epoch(self, runner): method after_train_iter (line 142) | def after_train_iter(self, runner): method after_train_epoch (line 156) | def after_train_epoch(self, runner): method after_val_epoch (line 162) | def after_val_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/dvclive.py class DvcliveLoggerHook (line 8) | class DvcliveLoggerHook(LoggerHook): method __init__ (line 29) | def __init__(self, method import_dvclive (line 41) | def import_dvclive(self): method before_run (line 50) | def before_run(self, runner): method log (line 54) | def log(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/mlflow.py class MlflowLoggerHook (line 8) | class MlflowLoggerHook(LoggerHook): method __init__ (line 10) | def __init__(self, method import_mlflow (line 51) | def import_mlflow(self): method before_run (line 62) | def before_run(self, runner): method log (line 70) | def log(self, runner): method after_run (line 76) | def after_run(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/neptune.py class NeptuneLoggerHook (line 8) | class NeptuneLoggerHook(LoggerHook): method __init__ (line 38) | def __init__(self, method import_neptune (line 52) | def import_neptune(self): method before_run (line 62) | def before_run(self, runner): method log (line 69) | def log(self, runner): method after_run (line 81) | def after_run(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/pavi.py class PaviLoggerHook (line 17) | class PaviLoggerHook(LoggerHook): method __init__ (line 19) | def __init__(self, method before_run (line 36) | def before_run(self, runner): method get_step (line 74) | def get_step(self, runner): method log (line 82) | def log(self, runner): method after_run (line 89) | def after_run(self, runner): method before_epoch (line 107) | def before_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/tensorboard.py class TensorboardLoggerHook (line 11) | class TensorboardLoggerHook(LoggerHook): method __init__ (line 13) | def __init__(self, method before_run (line 24) | def before_run(self, runner): method log (line 47) | def log(self, runner): method after_run (line 56) | def after_run(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/text.py class TextLoggerHook (line 18) | class TextLoggerHook(LoggerHook): method __init__ (line 55) | def __init__(self, method before_run (line 89) | def before_run(self, runner): method _get_max_memory (line 109) | def _get_max_memory(self, runner): method _log_info (line 119) | def _log_info(self, log_dict, runner): method _dump_log (line 185) | def _dump_log(self, log_dict, runner): method _round_float (line 196) | def _round_float(self, items): method log (line 204) | def log(self, runner): method after_run (line 238) | def after_run(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/logger/wandb.py class WandbLoggerHook (line 8) | class WandbLoggerHook(LoggerHook): method __init__ (line 10) | def __init__(self, method import_wandb (line 25) | def import_wandb(self): method before_run (line 34) | def before_run(self, runner): method log (line 44) | def log(self, runner): method after_run (line 55) | def after_run(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/lr_updater.py class LrUpdaterHook (line 9) | class LrUpdaterHook(Hook): method __init__ (line 25) | def __init__(self, method _set_lr (line 58) | def _set_lr(self, runner, lr_groups): method get_lr (line 68) | def get_lr(self, runner, base_lr): method get_regular_lr (line 71) | def get_regular_lr(self, runner): method get_warmup_lr (line 85) | def get_warmup_lr(self, cur_iters): method before_run (line 107) | def before_run(self, runner): method before_train_epoch (line 126) | def before_train_epoch(self, runner): method before_train_iter (line 137) | def before_train_iter(self, runner): class FixedLrUpdaterHook (line 157) | class FixedLrUpdaterHook(LrUpdaterHook): method __init__ (line 159) | def __init__(self, **kwargs): method get_lr (line 162) | def get_lr(self, runner, base_lr): class StepLrUpdaterHook (line 167) | class StepLrUpdaterHook(LrUpdaterHook): method __init__ (line 180) | def __init__(self, step, gamma=0.1, min_lr=None, **kwargs): method get_lr (line 193) | def get_lr(self, runner, base_lr): class ExpLrUpdaterHook (line 214) | class ExpLrUpdaterHook(LrUpdaterHook): method __init__ (line 216) | def __init__(self, gamma, **kwargs): method get_lr (line 220) | def get_lr(self, runner, base_lr): class PolyLrUpdaterHook (line 226) | class PolyLrUpdaterHook(LrUpdaterHook): method __init__ (line 228) | def __init__(self, power=1., min_lr=0., **kwargs): method get_lr (line 233) | def get_lr(self, runner, base_lr): class InvLrUpdaterHook (line 245) | class InvLrUpdaterHook(LrUpdaterHook): method __init__ (line 247) | def __init__(self, gamma, power=1., **kwargs): method get_lr (line 252) | def get_lr(self, runner, base_lr): class CosineAnnealingLrUpdaterHook (line 258) | class CosineAnnealingLrUpdaterHook(LrUpdaterHook): method __init__ (line 260) | def __init__(self, min_lr=None, min_lr_ratio=None, **kwargs): method get_lr (line 266) | def get_lr(self, runner, base_lr): class FlatCosineAnnealingLrUpdaterHook (line 282) | class FlatCosineAnnealingLrUpdaterHook(LrUpdaterHook): method __init__ (line 298) | def __init__(self, method get_lr (line 314) | def get_lr(self, runner, base_lr): class CosineRestartLrUpdaterHook (line 336) | class CosineRestartLrUpdaterHook(LrUpdaterHook): method __init__ (line 349) | def __init__(self, method get_lr (line 368) | def get_lr(self, runner, base_lr): function get_position_from_periods (line 388) | def get_position_from_periods(iteration, cumulative_periods): class CyclicLrUpdaterHook (line 412) | class CyclicLrUpdaterHook(LrUpdaterHook): method __init__ (line 434) | def __init__(self, method before_run (line 472) | def before_run(self, runner): method get_lr (line 485) | def get_lr(self, runner, base_lr): class OneCycleLrUpdaterHook (line 498) | class OneCycleLrUpdaterHook(LrUpdaterHook): method __init__ (line 532) | def __init__(self, method before_run (line 575) | def before_run(self, runner): method get_lr (line 614) | def get_lr(self, runner, base_lr): function annealing_cos (line 627) | def annealing_cos(start, end, factor, weight=1): function annealing_linear (line 645) | def annealing_linear(start, end, factor): function format_param (line 659) | def format_param(name, optim, param): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/memory.py class EmptyCacheHook (line 8) | class EmptyCacheHook(Hook): method __init__ (line 10) | def __init__(self, before_epoch=False, after_epoch=True, after_iter=Fa... method after_iter (line 15) | def after_iter(self, runner): method before_epoch (line 19) | def before_epoch(self, runner): method after_epoch (line 23) | def after_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/momentum_updater.py class MomentumUpdaterHook (line 7) | class MomentumUpdaterHook(Hook): method __init__ (line 9) | def __init__(self, method _set_momentum (line 35) | def _set_momentum(self, runner, momentum_groups): method get_momentum (line 52) | def get_momentum(self, runner, base_momentum): method get_regular_momentum (line 55) | def get_regular_momentum(self, runner): method get_warmup_momentum (line 71) | def get_warmup_momentum(self, cur_iters): method before_run (line 101) | def before_run(self, runner): method before_train_epoch (line 128) | def before_train_epoch(self, runner): method before_train_iter (line 134) | def before_train_iter(self, runner): class StepMomentumUpdaterHook (line 154) | class StepMomentumUpdaterHook(MomentumUpdaterHook): method __init__ (line 168) | def __init__(self, step, gamma=0.5, min_momentum=None, **kwargs): method get_momentum (line 181) | def get_momentum(self, runner, base_momentum): class CosineAnnealingMomentumUpdaterHook (line 202) | class CosineAnnealingMomentumUpdaterHook(MomentumUpdaterHook): method __init__ (line 204) | def __init__(self, min_momentum=None, min_momentum_ratio=None, **kwargs): method get_momentum (line 210) | def get_momentum(self, runner, base_momentum): class CyclicMomentumUpdaterHook (line 226) | class CyclicMomentumUpdaterHook(MomentumUpdaterHook): method __init__ (line 244) | def __init__(self, method before_run (line 273) | def before_run(self, runner): method get_momentum (line 286) | def get_momentum(self, runner, base_momentum): class OneCycleMomentumUpdaterHook (line 299) | class OneCycleMomentumUpdaterHook(MomentumUpdaterHook): method __init__ (line 333) | def __init__(self, method before_run (line 371) | def before_run(self, runner): method _set_momentum (line 448) | def _set_momentum(self, runner, momentum_groups): method get_momentum (line 465) | def get_momentum(self, runner, param_group): method get_regular_momentum (line 479) | def get_regular_momentum(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/optimizer.py class OptimizerHook (line 22) | class OptimizerHook(Hook): method __init__ (line 24) | def __init__(self, grad_clip=None): method clip_grads (line 27) | def clip_grads(self, params): method after_train_iter (line 33) | def after_train_iter(self, runner): class GradientCumulativeOptimizerHook (line 46) | class GradientCumulativeOptimizerHook(OptimizerHook): method __init__ (line 64) | def __init__(self, cumulative_iters=1, **kwargs): method has_batch_norm (line 76) | def has_batch_norm(self, module): method _init (line 84) | def _init(self, runner): method after_train_iter (line 105) | def after_train_iter(self, runner): class Fp16OptimizerHook (line 134) | class Fp16OptimizerHook(OptimizerHook): method __init__ (line 162) | def __init__(self, method before_run (line 184) | def before_run(self, runner): method copy_grads_to_fp32 (line 193) | def copy_grads_to_fp32(self, fp16_net, fp32_weights): method copy_params_to_fp16 (line 203) | def copy_params_to_fp16(self, fp16_net, fp32_weights): method after_train_iter (line 209) | def after_train_iter(self, runner): method __init__ (line 318) | def __init__(self, method before_run (line 339) | def before_run(self, runner): method copy_grads_to_fp32 (line 367) | def copy_grads_to_fp32(self, fp16_net, fp32_weights): method copy_params_to_fp16 (line 377) | def copy_params_to_fp16(self, fp16_net, fp32_weights): method after_train_iter (line 383) | def after_train_iter(self, runner): class GradientCumulativeFp16OptimizerHook (line 242) | class GradientCumulativeFp16OptimizerHook(GradientCumulativeOptimizerHook, method __init__ (line 251) | def __init__(self, *args, **kwargs): method after_train_iter (line 255) | def after_train_iter(self, runner): method __init__ (line 444) | def __init__(self, *args, **kwargs): method after_train_iter (line 448) | def after_train_iter(self, runner): class Fp16OptimizerHook (line 297) | class Fp16OptimizerHook(OptimizerHook): method __init__ (line 162) | def __init__(self, method before_run (line 184) | def before_run(self, runner): method copy_grads_to_fp32 (line 193) | def copy_grads_to_fp32(self, fp16_net, fp32_weights): method copy_params_to_fp16 (line 203) | def copy_params_to_fp16(self, fp16_net, fp32_weights): method after_train_iter (line 209) | def after_train_iter(self, runner): method __init__ (line 318) | def __init__(self, method before_run (line 339) | def before_run(self, runner): method copy_grads_to_fp32 (line 367) | def copy_grads_to_fp32(self, fp16_net, fp32_weights): method copy_params_to_fp16 (line 377) | def copy_params_to_fp16(self, fp16_net, fp32_weights): method after_train_iter (line 383) | def after_train_iter(self, runner): class GradientCumulativeFp16OptimizerHook (line 439) | class GradientCumulativeFp16OptimizerHook(GradientCumulativeOptimizerHook, method __init__ (line 251) | def __init__(self, *args, **kwargs): method after_train_iter (line 255) | def after_train_iter(self, runner): method __init__ (line 444) | def __init__(self, *args, **kwargs): method after_train_iter (line 448) | def after_train_iter(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/profiler.py class ProfilerHook (line 12) | class ProfilerHook(Hook): method __init__ (line 55) | def __init__(self, method before_run (line 107) | def before_run(self, runner): method after_train_epoch (line 166) | def after_train_epoch(self, runner): method after_train_iter (line 174) | def after_train_iter(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/sampler_seed.py class DistSamplerSeedHook (line 6) | class DistSamplerSeedHook(Hook): method before_epoch (line 14) | def before_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/hooks/sync_buffer.py class SyncBuffersHook (line 7) | class SyncBuffersHook(Hook): method __init__ (line 16) | def __init__(self, distributed=True): method after_epoch (line 19) | def after_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmcv/runner/iter_based_runner.py class IterLoader (line 19) | class IterLoader: method __init__ (line 21) | def __init__(self, dataloader): method epoch (line 27) | def epoch(self): method __next__ (line 30) | def __next__(self): method __len__ (line 43) | def __len__(self): class IterBasedRunner (line 48) | class IterBasedRunner(BaseRunner): method train (line 54) | def train(self, data_loader, **kwargs): method val (line 72) | def val(self, data_loader, **kwargs): method run (line 87) | def run(self, data_loaders, workflow, max_iters=None, **kwargs): method resume (line 140) | def resume(self, method save_checkpoint (line 179) | def save_checkpoint(self, method register_training_hooks (line 224) | def register_training_hooks(self, FILE: lavis/common/annotator/uniformer/mmcv/runner/log_buffer.py class LogBuffer (line 7) | class LogBuffer: method __init__ (line 9) | def __init__(self): method clear (line 15) | def clear(self): method clear_output (line 20) | def clear_output(self): method update (line 24) | def update(self, vars, count=1): method average (line 33) | def average(self, n=0): FILE: lavis/common/annotator/uniformer/mmcv/runner/optimizer/builder.py function register_torch_optimizers (line 13) | def register_torch_optimizers(): function build_optimizer_constructor (line 29) | def build_optimizer_constructor(cfg): function build_optimizer (line 33) | def build_optimizer(model, cfg): FILE: lavis/common/annotator/uniformer/mmcv/runner/optimizer/default_constructor.py class DefaultOptimizerConstructor (line 13) | class DefaultOptimizerConstructor: method __init__ (line 95) | def __init__(self, optimizer_cfg, paramwise_cfg=None): method _validate_cfg (line 105) | def _validate_cfg(self): method _is_in (line 128) | def _is_in(self, param_group, param_group_list): method add_params (line 137) | def add_params(self, params, module, prefix='', is_dcn_module=None): method __call__ (line 234) | def __call__(self, model): FILE: lavis/common/annotator/uniformer/mmcv/runner/priority.py class Priority (line 5) | class Priority(Enum): function get_priority (line 42) | def get_priority(priority): FILE: lavis/common/annotator/uniformer/mmcv/runner/utils.py function get_host_info (line 16) | def get_host_info(): function get_time_str (line 31) | def get_time_str(): function obj_from_dict (line 35) | def obj_from_dict(info, parent=None, default_args=None): function set_random_seed (line 70) | def set_random_seed(seed, deterministic=False, use_rank_shift=False): FILE: lavis/common/annotator/uniformer/mmcv/utils/config.py class ConfigDict (line 33) | class ConfigDict(Dict): method __missing__ (line 35) | def __missing__(self, name): method __getattr__ (line 38) | def __getattr__(self, name): function add_args (line 51) | def add_args(parser, cfg, prefix=''): class Config (line 70) | class Config: method _validate_py_syntax (line 96) | def _validate_py_syntax(filename): method _substitute_predefined_vars (line 107) | def _substitute_predefined_vars(filename, temp_config_name): method _pre_substitute_base_vars (line 128) | def _pre_substitute_base_vars(filename, temp_config_name): method _substitute_base_vars (line 147) | def _substitute_base_vars(cfg, base_var_dict, base_cfg): method _file2dict (line 179) | def _file2dict(filename, use_predefined_variables=True): method _merge_a_into_b (line 274) | def _merge_a_into_b(a, b, allow_list_keys=False): method fromfile (line 328) | def fromfile(filename, method fromstring (line 338) | def fromstring(cfg_str, file_format): method auto_argparser (line 366) | def auto_argparser(description=None): method __init__ (line 377) | def __init__(self, cfg_dict=None, cfg_text=None, filename=None): method filename (line 399) | def filename(self): method text (line 403) | def text(self): method pretty_text (line 407) | def pretty_text(self): method __repr__ (line 500) | def __repr__(self): method __len__ (line 503) | def __len__(self): method __getattr__ (line 506) | def __getattr__(self, name): method __getitem__ (line 509) | def __getitem__(self, name): method __setattr__ (line 512) | def __setattr__(self, name, value): method __setitem__ (line 517) | def __setitem__(self, name, value): method __iter__ (line 522) | def __iter__(self): method __getstate__ (line 525) | def __getstate__(self): method __setstate__ (line 528) | def __setstate__(self, state): method dump (line 534) | def dump(self, file=None): method merge_from_dict (line 550) | def merge_from_dict(self, options, allow_list_keys=True): class DictAction (line 597) | class DictAction(Action): method _parse_int_float_bool (line 607) | def _parse_int_float_bool(val): method _parse_iterable (line 621) | def _parse_iterable(val): method __call__ (line 683) | def __call__(self, parser, namespace, values, option_string=None): FILE: lavis/common/annotator/uniformer/mmcv/utils/env.py function collect_env (line 16) | def collect_env(): FILE: lavis/common/annotator/uniformer/mmcv/utils/ext_loader.py function load_ext (line 12) | def load_ext(name, funcs): function get_fake_func (line 41) | def get_fake_func(name, e): function load_ext (line 49) | def load_ext(name, funcs): function check_ops_exist (line 69) | def check_ops_exist(): FILE: lavis/common/annotator/uniformer/mmcv/utils/logging.py function get_logger (line 9) | def get_logger(name, log_file=None, log_level=logging.INFO, file_mode='w'): function print_log (line 85) | def print_log(msg, logger=None, level=logging.INFO): FILE: lavis/common/annotator/uniformer/mmcv/utils/misc.py function _ntuple (line 14) | def _ntuple(n): function is_str (line 31) | def is_str(x): function import_modules_from_strings (line 39) | def import_modules_from_strings(imports, allow_failed_imports=False): function iter_cast (line 87) | def iter_cast(inputs, dst_type, return_type=None): function list_cast (line 112) | def list_cast(inputs, dst_type): function tuple_cast (line 120) | def tuple_cast(inputs, dst_type): function is_seq_of (line 128) | def is_seq_of(seq, expected_type, seq_type=None): function is_list_of (line 152) | def is_list_of(seq, expected_type): function is_tuple_of (line 160) | def is_tuple_of(seq, expected_type): function slice_list (line 168) | def slice_list(in_list, lens): function concat_list (line 194) | def concat_list(in_list): function check_prerequisites (line 206) | def check_prerequisites( function _check_py_package (line 244) | def _check_py_package(package): function _check_executable (line 253) | def _check_executable(cmd): function requires_package (line 260) | def requires_package(prerequisites): function requires_executable (line 276) | def requires_executable(prerequisites): function deprecated_api_warning (line 288) | def deprecated_api_warning(name_dict, cls_name=None): function is_method_overridden (line 348) | def is_method_overridden(method, base_class, derived_class): function has_method (line 367) | def has_method(obj: object, method: str) -> bool: FILE: lavis/common/annotator/uniformer/mmcv/utils/parrots_jit.py function jit (line 12) | def jit(func=None, function skip_no_elena (line 36) | def skip_no_elena(func): FILE: lavis/common/annotator/uniformer/mmcv/utils/parrots_wrapper.py function is_rocm_pytorch (line 9) | def is_rocm_pytorch() -> bool: function _get_cuda_home (line 21) | def _get_cuda_home(): function get_build_config (line 33) | def get_build_config(): function _get_conv (line 41) | def _get_conv(): function _get_dataloader (line 49) | def _get_dataloader(): function _get_extension (line 58) | def _get_extension(): function _get_pool (line 69) | def _get_pool(): function _get_norm (line 81) | def _get_norm(): class SyncBatchNorm (line 99) | class SyncBatchNorm(SyncBatchNorm_): method _check_input_dim (line 101) | def _check_input_dim(self, input): FILE: lavis/common/annotator/uniformer/mmcv/utils/path.py function is_filepath (line 9) | def is_filepath(x): function fopen (line 13) | def fopen(filepath, *args, **kwargs): function check_file_exist (line 21) | def check_file_exist(filename, msg_tmpl='file "{}" does not exist'): function mkdir_or_exist (line 26) | def mkdir_or_exist(dir_name, mode=0o777): function symlink (line 33) | def symlink(src, dst, overwrite=True, **kwargs): function scandir (line 39) | def scandir(dir_path, suffix=None, recursive=False, case_sensitive=True): function find_vcs_root (line 83) | def find_vcs_root(path, markers=('.git', )): FILE: lavis/common/annotator/uniformer/mmcv/utils/progressbar.py class ProgressBar (line 10) | class ProgressBar: method __init__ (line 13) | def __init__(self, task_num=0, bar_width=50, start=True, file=sys.stdo... method terminal_width (line 22) | def terminal_width(self): method start (line 26) | def start(self): method update (line 35) | def update(self, num_tasks=1): function track_progress (line 64) | def track_progress(func, tasks, bar_width=50, file=sys.stdout, **kwargs): function init_pool (line 98) | def init_pool(process_num, initializer=None, initargs=None): function track_parallel_progress (line 109) | def track_parallel_progress(func, function track_iter_progress (line 179) | def track_iter_progress(tasks, bar_width=50, file=sys.stdout): FILE: lavis/common/annotator/uniformer/mmcv/utils/registry.py function build_from_cfg (line 9) | def build_from_cfg(cfg, registry, default_args=None): class Registry (line 58) | class Registry: method __init__ (line 88) | def __init__(self, name, build_func=None, parent=None, scope=None): method __len__ (line 112) | def __len__(self): method __contains__ (line 115) | def __contains__(self, key): method __repr__ (line 118) | def __repr__(self): method infer_scope (line 125) | def infer_scope(): method split_scope_key (line 149) | def split_scope_key(key): method name (line 171) | def name(self): method scope (line 175) | def scope(self): method module_dict (line 179) | def module_dict(self): method children (line 183) | def children(self): method get (line 186) | def get(self, key): method build (line 211) | def build(self, *args, **kwargs): method _add_children (line 214) | def _add_children(self, registry): method _register_module (line 235) | def _register_module(self, module_class, module_name=None, force=False): method deprecated_register_module (line 250) | def deprecated_register_module(self, cls=None, force=False): method register_module (line 260) | def register_module(self, name=None, force=False, module=None): FILE: lavis/common/annotator/uniformer/mmcv/utils/testing.py function check_python_script (line 10) | def check_python_script(cmd): function _any (line 25) | def _any(judge_result): function assert_dict_contains_subset (line 42) | def assert_dict_contains_subset(dict_obj: Dict[Any, Any], function assert_attrs_equal (line 61) | def assert_attrs_equal(obj: Any, expected_attrs: Dict[str, Any]) -> bool: function assert_dict_has_keys (line 77) | def assert_dict_has_keys(obj: Dict[str, Any], function assert_keys_equal (line 92) | def assert_keys_equal(result_keys: List[str], target_keys: List[str]) ->... function assert_is_norm_layer (line 105) | def assert_is_norm_layer(module) -> bool: function assert_params_all_zeros (line 120) | def assert_params_all_zeros(module) -> bool: FILE: lavis/common/annotator/uniformer/mmcv/utils/timer.py class TimerError (line 5) | class TimerError(Exception): method __init__ (line 7) | def __init__(self, message): class Timer (line 12) | class Timer: method __init__ (line 38) | def __init__(self, start=True, print_tmpl=None): method is_running (line 45) | def is_running(self): method __enter__ (line 49) | def __enter__(self): method __exit__ (line 53) | def __exit__(self, type, value, traceback): method start (line 57) | def start(self): method since_start (line 64) | def since_start(self): method since_last_check (line 74) | def since_last_check(self): function check_time (line 92) | def check_time(timer_id): FILE: lavis/common/annotator/uniformer/mmcv/utils/trace.py function is_jit_tracing (line 8) | def is_jit_tracing() -> bool: FILE: lavis/common/annotator/uniformer/mmcv/utils/version_utils.py function digit_version (line 9) | def digit_version(version_str: str, length: int = 4): function _minimal_ext_cmd (line 50) | def _minimal_ext_cmd(cmd): function get_git_hash (line 66) | def get_git_hash(fallback='unknown', digits=None): FILE: lavis/common/annotator/uniformer/mmcv/version.py function parse_version_info (line 5) | def parse_version_info(version_str: str, length: int = 4) -> tuple: FILE: lavis/common/annotator/uniformer/mmcv/video/io.py class Cache (line 14) | class Cache: method __init__ (line 16) | def __init__(self, capacity): method capacity (line 23) | def capacity(self): method size (line 27) | def size(self): method put (line 30) | def put(self, key, val): method get (line 37) | def get(self, key, default=None): class VideoReader (line 42) | class VideoReader: method __init__ (line 64) | def __init__(self, filename, cache_capacity=10): method vcap (line 80) | def vcap(self): method opened (line 85) | def opened(self): method width (line 90) | def width(self): method height (line 95) | def height(self): method resolution (line 100) | def resolution(self): method fps (line 105) | def fps(self): method frame_cnt (line 110) | def frame_cnt(self): method fourcc (line 115) | def fourcc(self): method position (line 120) | def position(self): method _get_real_position (line 124) | def _get_real_position(self): method _set_real_position (line 127) | def _set_real_position(self, frame_id): method read (line 134) | def read(self): method get_frame (line 160) | def get_frame(self, frame_id): method current_frame (line 187) | def current_frame(self): method cvt2frames (line 198) | def cvt2frames(self, method __len__ (line 240) | def __len__(self): method __getitem__ (line 243) | def __getitem__(self, index): method __iter__ (line 256) | def __iter__(self): method __next__ (line 260) | def __next__(self): method __enter__ (line 269) | def __enter__(self): method __exit__ (line 272) | def __exit__(self, exc_type, exc_value, traceback): function frames2video (line 276) | def frames2video(frame_dir, FILE: lavis/common/annotator/uniformer/mmcv/video/optflow.py function flowread (line 12) | def flowread(flow_or_path, quantize=False, concat_axis=0, *args, **kwargs): function flowwrite (line 61) | def flowwrite(flow, filename, quantize=False, concat_axis=0, *args, **kw... function quantize_flow (line 91) | def quantize_flow(flow, max_val=0.02, norm=True): function dequantize_flow (line 119) | def dequantize_flow(dx, dy, max_val=0.02, denorm=True): function flow_warp (line 143) | def flow_warp(img, flow, filling_value=0, interpolate_mode='nearest'): function flow_from_bytes (line 204) | def flow_from_bytes(content): function sparse_flow_from_bytes (line 234) | def sparse_flow_from_bytes(content): FILE: lavis/common/annotator/uniformer/mmcv/video/processing.py function convert_video (line 11) | def convert_video(in_file, function resize_video (line 55) | def resize_video(in_file, function cut_video (line 93) | def cut_video(in_file, function concat_video (line 128) | def concat_video(video_list, FILE: lavis/common/annotator/uniformer/mmcv/visualization/color.py class Color (line 9) | class Color(Enum): function color_val (line 24) | def color_val(color): FILE: lavis/common/annotator/uniformer/mmcv/visualization/image.py function imshow (line 9) | def imshow(img, win_name='', wait_time=0): function imshow_bboxes (line 30) | def imshow_bboxes(img, function imshow_det_bboxes (line 84) | def imshow_det_bboxes(img, FILE: lavis/common/annotator/uniformer/mmcv/visualization/optflow.py function flowshow (line 11) | def flowshow(flow, win_name='', wait_time=0): function flow2rgb (line 24) | def flow2rgb(flow, color_wheel=None, unknown_thr=1e6): function make_color_wheel (line 76) | def make_color_wheel(bins=None): FILE: lavis/common/annotator/uniformer/mmcv_custom/checkpoint.py function _get_mmcv_home (line 30) | def _get_mmcv_home(): function load_state_dict (line 41) | def load_state_dict(module, state_dict, strict=False, logger=None): function load_url_dist (line 109) | def load_url_dist(url, model_dir=None): function load_pavimodel_dist (line 123) | def load_pavimodel_dist(model_path, map_location=None): function load_fileclient_dist (line 151) | def load_fileclient_dist(filename, backend, map_location): function get_torchvision_models (line 172) | def get_torchvision_models(): function get_external_models (line 184) | def get_external_models(): function get_mmcls_models (line 198) | def get_mmcls_models(): function get_deprecated_model_names (line 205) | def get_deprecated_model_names(): function _process_mmcls_checkpoint (line 214) | def _process_mmcls_checkpoint(checkpoint): function _load_checkpoint (line 225) | def _load_checkpoint(filename, map_location=None): function load_checkpoint (line 286) | def load_checkpoint(model, function weights_to_cpu (line 359) | def weights_to_cpu(state_dict): function _save_to_state_dict (line 374) | def _save_to_state_dict(module, destination, prefix, keep_vars): function get_state_dict (line 394) | def get_state_dict(module, destination=None, prefix='', keep_vars=False): function save_checkpoint (line 438) | def save_checkpoint(model, filename, optimizer=None, meta=None): FILE: lavis/common/annotator/uniformer/mmseg/apis/inference.py function init_segmentor (line 11) | def init_segmentor(config, checkpoint=None, device='cuda:0'): class LoadImage (line 42) | class LoadImage: method __call__ (line 45) | def __call__(self, results): function inference_segmentor (line 69) | def inference_segmentor(model, img): function show_result_pyplot (line 101) | def show_result_pyplot(model, FILE: lavis/common/annotator/uniformer/mmseg/apis/test.py function np2tmp (line 14) | def np2tmp(array, temp_file_name=None): function single_gpu_test (line 34) | def single_gpu_test(model, function multi_gpu_test (line 106) | def multi_gpu_test(model, function collect_results_cpu (line 164) | def collect_results_cpu(result_part, size, tmpdir=None): function collect_results_gpu (line 207) | def collect_results_gpu(result_part, size): FILE: lavis/common/annotator/uniformer/mmseg/apis/train.py function set_random_seed (line 14) | def set_random_seed(seed, deterministic=False): function train_segmentor (line 33) | def train_segmentor(model, FILE: lavis/common/annotator/uniformer/mmseg/core/evaluation/class_names.py function cityscapes_classes (line 4) | def cityscapes_classes(): function ade_classes (line 14) | def ade_classes(): function voc_classes (line 44) | def voc_classes(): function cityscapes_palette (line 54) | def cityscapes_palette(): function ade_palette (line 63) | def ade_palette(): function voc_palette (line 105) | def voc_palette(): function get_classes (line 121) | def get_classes(dataset): function get_palette (line 138) | def get_palette(dataset): FILE: lavis/common/annotator/uniformer/mmseg/core/evaluation/eval_hooks.py class EvalHook (line 7) | class EvalHook(_EvalHook): method __init__ (line 22) | def __init__(self, *args, by_epoch=False, efficient_test=False, **kwar... method after_train_iter (line 26) | def after_train_iter(self, runner): method after_train_epoch (line 42) | def after_train_epoch(self, runner): class DistEvalHook (line 55) | class DistEvalHook(_DistEvalHook): method __init__ (line 70) | def __init__(self, *args, by_epoch=False, efficient_test=False, **kwar... method after_train_iter (line 74) | def after_train_iter(self, runner): method after_train_epoch (line 93) | def after_train_epoch(self, runner): FILE: lavis/common/annotator/uniformer/mmseg/core/evaluation/metrics.py function f_score (line 8) | def f_score(precision, recall, beta=1): function intersect_and_union (line 25) | def intersect_and_union(pred_label, function total_intersect_and_union (line 88) | def total_intersect_and_union(results, function mean_iou (line 133) | def mean_iou(results, function mean_dice (line 172) | def mean_dice(results, function mean_fscore (line 212) | def mean_fscore(results, function eval_metrics (line 257) | def eval_metrics(results, FILE: lavis/common/annotator/uniformer/mmseg/core/seg/builder.py function build_pixel_sampler (line 6) | def build_pixel_sampler(cfg, **default_args): FILE: lavis/common/annotator/uniformer/mmseg/core/seg/sampler/base_pixel_sampler.py class BasePixelSampler (line 4) | class BasePixelSampler(metaclass=ABCMeta): method __init__ (line 7) | def __init__(self, **kwargs): method sample (line 11) | def sample(self, seg_logit, seg_label): FILE: lavis/common/annotator/uniformer/mmseg/core/seg/sampler/ohem_pixel_sampler.py class OHEMPixelSampler (line 9) | class OHEMPixelSampler(BasePixelSampler): method __init__ (line 23) | def __init__(self, context, thresh=None, min_kept=100000): method sample (line 30) | def sample(self, seg_logit, seg_label): FILE: lavis/common/annotator/uniformer/mmseg/core/utils/misc.py function add_prefix (line 1) | def add_prefix(inputs, prefix): FILE: lavis/common/annotator/uniformer/mmseg/datasets/ade.py class ADE20KDataset (line 6) | class ADE20KDataset(CustomDataset): method __init__ (line 79) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/builder.py function _concat_dataset (line 25) | def _concat_dataset(cfg, default_args=None): function build_dataset (line 61) | def build_dataset(cfg, default_args=None): function build_dataloader (line 78) | def build_dataloader(dataset, function worker_init_fn (line 155) | def worker_init_fn(worker_id, num_workers, rank, seed): FILE: lavis/common/annotator/uniformer/mmseg/datasets/chase_db1.py class ChaseDB1Dataset (line 8) | class ChaseDB1Dataset(CustomDataset): method __init__ (line 21) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/cityscapes.py class CityscapesDataset (line 14) | class CityscapesDataset(CustomDataset): method __init__ (line 32) | def __init__(self, **kwargs): method _convert_to_label_id (line 39) | def _convert_to_label_id(result): method results2img (line 50) | def results2img(self, results, imgfile_prefix, to_label_id): method format_results (line 91) | def format_results(self, results, imgfile_prefix=None, to_label_id=True): method evaluate (line 124) | def evaluate(self, method _evaluate_cityscapes (line 164) | def _evaluate_cityscapes(self, results, logger, imgfile_prefix): FILE: lavis/common/annotator/uniformer/mmseg/datasets/custom.py class CustomDataset (line 19) | class CustomDataset(Dataset): method __init__ (line 75) | def __init__(self, method __len__ (line 116) | def __len__(self): method load_annotations (line 120) | def load_annotations(self, img_dir, img_suffix, ann_dir, seg_map_suffix, method get_ann_info (line 158) | def get_ann_info(self, idx): method pre_pipeline (line 170) | def pre_pipeline(self, results): method __getitem__ (line 178) | def __getitem__(self, idx): method prepare_train_img (line 194) | def prepare_train_img(self, idx): method prepare_test_img (line 211) | def prepare_test_img(self, idx): method format_results (line 227) | def format_results(self, results, **kwargs): method get_gt_seg_maps (line 230) | def get_gt_seg_maps(self, efficient_test=False): method get_classes_and_palette (line 243) | def get_classes_and_palette(self, classes=None, palette=None): method get_palette_for_custom_classes (line 287) | def get_palette_for_custom_classes(self, class_names, palette=None): method evaluate (line 306) | def evaluate(self, FILE: lavis/common/annotator/uniformer/mmseg/datasets/dataset_wrappers.py class ConcatDataset (line 7) | class ConcatDataset(_ConcatDataset): method __init__ (line 17) | def __init__(self, datasets): class RepeatDataset (line 24) | class RepeatDataset(object): method __init__ (line 37) | def __init__(self, dataset, times): method __getitem__ (line 44) | def __getitem__(self, idx): method __len__ (line 48) | def __len__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/drive.py class DRIVEDataset (line 8) | class DRIVEDataset(CustomDataset): method __init__ (line 21) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/hrf.py class HRFDataset (line 8) | class HRFDataset(CustomDataset): method __init__ (line 21) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pascal_context.py class PascalContextDataset (line 8) | class PascalContextDataset(CustomDataset): method __init__ (line 47) | def __init__(self, split, **kwargs): class PascalContextDataset59 (line 58) | class PascalContextDataset59(CustomDataset): method __init__ (line 96) | def __init__(self, split, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pipelines/compose.py class Compose (line 9) | class Compose(object): method __init__ (line 17) | def __init__(self, transforms): method __call__ (line 29) | def __call__(self, data): method __repr__ (line 45) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pipelines/formating.py function to_tensor (line 11) | def to_tensor(data): class ToTensor (line 37) | class ToTensor(object): method __init__ (line 44) | def __init__(self, keys): method __call__ (line 47) | def __call__(self, results): method __repr__ (line 62) | def __repr__(self): class ImageToTensor (line 67) | class ImageToTensor(object): method __init__ (line 78) | def __init__(self, keys): method __call__ (line 81) | def __call__(self, results): method __repr__ (line 100) | def __repr__(self): class Transpose (line 105) | class Transpose(object): method __init__ (line 113) | def __init__(self, keys, order): method __call__ (line 117) | def __call__(self, results): method __repr__ (line 133) | def __repr__(self): class ToDataContainer (line 139) | class ToDataContainer(object): method __init__ (line 150) | def __init__(self, method __call__ (line 155) | def __call__(self, results): method __repr__ (line 173) | def __repr__(self): class DefaultFormatBundle (line 178) | class DefaultFormatBundle(object): method __call__ (line 189) | def __call__(self, results): method __repr__ (line 214) | def __repr__(self): class Collect (line 219) | class Collect(object): method __init__ (line 256) | def __init__(self, method __call__ (line 264) | def __call__(self, results): method __repr__ (line 286) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pipelines/loading.py class LoadImageFromFile (line 10) | class LoadImageFromFile(object): method __init__ (line 31) | def __init__(self, method __call__ (line 42) | def __call__(self, results): method __repr__ (line 81) | def __repr__(self): class LoadAnnotations (line 90) | class LoadAnnotations(object): method __init__ (line 104) | def __init__(self, method __call__ (line 113) | def __call__(self, results): method __repr__ (line 149) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pipelines/test_time_aug.py class MultiScaleFlipAug (line 10) | class MultiScaleFlipAug(object): method __init__ (line 53) | def __init__(self, method __call__ (line 93) | def __call__(self, results): method __repr__ (line 128) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/pipelines/transforms.py class Resize (line 10) | class Resize(object): method __init__ (line 41) | def __init__(self, method random_select (line 68) | def random_select(img_scales): method random_sample (line 86) | def random_sample(img_scales): method random_sample_ratio (line 113) | def random_sample_ratio(img_scale, ratio_range): method _random_scale (line 139) | def _random_scale(self, results): method _resize_img (line 177) | def _resize_img(self, results): method _resize_seg (line 199) | def _resize_seg(self, results): method __call__ (line 210) | def __call__(self, results): method __repr__ (line 228) | def __repr__(self): class RandomFlip (line 238) | class RandomFlip(object): method __init__ (line 252) | def __init__(self, prob=None, direction='horizontal'): method __call__ (line 259) | def __call__(self, results): method __repr__ (line 288) | def __repr__(self): class Pad (line 293) | class Pad(object): method __init__ (line 308) | def __init__(self, method _pad_img (line 321) | def _pad_img(self, results): method _pad_seg (line 334) | def _pad_seg(self, results): method __call__ (line 342) | def __call__(self, results): method __repr__ (line 356) | def __repr__(self): class Normalize (line 364) | class Normalize(object): method __init__ (line 376) | def __init__(self, mean, std, to_rgb=True): method __call__ (line 381) | def __call__(self, results): method __repr__ (line 398) | def __repr__(self): class Rerange (line 406) | class Rerange(object): method __init__ (line 416) | def __init__(self, min_value=0, max_value=255): method __call__ (line 423) | def __call__(self, results): method __repr__ (line 445) | def __repr__(self): class CLAHE (line 452) | class CLAHE(object): method __init__ (line 465) | def __init__(self, clip_limit=40.0, tile_grid_size=(8, 8)): method __call__ (line 472) | def __call__(self, results): method __repr__ (line 489) | def __repr__(self): class RandomCrop (line 497) | class RandomCrop(object): method __init__ (line 506) | def __init__(self, crop_size, cat_max_ratio=1., ignore_index=255): method get_crop_bbox (line 512) | def get_crop_bbox(self, img): method crop (line 523) | def crop(self, img, crop_bbox): method __call__ (line 529) | def __call__(self, results): method __repr__ (line 565) | def __repr__(self): class RandomRotate (line 570) | class RandomRotate(object): method __init__ (line 588) | def __init__(self, method __call__ (line 609) | def __call__(self, results): method __repr__ (line 641) | def __repr__(self): class RGB2Gray (line 653) | class RGB2Gray(object): method __init__ (line 668) | def __init__(self, out_channels=None, weights=(0.299, 0.587, 0.114)): method __call__ (line 676) | def __call__(self, results): method __repr__ (line 700) | def __repr__(self): class AdjustGamma (line 708) | class AdjustGamma(object): method __init__ (line 716) | def __init__(self, gamma=1.0): method __call__ (line 724) | def __call__(self, results): method __repr__ (line 739) | def __repr__(self): class SegRescale (line 744) | class SegRescale(object): method __init__ (line 751) | def __init__(self, scale_factor=1): method __call__ (line 754) | def __call__(self, results): method __repr__ (line 769) | def __repr__(self): class PhotoMetricDistortion (line 774) | class PhotoMetricDistortion(object): method __init__ (line 794) | def __init__(self, method convert (line 804) | def convert(self, img, alpha=1, beta=0): method brightness (line 810) | def brightness(self, img): method contrast (line 819) | def contrast(self, img): method saturation (line 827) | def saturation(self, img): method hue (line 838) | def hue(self, img): method __call__ (line 848) | def __call__(self, results): method __repr__ (line 881) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/datasets/stare.py class STAREDataset (line 8) | class STAREDataset(CustomDataset): method __init__ (line 21) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/datasets/voc.py class PascalVOCDataset (line 8) | class PascalVOCDataset(CustomDataset): method __init__ (line 26) | def __init__(self, split, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/cgnet.py class GlobalContextExtractor (line 13) | class GlobalContextExtractor(nn.Module): method __init__ (line 26) | def __init__(self, channel, reduction=16, with_cp=False): method forward (line 37) | def forward(self, x): class ContextGuidedBlock (line 53) | class ContextGuidedBlock(nn.Module): method __init__ (line 78) | def __init__(self, method forward (line 142) | def forward(self, x): class InputInjection (line 170) | class InputInjection(nn.Module): method __init__ (line 173) | def __init__(self, num_downsampling): method forward (line 179) | def forward(self, x): class CGNet (line 186) | class CGNet(nn.Module): method __init__ (line 215) | def __init__(self, method forward (line 309) | def forward(self, x): method init_weights (line 338) | def init_weights(self, pretrained=None): method train (line 359) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/fast_scnn.py class LearningToDownsample (line 13) | class LearningToDownsample(nn.Module): method __init__ (line 29) | def __init__(self, method forward (line 66) | def forward(self, x): class GlobalFeatureExtractor (line 73) | class GlobalFeatureExtractor(nn.Module): method __init__ (line 106) | def __init__(self, method _make_layer (line 148) | def _make_layer(self, method forward (line 172) | def forward(self, x): class FeatureFusionModule (line 181) | class FeatureFusionModule(nn.Module): method __init__ (line 199) | def __init__(self, method forward (line 235) | def forward(self, higher_res_feature, lower_res_feature): class FastSCNN (line 250) | class FastSCNN(nn.Module): method __init__ (line 296) | def __init__(self, method init_weights (line 360) | def init_weights(self, pretrained=None): method forward (line 367) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/hrnet.py class HRModule (line 13) | class HRModule(nn.Module): method __init__ (line 20) | def __init__(self, method _check_branches (line 46) | def _check_branches(self, num_branches, num_blocks, in_channels, method _make_one_branch (line 64) | def _make_one_branch(self, method _make_branches (line 109) | def _make_branches(self, num_branches, block, num_blocks, num_channels): method _make_fuse_layers (line 119) | def _make_fuse_layers(self): method forward (line 185) | def forward(self, x): class HRNet (line 212) | class HRNet(nn.Module): method __init__ (line 273) | def __init__(self, method norm1 (line 362) | def norm1(self): method norm2 (line 367) | def norm2(self): method _make_transition_layer (line 371) | def _make_transition_layer(self, num_channels_pre_layer, method _make_layer (line 418) | def _make_layer(self, block, inplanes, planes, blocks, stride=1): method _make_stage (line 454) | def _make_stage(self, layer_config, in_channels, multiscale_output=True): method init_weights (line 484) | def init_weights(self, pretrained=None): method forward (line 510) | def forward(self, x): method train (line 547) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/mobilenet_v2.py class MobileNetV2 (line 13) | class MobileNetV2(nn.Module): method __init__ (line 45) | def __init__(self, method make_layer (line 107) | def make_layer(self, out_channels, num_blocks, stride, dilation, method init_weights (line 136) | def init_weights(self, pretrained=None): method forward (line 149) | def forward(self, x): method _freeze_stages (line 164) | def _freeze_stages(self): method train (line 174) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/mobilenet_v3.py class MobileNetV3 (line 15) | class MobileNetV3(nn.Module): method __init__ (line 70) | def __init__(self, method _make_layer (line 104) | def _make_layer(self): method init_weights (line 220) | def init_weights(self, pretrained=None): method forward (line 233) | def forward(self, x): method _freeze_stages (line 242) | def _freeze_stages(self): method train (line 249) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/resnest.py class RSoftmax (line 15) | class RSoftmax(nn.Module): method __init__ (line 23) | def __init__(self, radix, groups): method forward (line 28) | def forward(self, x): class SplitAttentionConv2d (line 39) | class SplitAttentionConv2d(nn.Module): method __init__ (line 58) | def __init__(self, method norm0 (line 108) | def norm0(self): method norm1 (line 113) | def norm1(self): method forward (line 117) | def forward(self, x): class Bottleneck (line 146) | class Bottleneck(_Bottleneck): method __init__ (line 165) | def __init__(self, method forward (line 226) | def forward(self, x): class ResNeSt (line 270) | class ResNeSt(ResNetV1d): method __init__ (line 291) | def __init__(self, method make_res_layer (line 305) | def make_res_layer(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/resnet.py class BasicBlock (line 13) | class BasicBlock(nn.Module): method __init__ (line 18) | def __init__(self, method norm1 (line 58) | def norm1(self): method norm2 (line 63) | def norm2(self): method forward (line 67) | def forward(self, x): class Bottleneck (line 97) | class Bottleneck(nn.Module): method __init__ (line 106) | def __init__(self, method make_block_plugins (line 219) | def make_block_plugins(self, in_channels, plugins): method forward_plugin (line 242) | def forward_plugin(self, x, plugin_names): method norm1 (line 250) | def norm1(self): method norm2 (line 255) | def norm2(self): method norm3 (line 260) | def norm3(self): method forward (line 264) | def forward(self, x): class ResNet (line 308) | class ResNet(nn.Module): method __init__ (line 373) | def __init__(self, method make_stage_plugins (line 470) | def make_stage_plugins(self, plugins, stage_idx): method make_res_layer (line 523) | def make_res_layer(self, **kwargs): method norm1 (line 528) | def norm1(self): method _make_stem_layer (line 532) | def _make_stem_layer(self, in_channels, stem_channels): method _freeze_stages (line 581) | def _freeze_stages(self): method init_weights (line 600) | def init_weights(self, pretrained=None): method forward (line 632) | def forward(self, x): method train (line 649) | def train(self, mode=True): class ResNetV1c (line 662) | class ResNetV1c(ResNet): method __init__ (line 672) | def __init__(self, **kwargs): class ResNetV1d (line 678) | class ResNetV1d(ResNet): method __init__ (line 686) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/resnext.py class Bottleneck (line 11) | class Bottleneck(_Bottleneck): method __init__ (line 18) | def __init__(self, class ResNeXt (line 87) | class ResNeXt(ResNet): method __init__ (line 134) | def __init__(self, groups=1, base_width=4, **kwargs): method make_res_layer (line 139) | def make_res_layer(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/unet.py class BasicConvBlock (line 13) | class BasicConvBlock(nn.Module): method __init__ (line 43) | def __init__(self, method forward (line 76) | def forward(self, x): class DeconvModule (line 87) | class DeconvModule(nn.Module): method __init__ (line 105) | def __init__(self, method forward (line 137) | def forward(self, x): class InterpConv (line 148) | class InterpConv(nn.Module): method __init__ (line 179) | def __init__(self, method forward (line 211) | def forward(self, x): class UNet (line 222) | class UNet(nn.Module): method __init__ (line 277) | def __init__(self, method forward (line 376) | def forward(self, x): method train (line 389) | def train(self, mode=True): method _check_input_divisible (line 399) | def _check_input_divisible(self, x): method init_weights (line 412) | def init_weights(self, pretrained=None): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/uniformer.py class Mlp (line 24) | class Mlp(nn.Module): method __init__ (line 25) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 34) | def forward(self, x): class CMlp (line 43) | class CMlp(nn.Module): method __init__ (line 44) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 53) | def forward(self, x): class CBlock (line 62) | class CBlock(nn.Module): method __init__ (line 63) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 77) | def forward(self, x): class Attention (line 84) | class Attention(nn.Module): method __init__ (line 85) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method forward (line 97) | def forward(self, x): class SABlock (line 112) | class SABlock(nn.Module): method __init__ (line 113) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 128) | def forward(self, x): function window_partition (line 138) | def window_partition(x, window_size): function window_reverse (line 152) | def window_reverse(windows, window_size, H, W): class SABlock_Windows (line 168) | class SABlock_Windows(nn.Module): method __init__ (line 169) | def __init__(self, dim, num_heads, window_size=14, mlp_ratio=4., qkv_b... method forward (line 185) | def forward(self, x): class PatchEmbed (line 218) | class PatchEmbed(nn.Module): method __init__ (line 221) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 232) | def forward(self, x): class UniFormer (line 243) | class UniFormer(nn.Module): method __init__ (line 248) | def __init__(self, layers=[3, 4, 8, 3], img_size=224, in_chans=3, num_... method init_weights (line 358) | def init_weights(self, pretrained): method _init_weights (line 363) | def _init_weights(self, m): method no_weight_decay (line 373) | def no_weight_decay(self): method get_classifier (line 376) | def get_classifier(self): method reset_classifier (line 379) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 383) | def forward_features(self, x): method forward (line 420) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/models/backbones/vit.py class Mlp (line 20) | class Mlp(nn.Module): method __init__ (line 36) | def __init__(self, method forward (line 50) | def forward(self, x): class Attention (line 59) | class Attention(nn.Module): method __init__ (line 72) | def __init__(self, method forward (line 89) | def forward(self, x): class Block (line 105) | class Block(nn.Module): method __init__ (line 128) | def __init__(self, method forward (line 156) | def forward(self, x): class PatchEmbed (line 171) | class PatchEmbed(nn.Module): method __init__ (line 183) | def __init__(self, method forward (line 201) | def forward(self, x): class VisionTransformer (line 206) | class VisionTransformer(nn.Module): method __init__ (line 246) | def __init__(self, method init_weights (line 314) | def init_weights(self, pretrained=None): method _pos_embeding (line 359) | def _pos_embeding(self, img, patched_img, pos_embed): method resize_pos_embed (line 392) | def resize_pos_embed(pos_embed, input_shpae, pos_shape, patch_size, mo... method forward (line 421) | def forward(self, inputs): method train (line 454) | def train(self, mode=True): FILE: lavis/common/annotator/uniformer/mmseg/models/builder.py function build_backbone (line 15) | def build_backbone(cfg): function build_neck (line 20) | def build_neck(cfg): function build_head (line 25) | def build_head(cfg): function build_loss (line 30) | def build_loss(cfg): function build_segmentor (line 35) | def build_segmentor(cfg, train_cfg=None, test_cfg=None): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/ann_head.py class PPMConcat (line 10) | class PPMConcat(nn.ModuleList): method __init__ (line 18) | def __init__(self, pool_scales=(1, 3, 6, 8)): method forward (line 22) | def forward(self, feats): class SelfAttentionBlock (line 32) | class SelfAttentionBlock(_SelfAttentionBlock): method __init__ (line 52) | def __init__(self, low_in_channels, high_in_channels, channels, class AFNB (line 79) | class AFNB(nn.Module): method __init__ (line 99) | def __init__(self, low_in_channels, high_in_channels, channels, method forward (line 125) | def forward(self, low_feats, high_feats): class APNB (line 133) | class APNB(nn.Module): method __init__ (line 150) | def __init__(self, in_channels, channels, out_channels, query_scales, method forward (line 175) | def forward(self, feats): class ANNHead (line 184) | class ANNHead(BaseDecodeHead): method __init__ (line 198) | def __init__(self, method forward (line 236) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/apc_head.py class ACM (line 11) | class ACM(nn.Module): method __init__ (line 25) | def __init__(self, pool_scale, fusion, in_channels, channels, conv_cfg, method forward (line 78) | def forward(self, x): class APCHead (line 110) | class APCHead(BaseDecodeHead): method __init__ (line 124) | def __init__(self, pool_scales=(1, 2, 3, 6), fusion=True, **kwargs): method forward (line 149) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/aspp_head.py class ASPPModule (line 10) | class ASPPModule(nn.ModuleList): method __init__ (line 22) | def __init__(self, dilations, in_channels, channels, conv_cfg, norm_cfg, method forward (line 43) | def forward(self, x): class ASPPHead (line 53) | class ASPPHead(BaseDecodeHead): method __init__ (line 64) | def __init__(self, dilations=(1, 6, 12, 18), **kwargs): method forward (line 93) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/cascade_decode_head.py class BaseCascadeDecodeHead (line 6) | class BaseCascadeDecodeHead(BaseDecodeHead, metaclass=ABCMeta): method __init__ (line 10) | def __init__(self, *args, **kwargs): method forward (line 14) | def forward(self, inputs, prev_output): method forward_train (line 18) | def forward_train(self, inputs, prev_output, img_metas, gt_semantic_seg, method forward_test (line 41) | def forward_test(self, inputs, prev_output, img_metas, test_cfg): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/cc_head.py class CCHead (line 13) | class CCHead(FCNHead): method __init__ (line 24) | def __init__(self, recurrence=2, **kwargs): method forward (line 32) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/da_head.py class PAM (line 12) | class PAM(_SelfAttentionBlock): method __init__ (line 20) | def __init__(self, in_channels, channels): method forward (line 41) | def forward(self, x): class CAM (line 49) | class CAM(nn.Module): method __init__ (line 52) | def __init__(self): method forward (line 56) | def forward(self, x): class DAHead (line 75) | class DAHead(BaseDecodeHead): method __init__ (line 85) | def __init__(self, pam_channels, **kwargs): method pam_cls_seg (line 128) | def pam_cls_seg(self, feat): method cam_cls_seg (line 135) | def cam_cls_seg(self, feat): method forward (line 142) | def forward(self, inputs): method forward_test (line 160) | def forward_test(self, inputs, img_metas, test_cfg): method losses (line 164) | def losses(self, seg_logit, seg_label): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/decode_head.py class BaseDecodeHead (line 14) | class BaseDecodeHead(nn.Module, metaclass=ABCMeta): method __init__ (line 46) | def __init__(self, method extra_repr (line 88) | def extra_repr(self): method _init_inputs (line 95) | def _init_inputs(self, in_channels, in_index, input_transform): method init_weights (line 133) | def init_weights(self): method _transform_inputs (line 137) | def _transform_inputs(self, inputs): method forward (line 166) | def forward(self, inputs): method forward_train (line 170) | def forward_train(self, inputs, img_metas, gt_semantic_seg, train_cfg): method forward_test (line 190) | def forward_test(self, inputs, img_metas, test_cfg): method cls_seg (line 207) | def cls_seg(self, feat): method losses (line 215) | def losses(self, seg_logit, seg_label): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/dm_head.py class DCM (line 10) | class DCM(nn.Module): method __init__ (line 24) | def __init__(self, filter_size, fusion, in_channels, channels, conv_cfg, method forward (line 60) | def forward(self, x): class DMHead (line 92) | class DMHead(BaseDecodeHead): method __init__ (line 106) | def __init__(self, filter_sizes=(1, 3, 5, 7), fusion=False, **kwargs): method forward (line 131) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/dnl_head.py class DisentangledNonLocal2d (line 9) | class DisentangledNonLocal2d(NonLocal2d): method __init__ (line 16) | def __init__(self, *arg, temperature, **kwargs): method embedded_gaussian (line 21) | def embedded_gaussian(self, theta_x, phi_x): method forward (line 33) | def forward(self, x): class DNLHead (line 87) | class DNLHead(FCNHead): method __init__ (line 102) | def __init__(self, method forward (line 122) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/ema_head.py function reduce_mean (line 13) | def reduce_mean(tensor): class EMAModule (line 22) | class EMAModule(nn.Module): method __init__ (line 31) | def __init__(self, channels, num_bases, num_stages, momentum): method forward (line 44) | def forward(self, feats): class EMAHead (line 79) | class EMAHead(BaseDecodeHead): method __init__ (line 94) | def __init__(self, method forward (line 154) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/enc_head.py class EncModule (line 11) | class EncModule(nn.Module): method __init__ (line 22) | def __init__(self, in_channels, num_codes, conv_cfg, norm_cfg, act_cfg): method forward (line 50) | def forward(self, x): class EncHead (line 62) | class EncHead(BaseDecodeHead): method __init__ (line 78) | def __init__(self, method forward (line 129) | def forward(self, inputs): method forward_test (line 151) | def forward_test(self, inputs, img_metas, test_cfg): method _convert_to_onehot_labels (line 159) | def _convert_to_onehot_labels(seg_label, num_classes): method losses (line 178) | def losses(self, seg_logit, seg_label): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/fcn_head.py class FCNHead (line 10) | class FCNHead(BaseDecodeHead): method __init__ (line 23) | def __init__(self, method forward (line 74) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/fpn_head.py class FPNHead (line 11) | class FPNHead(BaseDecodeHead): method __init__ (line 23) | def __init__(self, feature_strides, **kwargs): method forward (line 54) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/gc_head.py class GCHead (line 9) | class GCHead(FCNHead): method __init__ (line 23) | def __init__(self, method forward (line 38) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/lraspp_head.py class LRASPPHead (line 12) | class LRASPPHead(BaseDecodeHead): method __init__ (line 23) | def __init__(self, branch_channels=(32, 64), **kwargs): method forward (line 68) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/nl_head.py class NLHead (line 9) | class NLHead(FCNHead): method __init__ (line 23) | def __init__(self, method forward (line 40) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/ocr_head.py class SpatialGatherModule (line 12) | class SpatialGatherModule(nn.Module): method __init__ (line 19) | def __init__(self, scale): method forward (line 23) | def forward(self, feats, probs): class ObjectAttentionBlock (line 39) | class ObjectAttentionBlock(_SelfAttentionBlock): method __init__ (line 42) | def __init__(self, in_channels, channels, scale, conv_cfg, norm_cfg, method forward (line 73) | def forward(self, query_feats, key_feats): class OCRHead (line 85) | class OCRHead(BaseCascadeDecodeHead): method __init__ (line 97) | def __init__(self, ocr_channels, scale=1, **kwargs): method forward (line 119) | def forward(self, inputs, prev_output): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/point_head.py function calculate_uncertainty (line 14) | def calculate_uncertainty(seg_logits): class PointHead (line 35) | class PointHead(BaseCascadeDecodeHead): method __init__ (line 60) | def __init__(self, method init_weights (line 104) | def init_weights(self): method cls_seg (line 108) | def cls_seg(self, feat): method forward (line 115) | def forward(self, fine_grained_point_feats, coarse_point_feats): method _get_fine_grained_point_feats (line 123) | def _get_fine_grained_point_feats(self, x, points): method _get_coarse_point_feats (line 147) | def _get_coarse_point_feats(self, prev_output, points): method forward_train (line 165) | def forward_train(self, inputs, prev_output, img_metas, gt_semantic_seg, method forward_test (line 203) | def forward_test(self, inputs, prev_output, img_metas, test_cfg): method losses (line 248) | def losses(self, point_logits, point_label): method get_points_train (line 256) | def get_points_train(self, seg_logits, uncertainty_func, cfg): method get_points_test (line 310) | def get_points_test(self, seg_logits, uncertainty_func, cfg): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/psa_head.py class PSAHead (line 17) | class PSAHead(BaseDecodeHead): method __init__ (line 35) | def __init__(self, method forward (line 113) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/psp_head.py class PPM (line 10) | class PPM(nn.ModuleList): method __init__ (line 24) | def __init__(self, pool_scales, in_channels, channels, conv_cfg, norm_... method forward (line 46) | def forward(self, x): class PSPHead (line 61) | class PSPHead(BaseDecodeHead): method __init__ (line 72) | def __init__(self, pool_scales=(1, 2, 3, 6), **kwargs): method forward (line 93) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/sep_aspp_head.py class DepthwiseSeparableASPPModule (line 10) | class DepthwiseSeparableASPPModule(ASPPModule): method __init__ (line 14) | def __init__(self, **kwargs): class DepthwiseSeparableASPPHead (line 29) | class DepthwiseSeparableASPPHead(ASPPHead): method __init__ (line 42) | def __init__(self, c1_in_channels, c1_channels, **kwargs): method forward (line 78) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/sep_fcn_head.py class DepthwiseSeparableFCNHead (line 8) | class DepthwiseSeparableFCNHead(FCNHead): method __init__ (line 29) | def __init__(self, **kwargs): FILE: lavis/common/annotator/uniformer/mmseg/models/decode_heads/uper_head.py class UPerHead (line 12) | class UPerHead(BaseDecodeHead): method __init__ (line 23) | def __init__(self, pool_scales=(1, 2, 3, 6), **kwargs): method psp_forward (line 76) | def psp_forward(self, inputs): method forward (line 86) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/losses/accuracy.py function accuracy (line 4) | def accuracy(pred, target, topk=1, thresh=None): class Accuracy (line 52) | class Accuracy(nn.Module): method __init__ (line 55) | def __init__(self, topk=(1, ), thresh=None): method forward (line 68) | def forward(self, pred, target): FILE: lavis/common/annotator/uniformer/mmseg/models/losses/cross_entropy_loss.py function cross_entropy (line 9) | def cross_entropy(pred, function _expand_onehot_labels (line 35) | def _expand_onehot_labels(labels, label_weights, target_shape, ignore_in... function binary_cross_entropy (line 57) | def binary_cross_entropy(pred, function mask_cross_entropy (line 100) | def mask_cross_entropy(pred, class CrossEntropyLoss (line 139) | class CrossEntropyLoss(nn.Module): method __init__ (line 154) | def __init__(self, method forward (line 175) | def forward(self, FILE: lavis/common/annotator/uniformer/mmseg/models/losses/dice_loss.py function dice_loss (line 12) | def dice_loss(pred, function binary_dice_loss (line 37) | def binary_dice_loss(pred, target, valid_mask, smooth=1, exponent=2, **k... class DiceLoss (line 50) | class DiceLoss(nn.Module): method __init__ (line 72) | def __init__(self, method forward (line 88) | def forward(self, FILE: lavis/common/annotator/uniformer/mmseg/models/losses/lovasz_loss.py function lovasz_grad (line 14) | def lovasz_grad(gt_sorted): function flatten_binary_logits (line 29) | def flatten_binary_logits(logits, labels, ignore_index=None): function flatten_probs (line 42) | def flatten_probs(probs, labels, ignore_index=None): function lovasz_hinge_flat (line 59) | def lovasz_hinge_flat(logits, labels): function lovasz_hinge (line 83) | def lovasz_hinge(logits, function lovasz_softmax_flat (line 128) | def lovasz_softmax_flat(probs, labels, classes='present', class_weight=N... function lovasz_softmax (line 171) | def lovasz_softmax(probs, class LovaszLoss (line 225) | class LovaszLoss(nn.Module): method __init__ (line 248) | def __init__(self, method forward (line 274) | def forward(self, FILE: lavis/common/annotator/uniformer/mmseg/models/losses/utils.py function get_class_weight (line 8) | def get_class_weight(class_weight): function reduce_loss (line 26) | def reduce_loss(loss, reduction): function weight_reduce_loss (line 46) | def weight_reduce_loss(loss, weight=None, reduction='mean', avg_factor=N... function weighted_loss (line 78) | def weighted_loss(loss_func): FILE: lavis/common/annotator/uniformer/mmseg/models/necks/fpn.py class FPN (line 9) | class FPN(nn.Module): method __init__ (line 63) | def __init__(self, method init_weights (line 157) | def init_weights(self): method forward (line 162) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/necks/multilevel_neck.py class MultiLevelNeck (line 9) | class MultiLevelNeck(nn.Module): method __init__ (line 22) | def __init__(self, method forward (line 55) | def forward(self, inputs): FILE: lavis/common/annotator/uniformer/mmseg/models/segmentors/base.py class BaseSegmentor (line 14) | class BaseSegmentor(nn.Module): method __init__ (line 19) | def __init__(self): method with_neck (line 24) | def with_neck(self): method with_auxiliary_head (line 29) | def with_auxiliary_head(self): method with_decode_head (line 35) | def with_decode_head(self): method extract_feat (line 40) | def extract_feat(self, imgs): method encode_decode (line 45) | def encode_decode(self, img, img_metas): method forward_train (line 51) | def forward_train(self, imgs, img_metas, **kwargs): method simple_test (line 56) | def simple_test(self, img, img_meta, **kwargs): method aug_test (line 61) | def aug_test(self, imgs, img_metas, **kwargs): method init_weights (line 65) | def init_weights(self, pretrained=None): method forward_test (line 76) | def forward_test(self, imgs, img_metas, **kwargs): method forward (line 111) | def forward(self, img, img_metas, return_loss=True, **kwargs): method train_step (line 126) | def train_step(self, data_batch, optimizer, **kwargs): method val_step (line 162) | def val_step(self, data_batch, **kwargs): method _parse_losses (line 173) | def _parse_losses(losses): method show_result (line 208) | def show_result(self, FILE: lavis/common/annotator/uniformer/mmseg/models/segmentors/cascade_encoder_decoder.py class CascadeEncoderDecoder (line 11) | class CascadeEncoderDecoder(EncoderDecoder): method __init__ (line 19) | def __init__(self, method _init_decode_head (line 38) | def _init_decode_head(self, decode_head): method init_weights (line 48) | def init_weights(self, pretrained=None): method encode_decode (line 65) | def encode_decode(self, img, img_metas): method _decode_head_forward_train (line 80) | def _decode_head_forward_train(self, x, img_metas, gt_semantic_seg): FILE: lavis/common/annotator/uniformer/mmseg/models/segmentors/encoder_decoder.py class EncoderDecoder (line 13) | class EncoderDecoder(BaseSegmentor): method __init__ (line 21) | def __init__(self, method _init_decode_head (line 43) | def _init_decode_head(self, decode_head): method _init_auxiliary_head (line 49) | def _init_auxiliary_head(self, auxiliary_head): method init_weights (line 59) | def init_weights(self, pretrained=None): method extract_feat (line 77) | def extract_feat(self, img): method encode_decode (line 84) | def encode_decode(self, img, img_metas): method _decode_head_forward_train (line 96) | def _decode_head_forward_train(self, x, img_metas, gt_semantic_seg): method _decode_head_forward_test (line 107) | def _decode_head_forward_test(self, x, img_metas): method _auxiliary_head_forward_train (line 113) | def _auxiliary_head_forward_train(self, x, img_metas, gt_semantic_seg): method forward_dummy (line 130) | def forward_dummy(self, img): method forward_train (line 136) | def forward_train(self, img, img_metas, gt_semantic_seg): method slide_inference (line 169) | def slide_inference(self, img, img_meta, rescale): method whole_inference (line 214) | def whole_inference(self, img, img_meta, rescale): method inference (line 233) | def inference(self, img, img_meta, rescale): method simple_test (line 268) | def simple_test(self, img, img_meta, rescale=True): method aug_test (line 281) | def aug_test(self, imgs, img_metas, rescale=True): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/drop.py class DropPath (line 8) | class DropPath(nn.Module): method __init__ (line 17) | def __init__(self, drop_prob=0.): method forward (line 22) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/inverted_residual.py class InvertedResidual (line 8) | class InvertedResidual(nn.Module): method __init__ (line 31) | def __init__(self, method forward (line 81) | def forward(self, x): class InvertedResidualV3 (line 97) | class InvertedResidualV3(nn.Module): method __init__ (line 124) | def __init__(self, method forward (line 183) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/make_divisible.py function make_divisible (line 1) | def make_divisible(value, divisor, min_value=None, min_ratio=0.9): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/res_layer.py class ResLayer (line 5) | class ResLayer(nn.Sequential): method __init__ (line 26) | def __init__(self, FILE: lavis/common/annotator/uniformer/mmseg/models/utils/se_layer.py class SELayer (line 8) | class SELayer(nn.Module): method __init__ (line 26) | def __init__(self, method forward (line 53) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/self_attention_block.py class SelfAttentionBlock (line 7) | class SelfAttentionBlock(nn.Module): method __init__ (line 32) | def __init__(self, key_in_channels, query_in_channels, channels, method init_weights (line 93) | def init_weights(self): method build_project (line 99) | def build_project(self, in_channels, channels, num_convs, use_conv_mod... method forward (line 131) | def forward(self, query_feats, key_feats): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/up_conv_block.py class UpConvBlock (line 6) | class UpConvBlock(nn.Module): method __init__ (line 44) | def __init__(self, method forward (line 94) | def forward(self, skip, x): FILE: lavis/common/annotator/uniformer/mmseg/models/utils/weight_init.py function _no_grad_trunc_normal_ (line 10) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 48) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.): FILE: lavis/common/annotator/uniformer/mmseg/ops/encoding.py class Encoding (line 6) | class Encoding(nn.Module): method __init__ (line 17) | def __init__(self, channels, num_codes): method scaled_l2 (line 33) | def scaled_l2(x, codewords, scale): method aggregate (line 46) | def aggregate(assignment_weights, x, codewords): method forward (line 57) | def forward(self, x): method __repr__ (line 70) | def __repr__(self): FILE: lavis/common/annotator/uniformer/mmseg/ops/wrappers.py function resize (line 7) | def resize(input, class Upsample (line 29) | class Upsample(nn.Module): method __init__ (line 31) | def __init__(self, method forward (line 45) | def forward(self, x): FILE: lavis/common/annotator/uniformer/mmseg/utils/collect_env.py function collect_env (line 7) | def collect_env(): FILE: lavis/common/annotator/uniformer/mmseg/utils/logger.py function get_root_logger (line 6) | def get_root_logger(log_file=None, log_level=logging.INFO): FILE: lavis/common/annotator/util.py function HWC3 (line 9) | def HWC3(x): function resize_image (line 28) | def resize_image(input_image, resolution): FILE: lavis/common/config.py class Config (line 16) | class Config: method __init__ (line 17) | def __init__(self, args): method _validate_runner_config (line 43) | def _validate_runner_config(self, runner_config): method _build_opt_list (line 52) | def _build_opt_list(self, opts): method build_model_config (line 57) | def build_model_config(config, **kwargs): method build_runner_config (line 84) | def build_runner_config(config): method build_dataset_config (line 88) | def build_dataset_config(config): method _convert_to_dot_list (line 114) | def _convert_to_dot_list(self, opts): method get_config (line 128) | def get_config(self): method run_cfg (line 132) | def run_cfg(self): method datasets_cfg (line 136) | def datasets_cfg(self): method model_cfg (line 140) | def model_cfg(self): method pretty_print (line 143) | def pretty_print(self): method _convert_node_to_json (line 161) | def _convert_node_to_json(self, node): method to_dict (line 165) | def to_dict(self): function node_to_dict (line 169) | def node_to_dict(node): class ConfigValidator (line 173) | class ConfigValidator: class _Argument (line 187) | class _Argument: method __init__ (line 188) | def __init__(self, name, choices=None, type=None, help=None): method __str__ (line 195) | def __str__(self): method __init__ (line 205) | def __init__(self, description): method __getitem__ (line 212) | def __getitem__(self, key): method __str__ (line 217) | def __str__(self) -> str: method add_argument (line 220) | def add_argument(self, *args, **kwargs): method validate (line 226) | def validate(self, config=None): method format_arguments (line 248) | def format_arguments(self): method format_help (line 251) | def format_help(self): method print_help (line 256) | def print_help(self): function create_runner_config_validator (line 261) | def create_runner_config_validator(): FILE: lavis/common/dist_utils.py function setup_for_distributed (line 17) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 33) | def is_dist_avail_and_initialized(): function get_world_size (line 41) | def get_world_size(): function get_rank (line 47) | def get_rank(): function is_main_process (line 53) | def is_main_process(): function init_distributed_mode (line 57) | def init_distributed_mode(args): function get_dist_info (line 93) | def get_dist_info(): function main_process (line 107) | def main_process(func): function download_cached_file (line 117) | def download_cached_file(url, check_hash=True, progress=False): FILE: lavis/common/gradcam.py function getAttMap (line 7) | def getAttMap(img, attMap, blur=True, overlap=True): FILE: lavis/common/logger.py class SmoothedValue (line 19) | class SmoothedValue(object): method __init__ (line 24) | def __init__(self, window_size=20, fmt=None): method update (line 32) | def update(self, value, n=1): method synchronize_between_processes (line 37) | def synchronize_between_processes(self): method median (line 51) | def median(self): method avg (line 56) | def avg(self): method global_avg (line 61) | def global_avg(self): method max (line 65) | def max(self): method value (line 69) | def value(self): method __str__ (line 72) | def __str__(self): class MetricLogger (line 82) | class MetricLogger(object): method __init__ (line 83) | def __init__(self, delimiter="\t"): method update (line 87) | def update(self, **kwargs): method __getattr__ (line 94) | def __getattr__(self, attr): method __str__ (line 103) | def __str__(self): method global_avg (line 109) | def global_avg(self): method synchronize_between_processes (line 115) | def synchronize_between_processes(self): method add_meter (line 119) | def add_meter(self, name, meter): method log_every (line 122) | def log_every(self, iterable, print_freq, header=None): class AttrDict (line 184) | class AttrDict(dict): method __init__ (line 185) | def __init__(self, *args, **kwargs): function setup_logger (line 190) | def setup_logger(): FILE: lavis/common/optims.py class LinearWarmupStepLRScheduler (line 14) | class LinearWarmupStepLRScheduler: method __init__ (line 15) | def __init__( method step (line 37) | def step(self, cur_epoch, cur_step): class LinearWarmupCosineLRScheduler (line 57) | class LinearWarmupCosineLRScheduler: method __init__ (line 58) | def __init__( method step (line 77) | def step(self, cur_epoch, cur_step): class ConstantLRScheduler (line 98) | class ConstantLRScheduler: method __init__ (line 99) | def __init__(self, optimizer, init_lr, warmup_start_lr=-1, warmup_step... method step (line 105) | def step(self, cur_epoch, cur_step): function cosine_lr_schedule (line 119) | def cosine_lr_schedule(optimizer, epoch, max_epoch, init_lr, min_lr): function warmup_lr_schedule (line 128) | def warmup_lr_schedule(optimizer, step, max_step, init_lr, max_lr): function step_lr_schedule (line 135) | def step_lr_schedule(optimizer, epoch, init_lr, min_lr, decay_rate): FILE: lavis/common/registry.py class Registry (line 9) | class Registry: method register_builder (line 22) | def register_builder(cls, name): method register_task (line 54) | def register_task(cls, name): method register_model (line 83) | def register_model(cls, name): method register_processor (line 112) | def register_processor(cls, name): method register_lr_scheduler (line 141) | def register_lr_scheduler(cls, name): method register_runner (line 165) | def register_runner(cls, name): method register_path (line 189) | def register_path(cls, name, path): method register (line 205) | def register(cls, name, obj): method get_builder_class (line 232) | def get_builder_class(cls, name): method get_model_class (line 236) | def get_model_class(cls, name): method get_task_class (line 240) | def get_task_class(cls, name): method get_processor_class (line 244) | def get_processor_class(cls, name): method get_lr_scheduler_class (line 248) | def get_lr_scheduler_class(cls, name): method get_runner_class (line 252) | def get_runner_class(cls, name): method list_runners (line 256) | def list_runners(cls): method list_models (line 260) | def list_models(cls): method list_tasks (line 264) | def list_tasks(cls): method list_processors (line 268) | def list_processors(cls): method list_lr_schedulers (line 272) | def list_lr_schedulers(cls): method list_datasets (line 276) | def list_datasets(cls): method get_path (line 280) | def get_path(cls, name): method get (line 284) | def get(cls, name, default=None, no_warning=False): method unregister (line 315) | def unregister(cls, name): FILE: lavis/common/utils.py function now (line 37) | def now(): function is_url (line 43) | def is_url(url_or_filename): function get_cache_path (line 48) | def get_cache_path(rel_path): function get_abs_path (line 52) | def get_abs_path(rel_path): function load_json (line 56) | def load_json(filename): function makedir (line 66) | def makedir(dir_path): function get_redirected_url (line 80) | def get_redirected_url(url: str): function to_google_drive_download_url (line 95) | def to_google_drive_download_url(view_url: str) -> str: function download_google_drive_url (line 110) | def download_google_drive_url(url: str, output_path: str, output_file_na... function _get_google_drive_file_id (line 143) | def _get_google_drive_file_id(url: str) -> Optional[str]: function _urlretrieve (line 156) | def _urlretrieve(url: str, filename: str, chunk_size: int = 1024) -> None: function download_url (line 169) | def download_url( function download_and_extract_archive (line 223) | def download_and_extract_archive( function cache_url (line 244) | def cache_url(url: str, cache_dir: str) -> str: function create_file_symlink (line 263) | def create_file_symlink(file1, file2): function save_file (line 277) | def save_file(data, filename, append_to_json=True, verbose=True): function load_file (line 315) | def load_file(filename, mmap_mode=None, verbose=True, allow_pickle=False): function abspath (line 376) | def abspath(resource_path: str): function makedir (line 388) | def makedir(dir_path): function is_url (line 402) | def is_url(input_url): function download_and_untar (line 410) | def download_and_untar(url): function cleanup_dir (line 426) | def cleanup_dir(dir): function get_file_size (line 437) | def get_file_size(filename): function is_serializable (line 444) | def is_serializable(value): function is_convertible_to_int (line 454) | def is_convertible_to_int(value): FILE: lavis/common/vqa_tools/vqa.py class VQA (line 31) | class VQA: method __init__ (line 32) | def __init__(self, annotation_file=None, question_file=None): method createIndex (line 53) | def createIndex(self): method info (line 71) | def info(self): method getQuesIds (line 79) | def getQuesIds(self, imgIds=[], quesTypes=[], ansTypes=[]): method getImgIds (line 114) | def getImgIds(self, quesIds=[], quesTypes=[], ansTypes=[]): method loadQA (line 148) | def loadQA(self, ids=[]): method showQA (line 159) | def showQA(self, anns): method loadRes (line 173) | def loadRes(self, resFile, quesFile): FILE: lavis/common/vqa_tools/vqa_eval.py class VQAEval (line 18) | class VQAEval: method __init__ (line 19) | def __init__(self, vqa=None, vqaRes=None, n=2): method evaluate (line 193) | def evaluate(self, quesIds=None): method processPunctuation (line 249) | def processPunctuation(self, inText): method processDigitArticle (line 261) | def processDigitArticle(self, inText): method setAccuracy (line 276) | def setAccuracy(self, accQA, accQuesType, accAnsType): method setEvalQA (line 292) | def setEvalQA(self, quesId, acc): method setEvalQuesType (line 295) | def setEvalQuesType(self, quesId, quesType, acc): method setEvalAnsType (line 300) | def setEvalAnsType(self, quesId, ansType, acc): method updateProgress (line 305) | def updateProgress(self, progress): FILE: lavis/datasets/builders/__init__.py function load_dataset (line 230) | def load_dataset(name, cfg_path=None, vis_path=None, data_type=None): class DatasetZoo (line 268) | class DatasetZoo: method __init__ (line 269) | def __init__(self) -> None: method get_names (line 275) | def get_names(self): FILE: lavis/datasets/builders/audio_caption_builder.py class AudioCapBuilder (line 27) | class AudioCapBuilder(MultiModalDatasetBuilder): method build (line 36) | def build(self): class AudioSetBuilder (line 49) | class AudioSetBuilder(AudioCapBuilder): class AudioSetInstructBuilder (line 58) | class AudioSetInstructBuilder(AudioCapBuilder): class AudioCapsCapBuilder (line 67) | class AudioCapsCapBuilder(AudioCapBuilder): class AudioCapsInstructCapBuilder (line 76) | class AudioCapsInstructCapBuilder(AudioCapBuilder): class ClothoCapInstructBuilder (line 85) | class ClothoCapInstructBuilder(MultiModalDatasetBuilder): class ClothoCapInstructBuilder (line 94) | class ClothoCapInstructBuilder(MultiModalDatasetBuilder): class WavCapsCapBuilder (line 104) | class WavCapsCapBuilder(AudioCapBuilder): class WavCapsCapInstructBuilder (line 115) | class WavCapsCapInstructBuilder(AudioCapBuilder): FILE: lavis/datasets/builders/audio_qa_builder.py class AudioCapsQABuilder (line 13) | class AudioCapsQABuilder(AudioCapBuilder): class ClothoQABuilder (line 22) | class ClothoQABuilder(AudioCapBuilder): FILE: lavis/datasets/builders/base_dataset_builder.py class BaseDatasetBuilder (line 23) | class BaseDatasetBuilder: method __init__ (line 26) | def __init__(self, cfg=None): method build_datasets (line 46) | def build_datasets(self): method build_processors (line 62) | def build_processors(self): method _build_proc_from_cfg (line 86) | def _build_proc_from_cfg(cfg): method default_config_path (line 94) | def default_config_path(cls, type="default"): method _download_data (line 97) | def _download_data(self): method _download_ann (line 101) | def _download_ann(self): method _download_vis (line 158) | def _download_vis(self): method build (line 172) | def build(self): class MultiModalDatasetBuilder (line 238) | class MultiModalDatasetBuilder(BaseDatasetBuilder): method __init__ (line 247) | def __init__(self, cfg=None): method _build_processor (line 252) | def _build_processor(self, cfg_name): method build_processors (line 261) | def build_processors(self): method _download_multimodal (line 274) | def _download_multimodal(self, modality): method _download_data (line 279) | def _download_data(self): method _get_absolute_path (line 284) | def _get_absolute_path(self, path): method build (line 289) | def build(self): method _get_dataset_args (line 306) | def _get_dataset_args(self, info, is_train): function load_dataset_config (line 325) | def load_dataset_config(cfg_path): FILE: lavis/datasets/builders/caption_builder.py class COCOCapBuilder (line 40) | class COCOCapBuilder(BaseDatasetBuilder): class COCOCapInstructBuilder (line 49) | class COCOCapInstructBuilder(BaseDatasetBuilder): class Flickr30kCapBuilder (line 59) | class Flickr30kCapBuilder(BaseDatasetBuilder): class Flickr30kCapInstructBuilder (line 67) | class Flickr30kCapInstructBuilder(BaseDatasetBuilder): class COCOCapBuilder (line 75) | class COCOCapBuilder(BaseDatasetBuilder): class VSRCapBuilder (line 83) | class VSRCapBuilder(BaseDatasetBuilder): class VSRCapInstructBuilder (line 92) | class VSRCapInstructBuilder(BaseDatasetBuilder): class TextCapsCapBuilder (line 101) | class TextCapsCapBuilder(BaseDatasetBuilder): class TextCapsCapInstructBuilder (line 110) | class TextCapsCapInstructBuilder(BaseDatasetBuilder): class CapFiltCapBuilder (line 120) | class CapFiltCapBuilder(BaseDatasetBuilder): class CapFiltCapBuilder (line 128) | class CapFiltCapBuilder(BaseDatasetBuilder): class MSRVTTCapBuilder (line 137) | class MSRVTTCapBuilder(BaseDatasetBuilder): class MSVDCapBuilder (line 147) | class MSVDCapBuilder(BaseDatasetBuilder): class VATEXCapBuilder (line 157) | class VATEXCapBuilder(MultiModalDatasetBuilder): class MSRVTTCapInstructBuilder (line 166) | class MSRVTTCapInstructBuilder(BaseDatasetBuilder): class MSVDCapInstructBuilder (line 175) | class MSVDCapInstructBuilder(BaseDatasetBuilder): class VATEXCapInstructBuilder (line 186) | class VATEXCapInstructBuilder(MultiModalDatasetBuilder): class WebVid2MCapBuilder (line 196) | class WebVid2MCapBuilder(BaseDatasetBuilder): class WebVid2MCapInstructBuilder (line 204) | class WebVid2MCapInstructBuilder(BaseDatasetBuilder): class ViolinCapBuilder (line 212) | class ViolinCapBuilder(BaseDatasetBuilder): class ViolinCapInstructBuilder (line 222) | class ViolinCapInstructBuilder(BaseDatasetBuilder): class VALORCaptionBuilder (line 231) | class VALORCaptionBuilder(MultiModalDatasetBuilder): class VALORCaptionInstructBuilder (line 240) | class VALORCaptionInstructBuilder(MultiModalDatasetBuilder): class VlepCaptionBuilder (line 249) | class VlepCaptionBuilder(BaseDatasetBuilder): class VlepCaptionInstructBuilder (line 259) | class VlepCaptionInstructBuilder(BaseDatasetBuilder): class YouCookCaptionBuilder (line 268) | class YouCookCaptionBuilder(BaseDatasetBuilder): class YouCookCaptionInstructBuilder (line 277) | class YouCookCaptionInstructBuilder(BaseDatasetBuilder): class COINCaptionBuilder (line 286) | class COINCaptionBuilder(BaseDatasetBuilder): class COINCaptionInstructBuilder (line 296) | class COINCaptionInstructBuilder(BaseDatasetBuilder): class CharadeCaptionBuilder (line 306) | class CharadeCaptionBuilder(BaseDatasetBuilder): class CharadeCaptionInstructBuilder (line 315) | class CharadeCaptionInstructBuilder(BaseDatasetBuilder): FILE: lavis/datasets/builders/classification_builder.py class ViolinEntailmentBuilder (line 16) | class ViolinEntailmentBuilder(BaseDatasetBuilder): class ViolinEntailmentInstructBuilder (line 26) | class ViolinEntailmentInstructBuilder(BaseDatasetBuilder): class NLVRBuilder (line 35) | class NLVRBuilder(BaseDatasetBuilder): class SNLIVisualEntailmentBuilder (line 43) | class SNLIVisualEntailmentBuilder(BaseDatasetBuilder): class SNLIVisualEntailmentInstructBuilder (line 50) | class SNLIVisualEntailmentInstructBuilder(BaseDatasetBuilder): class VSRClassificationBuilder (line 58) | class VSRClassificationBuilder(BaseDatasetBuilder): class SNLIVisualEntailmentInstructBuilder (line 65) | class SNLIVisualEntailmentInstructBuilder(BaseDatasetBuilder): class ESC50ClassificationBuilder (line 72) | class ESC50ClassificationBuilder(MultiModalDatasetBuilder): FILE: lavis/datasets/builders/dialogue_builder.py class AVSDDialBuilder (line 26) | class AVSDDialBuilder(BaseDatasetBuilder): class VisDialBuilder (line 33) | class VisDialBuilder(BaseDatasetBuilder): class VisDialInstructBuilder (line 40) | class VisDialInstructBuilder(BaseDatasetBuilder): class AVSDDialInstructBuilder (line 47) | class AVSDDialInstructBuilder(MultiModalDatasetBuilder): class LLaVA150kDialInstructBuilder (line 54) | class LLaVA150kDialInstructBuilder(BaseDatasetBuilder): class YT8MDialBuilder (line 61) | class YT8MDialBuilder(MultiModalDatasetBuilder): FILE: lavis/datasets/builders/discrn_builders.py class DiscrnImagePcBuilder (line 15) | class DiscrnImagePcBuilder(MultiModalDatasetBuilder): class DiscrnAudioVideoBuilder (line 23) | class DiscrnAudioVideoBuilder(MultiModalDatasetBuilder): FILE: lavis/datasets/builders/image_text_pair_builder.py class ConceptualCaption3MBuilder (line 16) | class ConceptualCaption3MBuilder(BaseDatasetBuilder): class ConceptualCaption3MInstructBuilder (line 24) | class ConceptualCaption3MInstructBuilder(BaseDatasetBuilder): class ConceptualCaption12MBuilder (line 33) | class ConceptualCaption12MBuilder(BaseDatasetBuilder): class ConceptualCaption12MInstructBuilder (line 41) | class ConceptualCaption12MInstructBuilder(BaseDatasetBuilder): class SBUCaptionBuilder (line 49) | class SBUCaptionBuilder(BaseDatasetBuilder): class SBUCaptionInstructBuilder (line 56) | class SBUCaptionInstructBuilder(BaseDatasetBuilder): class VGCaptionBuilder (line 63) | class VGCaptionBuilder(BaseDatasetBuilder): class VGCaptionInstructBuilder (line 70) | class VGCaptionInstructBuilder(BaseDatasetBuilder): class Laion2BMultiBuilder (line 78) | class Laion2BMultiBuilder(BaseDatasetBuilder): method _download_ann (line 83) | def _download_ann(self): method _download_vis (line 86) | def _download_vis(self): method build (line 89) | def build(self): class Laion400MBuilder (line 109) | class Laion400MBuilder(Laion2BMultiBuilder): class Laion400MInstructBuilder (line 116) | class Laion400MInstructBuilder(Laion2BMultiBuilder): FILE: lavis/datasets/builders/imagefolder_builder.py class ImageNetBuilder (line 16) | class ImageNetBuilder(BaseDatasetBuilder): method _download_ann (line 22) | def _download_ann(self): method build (line 25) | def build(self): FILE: lavis/datasets/builders/object3d_caption_builder.py class ObjaverseCaptionBuilder (line 20) | class ObjaverseCaptionBuilder(MultiModalDatasetBuilder): method build (line 28) | def build(self): class ObjaverseCaptionInstructBuilder (line 41) | class ObjaverseCaptionInstructBuilder(ObjaverseCaptionBuilder): class ShapenetCaptionBuilder (line 50) | class ShapenetCaptionBuilder(ObjaverseCaptionBuilder): class ShapenetCaptionInstructBuilder (line 59) | class ShapenetCaptionInstructBuilder(ObjaverseCaptionBuilder): FILE: lavis/datasets/builders/object3d_classification_builder.py class ModelNetClassificationBuilder (line 13) | class ModelNetClassificationBuilder(MultiModalDatasetBuilder): FILE: lavis/datasets/builders/object3d_qa_builder.py class ObjaverseQABuilder (line 13) | class ObjaverseQABuilder(ObjaverseCaptionBuilder): FILE: lavis/datasets/builders/retrieval_builder.py class MSRVTTRetrievalBuilder (line 20) | class MSRVTTRetrievalBuilder(BaseDatasetBuilder): class DiDeMoRetrievalBuilder (line 28) | class DiDeMoRetrievalBuilder(BaseDatasetBuilder): class COCORetrievalBuilder (line 36) | class COCORetrievalBuilder(BaseDatasetBuilder): class Flickr30kBuilder (line 44) | class Flickr30kBuilder(BaseDatasetBuilder): FILE: lavis/datasets/builders/text_to_image_generation_builder.py class BlipDiffusionFinetuneBuilder (line 16) | class BlipDiffusionFinetuneBuilder(BaseDatasetBuilder): method _download_ann (line 23) | def _download_ann(self): method build (line 26) | def build(self): FILE: lavis/datasets/builders/video_qa_builder.py class VideoQABuilder (line 15) | class VideoQABuilder(BaseDatasetBuilder): method build (line 19) | def build(self): class MSRVTTQABuilder (line 35) | class MSRVTTQABuilder(VideoQABuilder): class MSVDQABuilder (line 42) | class MSVDQABuilder(VideoQABuilder): class MSRVTTQAInstructBuilder (line 49) | class MSRVTTQAInstructBuilder(VideoQABuilder): class MSVDQAInstructBuilder (line 58) | class MSVDQAInstructBuilder(VideoQABuilder): class MusicAVQABuilder (line 66) | class MusicAVQABuilder(MultiModalDatasetBuilder): class MusicAVQAInstructBuilder (line 73) | class MusicAVQAInstructBuilder(MultiModalDatasetBuilder): FILE: lavis/datasets/builders/vqa_builder.py class COCOVQABuilder (line 20) | class COCOVQABuilder(BaseDatasetBuilder): class COCOVQAInstructBuilder (line 30) | class COCOVQAInstructBuilder(BaseDatasetBuilder): class VGVQABuilder (line 40) | class VGVQABuilder(BaseDatasetBuilder): class VGVQAInstructBuilder (line 45) | class VGVQAInstructBuilder(BaseDatasetBuilder): class OKVQABuilder (line 50) | class OKVQABuilder(COCOVQABuilder): class OKVQAInstructBuilder (line 56) | class OKVQAInstructBuilder(COCOVQAInstructBuilder): class AOKVQABuilder (line 62) | class AOKVQABuilder(BaseDatasetBuilder): class AOKVQAInstructBuilder (line 69) | class AOKVQAInstructBuilder(BaseDatasetBuilder): class GQABuilder (line 77) | class GQABuilder(BaseDatasetBuilder): class GQAInstructBuilder (line 88) | class GQAInstructBuilder(BaseDatasetBuilder): class IconQABuilder (line 99) | class IconQABuilder(BaseDatasetBuilder): class IconQAInstructBuilder (line 108) | class IconQAInstructBuilder(BaseDatasetBuilder): class ScienceQABuilder (line 117) | class ScienceQABuilder(BaseDatasetBuilder): class ScienceQAInstructBuilder (line 124) | class ScienceQAInstructBuilder(BaseDatasetBuilder): class OCRVQABuilder (line 131) | class OCRVQABuilder(BaseDatasetBuilder): class OCRVQAInstructBuilder (line 138) | class OCRVQAInstructBuilder(BaseDatasetBuilder): class VizWizVQABuilder (line 146) | class VizWizVQABuilder(BaseDatasetBuilder): FILE: lavis/datasets/data_utils.py function load_video (line 30) | def load_video(video_path, n_frms=MAX_INT, height=-1, width=-1, sampling... function apply_to_sample (line 53) | def apply_to_sample(f, sample): function move_to_cuda (line 71) | def move_to_cuda(sample): function prepare_sample (line 78) | def prepare_sample(samples, cuda_enabled=True): function reorg_datasets_by_split (line 87) | def reorg_datasets_by_split(datasets): function concat_datasets (line 113) | def concat_datasets(datasets): function extract_archive (line 180) | def extract_archive(from_path, to_path=None, overwrite=False): function save_frames_grid (line 262) | def save_frames_grid(img_array, out_path): function uniform_frame_sampling (line 289) | def uniform_frame_sampling(video_path, num_frames, target_height, target... function head_tail_frame_sampling (line 316) | def head_tail_frame_sampling(video_path, num_frames, target_height, targ... function load_clip (line 345) | def load_clip(video_path, num_frames, target_height, target_width, start... FILE: lavis/datasets/datasets/aok_vqa_datasets.py class __DisplMixin (line 19) | class __DisplMixin: method displ_item (line 20) | def displ_item(self, index): class AOKVQADataset (line 35) | class AOKVQADataset(VQADataset, __DisplMixin): method __init__ (line 36) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 39) | def __getitem__(self, index): class AOKVQAInstructDataset (line 67) | class AOKVQAInstructDataset(AOKVQADataset): method __getitem__ (line 68) | def __getitem__(self, index): method collater (line 74) | def collater(self, samples): class AOKVQAEvalDataset (line 80) | class AOKVQAEvalDataset(VQAEvalDataset, __DisplMixin): method __init__ (line 81) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method collater (line 109) | def collater(self, samples): method __getitem__ (line 139) | def __getitem__(self, index): FILE: lavis/datasets/datasets/audio_captioning_datasets.py class __DisplMixin (line 22) | class __DisplMixin: method displ_item (line 23) | def displ_item(self, index): class AudioCaptioningDataset (line 38) | class AudioCaptioningDataset(BaseDataset, __DisplMixin): method __init__ (line 39) | def __init__(self, **kwargs): method get_audio_path (line 47) | def get_audio_path(self, ann): method is_empty_audio (line 50) | def is_empty_audio(self, ann): method get_existing_audio_annotations (line 64) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 67) | def get_existing_video_annotations(self): method get_existing_images_annotations (line 70) | def get_existing_images_annotations(self): method get_video_path (line 73) | def get_video_path(self, ann): method get_images_path (line 76) | def get_images_path(self, ann): method __len__ (line 79) | def __len__(self): method __getitem__ (line 82) | def __getitem__(self, index): method _build_templates (line 85) | def _build_templates(self, templates_path): class AudioSetDataset (line 93) | class AudioSetDataset(AudioCaptioningDataset): method __init__ (line 94) | def __init__(self, **kwargs): method get_audio_path (line 113) | def get_audio_path(self, ann): method __getitem__ (line 121) | def __getitem__(self, index): class AudioSetInstructDataset (line 149) | class AudioSetInstructDataset(AudioSetDataset): method __getitem__ (line 150) | def __getitem__(self, index): class AudioSetEvalDataset (line 157) | class AudioSetEvalDataset(AudioSetDataset): method __getitem__ (line 158) | def __getitem__(self, index): class AudioCapsDataset (line 164) | class AudioCapsDataset(AudioCaptioningDataset): method __init__ (line 165) | def __init__(self, **kwargs): method get_audio_path (line 182) | def get_audio_path(self, ann): method get_cached_audio_path (line 188) | def get_cached_audio_path(self, ann): method __getitem__ (line 194) | def __getitem__(self, index): class AudioCapsInstructDataset (line 219) | class AudioCapsInstructDataset(AudioCapsDataset): method __getitem__ (line 220) | def __getitem__(self, index): class AudioCapsEvalDataset (line 227) | class AudioCapsEvalDataset(AudioCapsDataset): method __init__ (line 228) | def __init__(self, **kwargs): method __getitem__ (line 233) | def __getitem__(self, index): class ClothoV2Dataset (line 239) | class ClothoV2Dataset(BaseDataset, __DisplMixin): method __init__ (line 240) | def __init__(self, **kwargs): method __getitem__ (line 260) | def __getitem__(self, index): class ClothoV2InstructDataset (line 269) | class ClothoV2InstructDataset(ClothoV2Dataset): method __getitem__ (line 270) | def __getitem__(self, index): class ClothoV2EvalDataset (line 277) | class ClothoV2EvalDataset(ClothoV2Dataset): method __getitem__ (line 278) | def __getitem__(self, index): class AudioLanguagePretrainDataset (line 313) | class AudioLanguagePretrainDataset(BaseDataset, __DisplMixin): method __init__ (line 314) | def __init__(self, **kwargs): method _load_json_file (line 326) | def _load_json_file(self, files, audio_root, blacklist=None): method __len__ (line 366) | def __len__(self): method __getitem__ (line 369) | def __getitem__(self, index): method _build_templates (line 391) | def _build_templates(self, templates_path): class AudioLanguagePretrainInstructDataset (line 394) | class AudioLanguagePretrainInstructDataset(AudioLanguagePretrainDataset): method __getitem__ (line 395) | def __getitem__(self, index): class AudioLanguagePretrainEvalDataset (line 402) | class AudioLanguagePretrainEvalDataset(AudioLanguagePretrainDataset): method __getitem__ (line 403) | def __getitem__(self, index): FILE: lavis/datasets/datasets/audio_classification_datasets.py class __DisplMixin (line 22) | class __DisplMixin: method displ_item (line 23) | def displ_item(self, index): class ESC50 (line 38) | class ESC50(BaseDataset, __DisplMixin): method __init__ (line 39) | def __init__(self, **kwargs): method get_audio_path (line 49) | def get_audio_path(self, ann): method is_empty_audio (line 52) | def is_empty_audio(self, ann): method get_existing_audio_annotations (line 66) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 69) | def get_existing_video_annotations(self): method get_existing_images_annotations (line 72) | def get_existing_images_annotations(self): method get_video_path (line 75) | def get_video_path(self, ann): method get_images_path (line 78) | def get_images_path(self, ann): method __len__ (line 81) | def __len__(self): method __getitem__ (line 85) | def __getitem__(self, index): FILE: lavis/datasets/datasets/audio_qa_datasets.py class AudioCapsQADataset (line 15) | class AudioCapsQADataset(AudioCapsDataset): method __init__ (line 16) | def __init__(self, **kwargs): method __getitem__ (line 21) | def __getitem__(self, index): class ClothoQADataset (line 69) | class ClothoQADataset(BaseDataset): method __init__ (line 70) | def __init__(self, **kwargs): method __getitem__ (line 96) | def __getitem__(self, index): method _build_templates (line 115) | def _build_templates(self, template): FILE: lavis/datasets/datasets/avsd_dialogue_datasets.py class AVSDDialDataset (line 19) | class AVSDDialDataset(DialogueDataset): method __init__ (line 20) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 28) | def __getitem__(self, index): method collater (line 49) | def collater(self, samples): class AVSDDialEvalDataset (line 96) | class AVSDDialEvalDataset(DialogueEvalDataset): method __init__ (line 97) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 105) | def __getitem__(self, index): method collater (line 126) | def collater(self, samples): class AVSDDialInstructEvalDataset (line 173) | class AVSDDialInstructEvalDataset(DialogueDataset): method __init__ (line 174) | def __init__(self, **kwargs): method get_existing_audio_annotations (line 191) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 194) | def get_existing_video_annotations(self): method get_audio_path (line 197) | def get_audio_path(self, sample_key): method get_video_path (line 200) | def get_video_path(self, sample_key): method __getitem__ (line 203) | def __getitem__(self, index): method __len__ (line 226) | def __len__(self): FILE: lavis/datasets/datasets/base_dataset.py class BaseDataset (line 17) | class BaseDataset(Dataset): method __init__ (line 18) | def __init__( method __len__ (line 50) | def __len__(self): method collater (line 53) | def collater(self, samples): method set_processors (line 68) | def set_processors(self, vis_processor, text_processor): method _add_instance_ids (line 72) | def _add_instance_ids(self, key="instance_id"): class ConcatDataset (line 76) | class ConcatDataset(ConcatDataset): method __init__ (line 77) | def __init__(self, datasets: Iterable[Dataset]) -> None: method collater (line 80) | def collater(self, samples): FILE: lavis/datasets/datasets/capfilt_dataset.py class CapFiltCaptionDataset (line 17) | class CapFiltCaptionDataset(BaseDataset, __DisplMixin): method __init__ (line 18) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 34) | def __getitem__(self, index): class CapFiltCaptionInstructDataset (line 52) | class CapFiltCaptionInstructDataset(CapFiltCaptionDataset): method __getitem__ (line 53) | def __getitem__(self, index): FILE: lavis/datasets/datasets/caption_datasets.py class __DisplMixin (line 15) | class __DisplMixin: method displ_item (line 16) | def displ_item(self, index): class CaptionDataset (line 28) | class CaptionDataset(BaseDataset, __DisplMixin): method __init__ (line 29) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 44) | def __getitem__(self, index): class CaptionEvalDataset (line 64) | class CaptionEvalDataset(BaseDataset, __DisplMixin): method __init__ (line 65) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 73) | def __getitem__(self, index): class CaptionInstructDataset (line 88) | class CaptionInstructDataset(CaptionDataset): method __getitem__ (line 89) | def __getitem__(self, index): FILE: lavis/datasets/datasets/coco_caption_datasets.py class COCOCapEvalDataset (line 22) | class COCOCapEvalDataset(CaptionEvalDataset): method __init__ (line 23) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 31) | def __getitem__(self, index): class NoCapsEvalDataset (line 49) | class NoCapsEvalDataset(CaptionEvalDataset): method __init__ (line 50) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 58) | def __getitem__(self, index): FILE: lavis/datasets/datasets/coco_vqa_datasets.py class __DisplMixin (line 18) | class __DisplMixin: method displ_item (line 19) | def displ_item(self, index): class COCOVQADataset (line 33) | class COCOVQADataset(VQADataset, __DisplMixin): method __init__ (line 34) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 37) | def __getitem__(self, index): class COCOVQAInstructDataset (line 64) | class COCOVQAInstructDataset(COCOVQADataset): method __getitem__ (line 65) | def __getitem__(self, index): method collater (line 71) | def collater(self, samples): class COCOVQAEvalDataset (line 78) | class COCOVQAEvalDataset(VQAEvalDataset, __DisplMixin): method __init__ (line 79) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 107) | def __getitem__(self, index): FILE: lavis/datasets/datasets/dataloader_utils.py class MultiIterLoader (line 15) | class MultiIterLoader: method __init__ (line 24) | def __init__(self, loaders, ratios=None): method __next__ (line 39) | def __next__(self): class PrefetchLoader (line 45) | class PrefetchLoader(object): method __init__ (line 53) | def __init__(self, loader): method __iter__ (line 57) | def __iter__(self): method __len__ (line 72) | def __len__(self): method preload (line 75) | def preload(self, it): method next (line 100) | def next(self, it): method __next__ (line 108) | def __next__(self, it): method __getattr__ (line 111) | def __getattr__(self, name): function record_cuda_stream (line 116) | def record_cuda_stream(batch): class IterLoader (line 129) | class IterLoader: method __init__ (line 137) | def __init__(self, dataloader: DataLoader, use_distributed: bool = Fal... method epoch (line 144) | def epoch(self) -> int: method __next__ (line 147) | def __next__(self): method __iter__ (line 160) | def __iter__(self): method __len__ (line 163) | def __len__(self): FILE: lavis/datasets/datasets/dialogue_datasets.py class __DisplMixin (line 19) | class __DisplMixin: method displ_item (line 20) | def displ_item(self, index): class DialogueDataset (line 32) | class DialogueDataset(BaseDataset, __DisplMixin): method __init__ (line 33) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 71) | def __getitem__(self, index): class DialogueEvalDataset (line 88) | class DialogueEvalDataset(BaseDataset, __DisplMixin): method __init__ (line 89) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 128) | def __getitem__(self, index): FILE: lavis/datasets/datasets/discriminatory_reasoning_datasets.py class __DisplMixin (line 17) | class __DisplMixin: method displ_item (line 18) | def displ_item(self, index): class DisCRnDataset (line 32) | class DisCRnDataset(BaseDataset, __DisplMixin): method __init__ (line 33) | def __init__(self, **kwargs): method get_existing_image_annotations (line 71) | def get_existing_image_annotations(self): method get_image_path (line 75) | def get_image_path(self, ann, entity_index): method get_existing_audio_annotations (line 80) | def get_existing_audio_annotations(self): method get_audio_path (line 83) | def get_audio_path(self, ann, entity_index): method get_video_path (line 87) | def get_video_path(self, ann, entity_index): method get_existing_video_annotations (line 91) | def get_existing_video_annotations(self): method get_existing_pc_annotations (line 94) | def get_existing_pc_annotations(self): method get_pc_path (line 98) | def get_pc_path(self, ann, entity_index): method __getitem__ (line 102) | def __getitem__(self, index): method __len__ (line 164) | def __len__(self): FILE: lavis/datasets/datasets/gqa_datasets.py class __DisplMixin (line 19) | class __DisplMixin: method displ_item (line 20) | def displ_item(self, index): class GQADataset (line 34) | class GQADataset(VQADataset, __DisplMixin): method __init__ (line 35) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 38) | def __getitem__(self, index): class GQAInstructDataset (line 57) | class GQAInstructDataset(GQADataset): method __getitem__ (line 58) | def __getitem__(self, index): method collater (line 64) | def collater(self, samples): class GQAEvalDataset (line 70) | class GQAEvalDataset(VQAEvalDataset, __DisplMixin): method __init__ (line 71) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 93) | def __getitem__(self, index): FILE: lavis/datasets/datasets/iconqa_datasets.py class __DisplMixin (line 20) | class __DisplMixin: method displ_item (line 21) | def displ_item(self, index): class IconQADataset (line 36) | class IconQADataset(VQADataset, __DisplMixin): method __init__ (line 37) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 48) | def __getitem__(self, index): class IconQAInstructDataset (line 66) | class IconQAInstructDataset(IconQADataset): method __getitem__ (line 67) | def __getitem__(self, index): method collater (line 73) | def collater(self, samples): class IconQAEvalDataset (line 79) | class IconQAEvalDataset(VQAEvalDataset, __DisplMixin): method __init__ (line 80) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method collater (line 91) | def collater(self, samples): method __getitem__ (line 120) | def __getitem__(self, index): FILE: lavis/datasets/datasets/image_text_pair_datasets.py class __DisplMixin (line 15) | class __DisplMixin: method displ_item (line 16) | def displ_item(self, index): class ImageTextPairDataset (line 28) | class ImageTextPairDataset(BaseDataset, __DisplMixin): method __init__ (line 29) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 36) | def __getitem__(self, index): class ImageTextPairInstructDataset (line 52) | class ImageTextPairInstructDataset(ImageTextPairDataset): method __getitem__ (line 53) | def __getitem__(self, index): FILE: lavis/datasets/datasets/imagefolder_dataset.py class ImageFolderDataset (line 16) | class ImageFolderDataset(BaseDataset): method __init__ (line 17) | def __init__(self, vis_processor, vis_root, classnames=[], **kwargs): method __len__ (line 31) | def __len__(self): method __getitem__ (line 34) | def __getitem__(self, index): method displ_item (line 50) | def displ_item(self, index): FILE: lavis/datasets/datasets/laion_dataset.py class LaionDataset (line 12) | class LaionDataset(BaseDataset): method __init__ (line 13) | def __init__(self, vis_processor, text_processor, location): method to_dict (line 26) | def to_dict(self, sample): class LaionInstructDataset (line 38) | class LaionInstructDataset(LaionDataset): method to_dict (line 39) | def to_dict(self, sample): function to_image_text_pair (line 49) | def to_image_text_pair(sample): FILE: lavis/datasets/datasets/llava150k_dataset.py class LLaVA150kInstructDataset (line 13) | class LLaVA150kInstructDataset(BaseDataset): method __init__ (line 14) | def __init__(self, vis_processor, text_processor,ann_paths, vis_root): method __len__ (line 19) | def __len__(self): method __getitem__ (line 22) | def __getitem__(self, index): FILE: lavis/datasets/datasets/multimodal_classification_datasets.py class MultimodalClassificationDataset (line 12) | class MultimodalClassificationDataset(BaseDataset): method __init__ (line 13) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 19) | def _build_class_labels(self): FILE: lavis/datasets/datasets/music_avqa.py class MusicAVQADataset (line 17) | class MusicAVQADataset(BaseDataset): method __init__ (line 18) | def __init__(self, **kwargs): method get_existing_audio_annotations (line 33) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 36) | def get_existing_video_annotations(self): method get_audio_path (line 39) | def get_audio_path(self, ann): method get_video_path (line 43) | def get_video_path(self, ann): method __getitem__ (line 46) | def __getitem__(self, index): class MusicAVQAInstructDataset (line 65) | class MusicAVQAInstructDataset(MusicAVQADataset): method __getitem__ (line 66) | def __getitem__(self, index): FILE: lavis/datasets/datasets/nlvr_datasets.py class __DisplMixin (line 19) | class __DisplMixin: method displ_item (line 20) | def displ_item(self, index): class NLVRDataset (line 34) | class NLVRDataset(MultimodalClassificationDataset, __DisplMixin): method __init__ (line 35) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 40) | def _build_class_labels(self): method _flip (line 44) | def _flip(samples): method __getitem__ (line 65) | def __getitem__(self, index): class NLVREvalDataset (line 91) | class NLVREvalDataset(NLVRDataset): method _flip (line 93) | def _flip(samples): FILE: lavis/datasets/datasets/object3d_captioning_datasets.py class __DisplMixin (line 22) | class __DisplMixin: method displ_item (line 23) | def displ_item(self, index): class Object3dCaptionDataset (line 36) | class Object3dCaptionDataset(BaseDataset, __DisplMixin): method __init__ (line 37) | def __init__(self, **kwargs): method get_existing_depth_annotations (line 54) | def get_existing_depth_annotations(self): method get_existing_images_annotations (line 57) | def get_existing_images_annotations(self): method get_existing_pc_annotations (line 60) | def get_existing_pc_annotations(self): method get_pc_path (line 63) | def get_pc_path(self, sample_key): method get_images_path (line 66) | def get_images_path(self, sample_key): method get_depth_path (line 69) | def get_depth_path(self, sample_key): method __getitem__ (line 72) | def __getitem__(self, index): method __len__ (line 87) | def __len__(self): method _build_templates (line 90) | def _build_templates(self, templates_path): class ObjaverseCaptionDataset (line 99) | class ObjaverseCaptionDataset(Object3dCaptionDataset, __DisplMixin): method __init__ (line 100) | def __init__(self, **kwargs): method get_existing_images_annotations (line 103) | def get_existing_images_annotations(self): method get_existing_pc_annotations (line 106) | def get_existing_pc_annotations(self): method get_pc_path (line 109) | def get_pc_path(self, sample_key): method get_images_path (line 112) | def get_images_path(self, sample_key): method __getitem__ (line 116) | def __getitem__(self, index): class ObjaverseCaptionInstructDataset (line 121) | class ObjaverseCaptionInstructDataset(ObjaverseCaptionDataset): method __getitem__ (line 122) | def __getitem__(self, index): class ObjaverseCaptionEvalDataset (line 130) | class ObjaverseCaptionEvalDataset(ObjaverseCaptionDataset): method __getitem__ (line 131) | def __getitem__(self, index): class ShapenetCaptionDataset (line 139) | class ShapenetCaptionDataset(Object3dCaptionDataset, __DisplMixin): method __init__ (line 140) | def __init__(self, **kwargs): method get_existing_pc_annotations (line 143) | def get_existing_pc_annotations(self): method get_pc_path (line 146) | def get_pc_path(self, sample_key): method get_images_path (line 149) | def get_images_path(self, sample_key): method __getitem__ (line 152) | def __getitem__(self, index): class ShapenetCaptionInstructDataset (line 164) | class ShapenetCaptionInstructDataset(ShapenetCaptionDataset): method __getitem__ (line 165) | def __getitem__(self, index): class ShapenetCaptionEvalDataset (line 172) | class ShapenetCaptionEvalDataset(ShapenetCaptionDataset): method __getitem__ (line 173) | def __getitem__(self, index): FILE: lavis/datasets/datasets/object3d_classification_datasets.py class __DisplMixin (line 23) | class __DisplMixin: method displ_item (line 24) | def displ_item(self, index): class ModelNetClassificationDataset (line 36) | class ModelNetClassificationDataset(BaseDataset, __DisplMixin): method __init__ (line 40) | def __init__(self, **kwargs): method _prepare_data (line 74) | def _prepare_data(self): method _process_raw_data (line 90) | def _process_raw_data(self): method __len__ (line 111) | def __len__(self): method _get_item (line 114) | def _get_item(self, index): method __getitem__ (line 137) | def __getitem__(self, index): FILE: lavis/datasets/datasets/object3d_qa_datasets.py class ObjaverseQADataset (line 16) | class ObjaverseQADataset(Object3dCaptionDataset): method __init__ (line 17) | def __init__(self, **kwargs): method get_existing_pc_annotations (line 25) | def get_existing_pc_annotations(self): method get_pc_path (line 28) | def get_pc_path(self, sample_key): method get_images_path (line 31) | def get_images_path(self, sample_key): method __getitem__ (line 35) | def __getitem__(self, index): FILE: lavis/datasets/datasets/ocr_datasets.py class OCRVQADataset (line 16) | class OCRVQADataset(VQADataset): method __init__ (line 17) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 37) | def __getitem__(self, index): class OCRVQAInstructDataset (line 60) | class OCRVQAInstructDataset(OCRVQADataset): method __getitem__ (line 61) | def __getitem__(self, index): method collater (line 66) | def collater(self, samples): FILE: lavis/datasets/datasets/retrieval_datasets.py class __DisplMixin (line 15) | class __DisplMixin: method displ_item (line 16) | def displ_item(self, index): class RetrievalDataset (line 29) | class RetrievalDataset(BaseDataset, __DisplMixin): method __init__ (line 30) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 45) | def __getitem__(self, index): class RetrievalEvalDataset (line 63) | class RetrievalEvalDataset(BaseDataset, __DisplMixin): method __init__ (line 64) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 88) | def __getitem__(self, index): class VideoRetrievalDataset (line 98) | class VideoRetrievalDataset(BaseDataset, __DisplMixin): method __init__ (line 99) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 114) | def __getitem__(self, index): class VideoRetrievalEvalDataset (line 131) | class VideoRetrievalEvalDataset(BaseDataset, __DisplMixin): method __init__ (line 132) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 156) | def __getitem__(self, index): FILE: lavis/datasets/datasets/snli_ve_datasets.py class __DisplMixin (line 17) | class __DisplMixin: method displ_item (line 18) | def displ_item(self, index): class SNLIVisualEntialmentDataset (line 31) | class SNLIVisualEntialmentDataset(MultimodalClassificationDataset, __Dis... method __init__ (line 32) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 37) | def _build_class_labels(self): method __getitem__ (line 40) | def __getitem__(self, index): class SNLIVisualEntialmentInstructDataset (line 58) | class SNLIVisualEntialmentInstructDataset(SNLIVisualEntialmentDataset, _... method __init__ (line 59) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 63) | def __getitem__(self, index): FILE: lavis/datasets/datasets/subject_driven_t2i_dataset.py class SubjectDrivenTextToImageDataset (line 15) | class SubjectDrivenTextToImageDataset(Dataset): method __init__ (line 16) | def __init__( method __len__ (line 45) | def __len__(self): method len_without_repeat (line 49) | def len_without_repeat(self): method collater (line 52) | def collater(self, samples): method __getitem__ (line 55) | def __getitem__(self, index): FILE: lavis/datasets/datasets/textcaps_datasets.py class TextCapsCapDataset (line 10) | class TextCapsCapDataset(CaptionDataset): method __init__ (line 11) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): class TextCapsCapInstructDataset (line 29) | class TextCapsCapInstructDataset(TextCapsCapDataset): method __getitem__ (line 30) | def __getitem__(self, index): class TextCapsCapEvalDataset (line 37) | class TextCapsCapEvalDataset(CaptionEvalDataset): method __init__ (line 38) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): FILE: lavis/datasets/datasets/valor_caption.py class VALORCaptionDataset (line 17) | class VALORCaptionDataset(BaseDataset): method __init__ (line 18) | def __init__(self, **kwargs): method __len__ (line 36) | def __len__(self): method get_existing_audio_annotations (line 39) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 42) | def get_existing_video_annotations(self): method get_audio_path (line 46) | def get_audio_path(self, ann): method get_video_path (line 49) | def get_video_path(self, ann): method __getitem__ (line 53) | def __getitem__(self, index): class VALORCaptionEvalDataset (line 73) | class VALORCaptionEvalDataset(VALORCaptionDataset): method __getitem__ (line 74) | def __getitem__(self, index): class VALORCaptionInstuctDataset (line 82) | class VALORCaptionInstuctDataset(VALORCaptionDataset): method __getitem__ (line 83) | def __getitem__(self, index): FILE: lavis/datasets/datasets/vatex_captioning_datasets.py class VATEXCaptionDataset (line 17) | class VATEXCaptionDataset(BaseDataset): method __init__ (line 18) | def __init__(self, **kwargs): method __len__ (line 35) | def __len__(self): method get_existing_audio_annotations (line 38) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 41) | def get_existing_video_annotations(self): method get_audio_path (line 45) | def get_audio_path(self, ann): method get_video_path (line 49) | def get_video_path(self, ann): method __getitem__ (line 53) | def __getitem__(self, index): class VATEXCaptionEvalDataset (line 73) | class VATEXCaptionEvalDataset(VATEXCaptionDataset): method __getitem__ (line 74) | def __getitem__(self, index): class VATEXCaptionInstuctDataset (line 81) | class VATEXCaptionInstuctDataset(VATEXCaptionDataset): method __getitem__ (line 82) | def __getitem__(self, index): FILE: lavis/datasets/datasets/vg_vqa_datasets.py class VGVQADataset (line 16) | class VGVQADataset(VQADataset): method __init__ (line 17) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 20) | def __getitem__(self, index): class VGVQAInstructDataset (line 41) | class VGVQAInstructDataset(VGVQADataset): method __getitem__ (line 42) | def __getitem__(self, index): method collater (line 47) | def collater(self, samples): FILE: lavis/datasets/datasets/video_caption_datasets.py class VideoCaptionDataset (line 14) | class VideoCaptionDataset(CaptionDataset): method __init__ (line 15) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 23) | def __getitem__(self, index): class VideoCaptionEvalDataset (line 48) | class VideoCaptionEvalDataset(BaseDataset): method __init__ (line 49) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __len__ (line 61) | def __len__(self): method __getitem__ (line 64) | def __getitem__(self, index): class VideoCaptionInstructDataset (line 83) | class VideoCaptionInstructDataset(VideoCaptionDataset): method __getitem__ (line 84) | def __getitem__(self, index): class ClipCaptionDataset (line 93) | class ClipCaptionDataset(BaseDataset): method __init__ (line 97) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 100) | def __getitem__(self, index): class ClipCaptionInstructDataset (line 124) | class ClipCaptionInstructDataset(ClipCaptionDataset): method __getitem__ (line 125) | def __getitem__(self, index): class ClipCaptionEvalDataset (line 132) | class ClipCaptionEvalDataset(ClipCaptionDataset): method __getitem__ (line 133) | def __getitem__(self, index): class WebVideoCaptionDataset (line 140) | class WebVideoCaptionDataset(BaseDataset): method __init__ (line 141) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _get_video (line 144) | def _get_video(self, index): method __getitem__ (line 159) | def __getitem__(self, index): class WebVideoCaptionInstructDataset (line 171) | class WebVideoCaptionInstructDataset(WebVideoCaptionDataset): method __getitem__ (line 172) | def __getitem__(self, index): FILE: lavis/datasets/datasets/video_vqa_datasets.py class __DisplMixin (line 17) | class __DisplMixin: method displ_item (line 18) | def displ_item(self, index): class VideoQADataset (line 29) | class VideoQADataset(MultimodalClassificationDataset, __DisplMixin): method __init__ (line 30) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 33) | def _build_class_labels(self, ans_path): method _get_answer_label (line 38) | def _get_answer_label(self, answer): method __getitem__ (line 44) | def __getitem__(self, index): class VideoQAInstructDataset (line 65) | class VideoQAInstructDataset(VideoQADataset): method __getitem__ (line 66) | def __getitem__(self, index): FILE: lavis/datasets/datasets/violin_dataset.py class __DisplMixin (line 18) | class __DisplMixin: method displ_item (line 19) | def displ_item(self, index): class ViolinVideoEntailmentDataset (line 31) | class ViolinVideoEntailmentDataset(MultimodalClassificationDataset): method __init__ (line 32) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 36) | def _build_class_labels(self): method __getitem__ (line 39) | def __getitem__(self, index): class ViolinVideoEntailmentInstructDataset (line 63) | class ViolinVideoEntailmentInstructDataset(ViolinVideoEntailmentDataset): method __getitem__ (line 64) | def __getitem__(self, index): class ViolinVideoCaptionDataset (line 73) | class ViolinVideoCaptionDataset(BaseDataset): method __init__ (line 74) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 78) | def __getitem__(self, index): class ViolinVideoCaptionInstructDataset (line 99) | class ViolinVideoCaptionInstructDataset(ViolinVideoCaptionDataset): method __getitem__ (line 100) | def __getitem__(self, index): class ViolinVideoCaptionEvalDataset (line 107) | class ViolinVideoCaptionEvalDataset(ViolinVideoCaptionDataset): method __getitem__ (line 108) | def __getitem__(self, index): FILE: lavis/datasets/datasets/visdial_dialogue_datasets.py class __DisplMixin (line 19) | class __DisplMixin: method displ_item (line 20) | def displ_item(self, index): class VisDialDataset (line 32) | class VisDialDataset(DialogueDataset, __DisplMixin): method __init__ (line 33) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 86) | def __getitem__(self, index): class VisDialInstructDataset (line 103) | class VisDialInstructDataset(VisDialDataset, __DisplMixin): method __init__ (line 104) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 111) | def __getitem__(self, index): class VisDialEvalDataset (line 117) | class VisDialEvalDataset(VisDialDataset, __DisplMixin): method __init__ (line 118) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 125) | def __getitem__(self, index): FILE: lavis/datasets/datasets/vizwiz_vqa_datasets.py class VizWizEvalDataset (line 12) | class VizWizEvalDataset(VQAEvalDataset): method __init__ (line 13) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 20) | def __getitem__(self, index): FILE: lavis/datasets/datasets/vlep_dataset.py class VlepVideoDataset (line 16) | class VlepVideoDataset(BaseDataset): method __init__ (line 17) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 28) | def __getitem__(self, index): class VlepVideoInstructDataset (line 50) | class VlepVideoInstructDataset(VlepVideoDataset): method __getitem__ (line 51) | def __getitem__(self, index): class VlepVideoEvalDataset (line 67) | class VlepVideoEvalDataset(VlepVideoDataset): method __getitem__ (line 68) | def __getitem__(self, index): FILE: lavis/datasets/datasets/vqa_datasets.py class VQADataset (line 13) | class VQADataset(BaseDataset): method __init__ (line 14) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method collater (line 17) | def collater(self, samples): class VQAInstructDataset (line 46) | class VQAInstructDataset(VQADataset): method collater (line 47) | def collater(self, samples): class VQAEvalDataset (line 52) | class VQAEvalDataset(BaseDataset): method __init__ (line 53) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): FILE: lavis/datasets/datasets/vsr_datasets.py class VSRClassificationDataset (line 19) | class VSRClassificationDataset(MultimodalClassificationDataset): method __init__ (line 20) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method _build_class_labels (line 29) | def _build_class_labels(self): method __getitem__ (line 32) | def __getitem__(self, index): class VSRClassificationInstructDataset (line 50) | class VSRClassificationInstructDataset(VSRClassificationDataset): method __init__ (line 51) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 58) | def __getitem__(self, index): class VSRCaptionDataset (line 65) | class VSRCaptionDataset(BaseDataset): method __init__ (line 66) | def __init__(self, vis_processor, text_processor, vis_root, ann_paths): method __getitem__ (line 74) | def __getitem__(self, index): class VSRCaptionInstructDataset (line 90) | class VSRCaptionInstructDataset(VSRCaptionDataset): method __getitem__ (line 91) | def __getitem__(self, index): class VSRCaptionEvalDataset (line 99) | class VSRCaptionEvalDataset(VSRCaptionDataset): method __getitem__ (line 100) | def __getitem__(self, index): FILE: lavis/datasets/datasets/yt8m_video_dialogue_datasets.py class YT8MDialDataset (line 18) | class YT8MDialDataset(BaseDataset): method __init__ (line 19) | def __init__(self, **kwargs): method get_existing_audio_annotations (line 34) | def get_existing_audio_annotations(self): method get_existing_video_annotations (line 37) | def get_existing_video_annotations(self): method get_audio_path (line 40) | def get_audio_path(self, ann): method get_video_path (line 43) | def get_video_path(self, ann): method __getitem__ (line 46) | def __getitem__(self, index): FILE: lavis/datasets/download_scripts/DownloadConceptualCaptions/download_data_cc12m.py function _df_split_apply (line 34) | def _df_split_apply(tup_arg): function df_multiprocess (line 40) | def df_multiprocess(df, processes, chunk_size, func, dataset_name): function _file_name (line 82) | def _file_name(row): function check_mimetype (line 97) | def check_mimetype(row): function check_download (line 106) | def check_download(row): function resize_img (line 124) | def resize_img(req): function download_image (line 134) | def download_image(row): function open_tsv (line 174) | def open_tsv(fname, folder): function df_from_shelve (line 184) | def df_from_shelve(chunk_size, func, dataset_name): FILE: lavis/datasets/download_scripts/DownloadConceptualCaptions/download_data_cc3m.py function _df_split_apply (line 34) | def _df_split_apply(tup_arg): function df_multiprocess (line 40) | def df_multiprocess(df, processes, chunk_size, func, dataset_name): function _file_name (line 82) | def _file_name(row): function check_mimetype (line 97) | def check_mimetype(row): function check_download (line 106) | def check_download(row): function resize_img (line 124) | def resize_img(req): function download_image (line 134) | def download_image(row): function open_tsv (line 174) | def open_tsv(fname, folder): function df_from_shelve (line 184) | def df_from_shelve(chunk_size, func, dataset_name): FILE: lavis/datasets/download_scripts/download_coco.py function download_datasets (line 29) | def download_datasets(root, url): FILE: lavis/datasets/download_scripts/download_didemo.py function download_datasets (line 23) | def download_datasets(root, url): function move_files (line 31) | def move_files(download_path, storage_path): FILE: lavis/datasets/download_scripts/download_flickr.py function move_directory (line 32) | def move_directory(src_dir, dst_dir): FILE: lavis/datasets/download_scripts/download_gqa.py function download_datasets (line 24) | def download_datasets(root, url): FILE: lavis/datasets/download_scripts/download_msrvtt.py function download_datasets (line 38) | def download_datasets(root, url): function merge_datasets (line 46) | def merge_datasets(download_path, storage_path): FILE: lavis/datasets/download_scripts/download_msvd.py function download_datasets (line 24) | def download_datasets(root, url): function move_files (line 28) | def move_files(download_path, storage_path): FILE: lavis/datasets/download_scripts/download_nocaps.py function download_file (line 39) | def download_file(url, filename): function download_image_from_url_val (line 63) | def download_image_from_url_val(url): function download_image_from_url_test (line 70) | def download_image_from_url_test(url): FILE: lavis/datasets/download_scripts/download_sbu.py function fetch_single_image (line 28) | def fetch_single_image(image_url, timeout=None, retries=0): function download_and_save_image (line 44) | def download_and_save_image(ann, save_dir, timeout=None, retries=0): FILE: lavis/datasets/download_scripts/download_vg.py function download_datasets (line 27) | def download_datasets(root, url): FILE: lavis/models/__init__.py function load_model (line 97) | def load_model(name, model_type, is_eval=False, device="cpu", checkpoint... function load_preprocess (line 131) | def load_preprocess(config): function load_model_and_preprocess (line 183) | def load_model_and_preprocess(name, model_type, is_eval=False, device="c... class ModelZoo (line 231) | class ModelZoo: method __init__ (line 242) | def __init__(self) -> None: method __str__ (line 248) | def __str__(self) -> str: method __iter__ (line 263) | def __iter__(self): method __len__ (line 266) | def __len__(self): FILE: lavis/models/albef_models/__init__.py class AlbefBase (line 25) | class AlbefBase(BaseModel): method init_tokenizer (line 27) | def init_tokenizer(cls): method load_from_pretrained (line 30) | def load_from_pretrained(self, url_or_filename, rename_text_keys=True): function compute_sim_matrix (line 76) | def compute_sim_matrix(model, data_loader, **kwargs): FILE: lavis/models/albef_models/albef_classification.py class AlbefClassification (line 26) | class AlbefClassification(AlbefBase, MomentumDistilationMixin): method __init__ (line 31) | def __init__( method _rampup_factor (line 80) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 83) | def forward(self, samples, is_train=True): method predict (line 149) | def predict(self, samples): method from_config (line 154) | def from_config(cls, cfg=None): FILE: lavis/models/albef_models/albef_feature_extractor.py class AlbefFeatureExtractor (line 23) | class AlbefFeatureExtractor(AlbefBase): method __init__ (line 28) | def __init__(self, image_encoder, text_encoder, embed_dim=256, max_txt... method extract_features (line 49) | def extract_features(self, samples, mode="multimodal"): method from_config (line 175) | def from_config(cls, cfg=None): FILE: lavis/models/albef_models/albef_nlvr.py class AlbefNLVR (line 24) | class AlbefNLVR(AlbefBase, MomentumDistilationMixin): method __init__ (line 29) | def __init__( method _rampup_factor (line 76) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 79) | def forward(self, samples, is_train=True): method share_cross_attention (line 198) | def share_cross_attention(self, model): method predict (line 213) | def predict(self, samples): method load_from_pretrained (line 217) | def load_from_pretrained(self, url_or_filename, use_distill=True): method from_config (line 227) | def from_config(cls, cfg=None): FILE: lavis/models/albef_models/albef_outputs.py class AlbefSimilarity (line 20) | class AlbefSimilarity(ModelOutput): class AlbefIntermediateOutput (line 32) | class AlbefIntermediateOutput(ModelOutput): class AlbefOutput (line 54) | class AlbefOutput(ModelOutput): class AlbefOutputWithLogits (line 70) | class AlbefOutputWithLogits(AlbefOutput): class AlbefOutputFeatures (line 76) | class AlbefOutputFeatures(ModelOutput): FILE: lavis/models/albef_models/albef_pretrain.py class AlbefPretrain (line 29) | class AlbefPretrain(AlbefBase, MomentumDistilationMixin, SharedQueueMixin): method __init__ (line 41) | def __init__( method _rampup_factor (line 102) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 105) | def forward(self, samples): method mask (line 341) | def mask( method from_config (line 386) | def from_config(cls, cfg=None): FILE: lavis/models/albef_models/albef_retrieval.py class AlbefRetrieval (line 26) | class AlbefRetrieval(AlbefBase, MomentumDistilationMixin, SharedQueueMix... method __init__ (line 45) | def __init__( method _rampup_factor (line 104) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 107) | def forward(self, samples): method from_config (line 310) | def from_config(cls, cfg=None): method compute_sim_matrix (line 338) | def compute_sim_matrix(self, data_loader, task_cfg): FILE: lavis/models/albef_models/albef_vqa.py class AlbefVQA (line 25) | class AlbefVQA(AlbefBase, MomentumDistilationMixin): method __init__ (line 42) | def __init__( method _rampup_factor (line 80) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 83) | def forward(self, samples): method forward_encoder (line 137) | def forward_encoder(self, samples): method forward_decoder (line 167) | def forward_decoder(self, samples, encoder_out, **kwargs): method predict_answers (line 228) | def predict_answers(self, samples, answer_list, num_ans_candidates=128... method rank_answers (line 269) | def rank_answers(self, samples, answer_list, num_ans_candidates): method from_config (line 349) | def from_config(cls, cfg=None): method load_from_pretrained (line 381) | def load_from_pretrained(self, url_or_filename): FILE: lavis/models/alpro_models/__init__.py class AlproBase (line 19) | class AlproBase(BaseModel): method init_tokenizer (line 21) | def init_tokenizer(cls): method load_from_pretrained (line 24) | def load_from_pretrained(self, url_or_filename, num_frames, num_patches): function resize_spatial_embedding (line 78) | def resize_spatial_embedding(state_dict, key, num_patches): function resize_temporal_embedding (line 95) | def resize_temporal_embedding(state_dict, key, num_frames): FILE: lavis/models/alpro_models/alpro_outputs.py class AlproSimilarity (line 19) | class AlproSimilarity(ModelOutput): class AlproIntermediateOutput (line 28) | class AlproIntermediateOutput(ModelOutput): class AlproOutput (line 42) | class AlproOutput(ModelOutput): class AlproOutputWithLogits (line 58) | class AlproOutputWithLogits(AlproOutput): FILE: lavis/models/alpro_models/alpro_qa.py class AlproQA (line 25) | class AlproQA(AlproBase): method __init__ (line 31) | def __init__( method forward (line 53) | def forward(self, samples, is_train=True): method predict (line 109) | def predict(self, samples): method from_config (line 114) | def from_config(cls, cfg): FILE: lavis/models/alpro_models/alpro_retrieval.py class AlproRetrieval (line 30) | class AlproRetrieval(AlproBase): method __init__ (line 36) | def __init__( method forward (line 65) | def forward(self, samples): method compute_vtm (line 150) | def compute_vtm( method compute_sim_matrix (line 242) | def compute_sim_matrix(self, data_loader, task_cfg): method from_config (line 397) | def from_config(cls, cfg): FILE: lavis/models/base_model.py class BaseModel (line 19) | class BaseModel(nn.Module): method __init__ (line 22) | def __init__(self): method device (line 26) | def device(self): method load_checkpoint (line 29) | def load_checkpoint(self, url_or_filename): method from_pretrained (line 59) | def from_pretrained(cls, model_type): method default_config_path (line 75) | def default_config_path(cls, model_type): method load_checkpoint_from_config (line 81) | def load_checkpoint_from_config(self, cfg, **kwargs): method before_training (line 104) | def before_training(self, **kwargs): method get_optimizer_params (line 107) | def get_optimizer_params(self, weight_decay, lr_scale=1): method before_evaluation (line 122) | def before_evaluation(self, **kwargs): method show_n_params (line 125) | def show_n_params(self, return_str=True): class BaseEncoder (line 141) | class BaseEncoder(nn.Module): method __init__ (line 146) | def __init__(self): method forward_features (line 149) | def forward_features(self, samples, **kwargs): method device (line 153) | def device(self): class SharedQueueMixin (line 157) | class SharedQueueMixin: method _dequeue_and_enqueue (line 159) | def _dequeue_and_enqueue(self, image_feat, text_feat, idxs=None): class MomentumDistilationMixin (line 181) | class MomentumDistilationMixin: method copy_params (line 183) | def copy_params(self): method _momentum_update (line 192) | def _momentum_update(self): class GatherLayer (line 202) | class GatherLayer(torch.autograd.Function): method forward (line 209) | def forward(ctx, x): method backward (line 217) | def backward(ctx, *grads): function all_gather_with_grad (line 223) | def all_gather_with_grad(tensors): function concat_all_gather (line 241) | def concat_all_gather(tensor): function tile (line 259) | def tile(x, dim, n_tile): FILE: lavis/models/beats/BEATs.py class BEATsConfig (line 26) | class BEATsConfig: method __init__ (line 27) | def __init__(self, cfg=None): method update (line 67) | def update(self, cfg: dict): class BEATs (line 71) | class BEATs(nn.Module): method __init__ (line 72) | def __init__( method forward_padding_mask (line 104) | def forward_padding_mask( method preprocess (line 118) | def preprocess( method extract_features (line 133) | def extract_features( FILE: lavis/models/beats/Tokenizers.py class TokenizersConfig (line 29) | class TokenizersConfig: method __init__ (line 30) | def __init__(self, cfg=None): method update (line 68) | def update(self, cfg: dict): class Tokenizers (line 72) | class Tokenizers(nn.Module): method __init__ (line 73) | def __init__( method forward_padding_mask (line 109) | def forward_padding_mask( method preprocess (line 123) | def preprocess( method extract_labels (line 138) | def extract_labels( FILE: lavis/models/beats/backbone.py class TransformerEncoder (line 26) | class TransformerEncoder(nn.Module): method __init__ (line 27) | def __init__(self, args): method forward (line 101) | def forward(self, x, padding_mask=None, layer=None): method extract_features (line 109) | def extract_features(self, x, padding_mask=None, tgt_layer=None): class TransformerSentenceEncoderLayer (line 153) | class TransformerSentenceEncoderLayer(nn.Module): method __init__ (line 154) | def __init__( method forward (line 214) | def forward( class MultiheadAttention (line 278) | class MultiheadAttention(nn.Module): method __init__ (line 284) | def __init__( method reset_parameters (line 370) | def reset_parameters(self): method _relative_positions_bucket (line 392) | def _relative_positions_bucket(self, relative_positions, bidirectional... method compute_bias (line 419) | def compute_bias(self, query_length, key_length): method forward (line 432) | def forward( method _append_prev_key_padding_mask (line 687) | def _append_prev_key_padding_mask( method _get_input_buffer (line 730) | def _get_input_buffer( method _set_input_buffer (line 740) | def _set_input_buffer( method apply_sparse_mask (line 747) | def apply_sparse_mask(self, attn_weights, tgt_len: int, src_len: int, ... function init_bert_params (line 751) | def init_bert_params(module): FILE: lavis/models/beats/modules.py class GradMultiply (line 17) | class GradMultiply(torch.autograd.Function): method forward (line 19) | def forward(ctx, x, scale): method backward (line 25) | def backward(ctx, grad): class SamePad (line 29) | class SamePad(nn.Module): method __init__ (line 30) | def __init__(self, kernel_size, causal=False): method forward (line 37) | def forward(self, x): class Swish (line 43) | class Swish(nn.Module): method __init__ (line 44) | def __init__(self): method forward (line 48) | def forward(self, x): class GLU_Linear (line 52) | class GLU_Linear(nn.Module): method __init__ (line 53) | def __init__(self, input_dim, output_dim, glu_type="sigmoid", bias_in_... method forward (line 73) | def forward(self, x): function gelu_accurate (line 85) | def gelu_accurate(x): function gelu (line 93) | def gelu(x: torch.Tensor) -> torch.Tensor: function get_activation_fn (line 97) | def get_activation_fn(activation: str): function quant_noise (line 121) | def quant_noise(module, p, block_size): FILE: lavis/models/beats/quantizer.py function l2norm (line 21) | def l2norm(t): function ema_inplace (line 25) | def ema_inplace(moving_avg, new, decay): function sample_vectors (line 29) | def sample_vectors(samples, num): function kmeans (line 40) | def kmeans(samples, num_clusters, num_iters=10, use_cosine_sim=False): class EmbeddingEMA (line 70) | class EmbeddingEMA(nn.Module): method __init__ (line 71) | def __init__(self, num_tokens, codebook_dim, decay=0.99, eps=1e-5, kme... method init_embed_ (line 97) | def init_embed_(self, data): method forward (line 106) | def forward(self, embed_id): method cluster_size_ema_update (line 109) | def cluster_size_ema_update(self, new_cluster_size): method embed_avg_ema_update (line 112) | def embed_avg_ema_update(self, new_embed_avg): method weight_update (line 115) | def weight_update(self, num_tokens): function norm_ema_inplace (line 126) | def norm_ema_inplace(moving_avg, new, decay): class NormEMAVectorQuantizer (line 131) | class NormEMAVectorQuantizer(nn.Module): method __init__ (line 132) | def __init__(self, n_embed, embedding_dim, beta, decay=0.99, eps=1e-5, method reset_cluster_size (line 152) | def reset_cluster_size(self, device): method forward (line 157) | def forward(self, z): FILE: lavis/models/beats_encoder.py class BeatsEncoder (line 18) | class BeatsEncoder(BaseEncoder): method __init__ (line 19) | def __init__(self, checkpoint_path=ckp_path): method from_config (line 38) | def from_config(cls, cfg): method forward (line 42) | def forward(self, x): FILE: lavis/models/blip2_models/Qformer.py class BertEmbeddings (line 51) | class BertEmbeddings(nn.Module): method __init__ (line 54) | def __init__(self, config): method forward (line 78) | def forward( class BertSelfAttention (line 111) | class BertSelfAttention(nn.Module): method __init__ (line 112) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 149) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 152) | def get_attn_gradients(self): method save_attention_map (line 155) | def save_attention_map(self, attention_map): method get_attention_map (line 158) | def get_attention_map(self): method transpose_for_scores (line 161) | def transpose_for_scores(self, x): method forward (line 169) | def forward( class BertSelfOutput (line 278) | class BertSelfOutput(nn.Module): method __init__ (line 279) | def __init__(self, config): method forward (line 285) | def forward(self, hidden_states, input_tensor): class BertAttention (line 292) | class BertAttention(nn.Module): method __init__ (line 293) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 299) | def prune_heads(self, heads): method forward (line 322) | def forward( class BertIntermediate (line 349) | class BertIntermediate(nn.Module): method __init__ (line 350) | def __init__(self, config): method forward (line 358) | def forward(self, hidden_states): class BertOutput (line 364) | class BertOutput(nn.Module): method __init__ (line 365) | def __init__(self, config): method forward (line 371) | def forward(self, hidden_states, input_tensor): class BertLayer (line 378) | class BertLayer(nn.Module): method __init__ (line 379) | def __init__(self, config, layer_num): method forward (line 402) | def forward( method feed_forward_chunk (line 476) | def feed_forward_chunk(self, attention_output): method feed_forward_chunk_query (line 481) | def feed_forward_chunk_query(self, attention_output): class BertEncoder (line 487) | class BertEncoder(nn.Module): method __init__ (line 488) | def __init__(self, config): method forward (line 495) | def forward( class BertPooler (line 592) | class BertPooler(nn.Module): method __init__ (line 593) | def __init__(self, config): method forward (line 598) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 607) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 608) | def __init__(self, config): method forward (line 617) | def forward(self, hidden_states): class BertLMPredictionHead (line 624) | class BertLMPredictionHead(nn.Module): method __init__ (line 625) | def __init__(self, config): method forward (line 638) | def forward(self, hidden_states): class BertOnlyMLMHead (line 644) | class BertOnlyMLMHead(nn.Module): method __init__ (line 645) | def __init__(self, config): method forward (line 649) | def forward(self, sequence_output): class BertPreTrainedModel (line 654) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 664) | def _init_weights(self, module): class BertModel (line 677) | class BertModel(BertPreTrainedModel): method __init__ (line 687) | def __init__(self, config, add_pooling_layer=False): method get_input_embeddings (line 699) | def get_input_embeddings(self): method set_input_embeddings (line 702) | def set_input_embeddings(self, value): method _prune_heads (line 705) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 713) | def get_extended_attention_mask( method forward (line 804) | def forward( class BertLMHeadModel (line 968) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 973) | def __init__(self, config): method get_output_embeddings (line 981) | def get_output_embeddings(self): method set_output_embeddings (line 984) | def set_output_embeddings(self, new_embeddings): method forward (line 987) | def forward( method prepare_inputs_for_generation (line 1097) | def prepare_inputs_for_generation( method _reorder_cache (line 1120) | def _reorder_cache(self, past, beam_idx): class BertForMaskedLM (line 1131) | class BertForMaskedLM(BertPreTrainedModel): method __init__ (line 1136) | def __init__(self, config): method get_output_embeddings (line 1144) | def get_output_embeddings(self): method set_output_embeddings (line 1147) | def set_output_embeddings(self, new_embeddings): method forward (line 1150) | def forward( FILE: lavis/models/blip2_models/blip2.py class Blip2Base (line 29) | class Blip2Base(BaseModel): method init_tokenizer (line 31) | def init_tokenizer(cls, truncation_side="right"): method maybe_autocast (line 36) | def maybe_autocast(self, dtype=torch.float16): method init_Qformer (line 47) | def init_Qformer(cls, num_query_token, vision_width, cross_attention_f... method init_vision_encoder (line 63) | def init_vision_encoder( method load_from_pretrained (line 85) | def load_from_pretrained(self, url_or_filename): method get_optimizer_params (line 105) | def get_optimizer_params(self, weight_decay, lr_scale=1): method _lemmatize (line 150) | def _lemmatize(self, answers): method lemmatizer (line 167) | def lemmatizer(self): function disabled_train (line 187) | def disabled_train(self, mode=True): class LayerNorm (line 193) | class LayerNorm(nn.LayerNorm): method forward (line 196) | def forward(self, x: torch.Tensor): function compute_sim_matrix (line 202) | def compute_sim_matrix(model, data_loader, **kwargs): FILE: lavis/models/blip2_models/blip2_image_text_matching.py class Blip2ITM (line 15) | class Blip2ITM(Blip2Qformer): method __init__ (line 27) | def __init__( method forward (line 53) | def forward(self, samples, match_head="itm"): FILE: lavis/models/blip2_models/blip2_opt.py class Blip2OPT (line 22) | class Blip2OPT(Blip2Base): method __init__ (line 42) | def __init__( method forward (line 107) | def forward(self, samples): method generate (line 165) | def generate( method predict_answers (line 282) | def predict_answers( method _lemmatize (line 356) | def _lemmatize(self, answers): method lemmatizer (line 373) | def lemmatizer(self): method from_config (line 394) | def from_config(cls, cfg): FILE: lavis/models/blip2_models/blip2_qformer.py class Blip2Qformer (line 27) | class Blip2Qformer(Blip2Base): method __init__ (line 45) | def __init__( method forward (line 90) | def forward(self, samples): method generate (line 278) | def generate( method forward_image (line 340) | def forward_image(self, image): method forward_text (line 356) | def forward_text(self, text_tokens): method compute_itm (line 364) | def compute_itm(self, image_inputs, text_ids, text_atts): method extract_features (line 387) | def extract_features(self, samples, mode="multimodal"): method from_config (line 501) | def from_config(cls, cfg): method compute_sim_matrix (line 529) | def compute_sim_matrix(self, data_loader, task_cfg): FILE: lavis/models/blip2_models/blip2_t5.py class Blip2T5 (line 20) | class Blip2T5(Blip2Base): method __init__ (line 40) | def __init__( method forward (line 102) | def forward(self, samples): method generate (line 159) | def generate( method predict_answers (line 247) | def predict_answers( method _lemmatize (line 314) | def _lemmatize(self, answers): method lemmatizer (line 331) | def lemmatizer(self): method from_config (line 352) | def from_config(cls, cfg): FILE: lavis/models/blip2_models/blip2_t5_instruct.py class Blip2T5Instruct (line 24) | class Blip2T5Instruct(Blip2Base): method __init__ (line 40) | def __init__( method forward (line 118) | def forward(self, samples): method prepare_few_shot_embeds (line 204) | def prepare_few_shot_embeds(self, samples): method generate (line 280) | def generate( method predict_answers (line 415) | def predict_answers( method predict_class (line 463) | def predict_class( method _predict_class (line 503) | def _predict_class( method _lemmatize (line 698) | def _lemmatize(self, answers): method lemmatizer (line 715) | def lemmatizer(self): method from_config (line 736) | def from_config(cls, cfg): FILE: lavis/models/blip2_models/blip2_vicuna_instruct.py class Blip2VicunaInstruct (line 26) | class Blip2VicunaInstruct(Blip2Base): method __init__ (line 42) | def __init__( method concat_text_input_output (line 123) | def concat_text_input_output(self, input_ids, input_atts, output_ids, ... method forward (line 147) | def forward(self, samples): method generate (line 249) | def generate( method predict_answers (line 386) | def predict_answers( method predict_class (line 434) | def predict_class( method _predict_class (line 476) | def _predict_class( method _lemmatize (line 658) | def _lemmatize(self, answers): method lemmatizer (line 675) | def lemmatizer(self): method from_config (line 696) | def from_config(cls, cfg): FILE: lavis/models/blip2_models/blip2_vicuna_xinstruct.py class CastOutputToFloat (line 41) | class CastOutputToFloat(nn.Sequential): method forward (line 42) | def forward(self, x): return super().forward(x).to(torch.float32) class Blip2VicunaXInstruct (line 46) | class Blip2VicunaXInstruct(Blip2Base): method __init__ (line 79) | def __init__( method concat_text_input_output (line 491) | def concat_text_input_output(self, input_ids, input_atts, output_ids, ... method forward (line 515) | def forward(self, samples): method init_image_encoder (line 807) | def init_image_encoder(self, method init_pc_encoder (line 821) | def init_pc_encoder( method init_video_encoder (line 856) | def init_video_encoder( method init_audio_encoder (line 872) | def init_audio_encoder( method get_query_outputs (line 896) | def get_query_outputs( method generate (line 1098) | def generate( method predict_answers (line 1511) | def predict_answers( method predict (line 1613) | def predict( method _predict_class (line 1680) | def _predict_class( method _lemmatize (line 2091) | def _lemmatize(self, answers): method lemmatizer (line 2108) | def lemmatizer(self): method get_optimizer_params (line 2128) | def get_optimizer_params(self, weight_decay, lr_scale=1): method from_config (line 2132) | def from_config(cls, cfg): method init_ln (line 2376) | def init_ln(cls, num_features, load_ln_path=False, load_ln_type=""): method init_encoder_projection (line 2404) | def init_encoder_projection(cls, enc_num_features, shared_qformer_num_... method init_vicuna_projection (line 2432) | def init_vicuna_projection(cls, input_size, output_size, load_projecti... method init_Qformer (line 2463) | def init_Qformer(cls, num_query_token, modality_width, cross_attention... method get_state_dict (line 2505) | def get_state_dict(self, url_or_filename, **kwargs): method load_from_pretrained (line 2522) | def load_from_pretrained(self, url_or_filename, **kwargs): method load_checkpoint (line 2527) | def load_checkpoint(self, url_or_filename, **kwargs): method load_state_dict (line 2537) | def load_state_dict(self, state_dict, strict=True): method before_evaluation (line 2637) | def before_evaluation(self, dataset, task_type, **kwargs): FILE: lavis/models/blip2_models/modeling_llama.py function _make_causal_mask (line 42) | def _make_causal_mask( function _expand_mask (line 60) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class LlamaRMSNorm (line 74) | class LlamaRMSNorm(nn.Module): method __init__ (line 75) | def __init__(self, hidden_size, eps=1e-6): method forward (line 83) | def forward(self, hidden_states): class LlamaRotaryEmbedding (line 94) | class LlamaRotaryEmbedding(torch.nn.Module): method __init__ (line 95) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method forward (line 109) | def forward(self, x, seq_len=None): function rotate_half (line 126) | def rotate_half(x): function apply_rotary_pos_emb (line 133) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): class LlamaMLP (line 143) | class LlamaMLP(nn.Module): method __init__ (line 144) | def __init__( method forward (line 156) | def forward(self, x): class LlamaAttention (line 160) | class LlamaAttention(nn.Module): method __init__ (line 163) | def __init__(self, config: LlamaConfig): method _shape (line 182) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 185) | def forward( class LlamaDecoderLayer (line 251) | class LlamaDecoderLayer(nn.Module): method __init__ (line 252) | def __init__(self, config: LlamaConfig): method forward (line 264) | def forward( class LlamaPreTrainedModel (line 340) | class LlamaPreTrainedModel(PreTrainedModel): method _init_weights (line 347) | def _init_weights(self, module): method _set_gradient_checkpointing (line 358) | def _set_gradient_checkpointing(self, module, value=False): class LlamaModel (line 431) | class LlamaModel(LlamaPreTrainedModel): method __init__ (line 439) | def __init__(self, config: LlamaConfig): method get_input_embeddings (line 452) | def get_input_embeddings(self): method set_input_embeddings (line 455) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 459) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape,... method forward (line 483) | def forward( class LlamaForCausalLM (line 611) | class LlamaForCausalLM(LlamaPreTrainedModel): method __init__ (line 612) | def __init__(self, config): method get_input_embeddings (line 621) | def get_input_embeddings(self): method set_input_embeddings (line 624) | def set_input_embeddings(self, value): method get_output_embeddings (line 627) | def get_output_embeddings(self): method set_output_embeddings (line 630) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 633) | def set_decoder(self, decoder): method get_decoder (line 636) | def get_decoder(self): method forward (line 641) | def forward( method prepare_inputs_for_generation (line 731) | def prepare_inputs_for_generation( method _reorder_cache (line 762) | def _reorder_cache(past_key_values, beam_idx): class LlamaForSequenceClassification (line 784) | class LlamaForSequenceClassification(LlamaPreTrainedModel): method __init__ (line 787) | def __init__(self, config): method get_input_embeddings (line 796) | def get_input_embeddings(self): method set_input_embeddings (line 799) | def set_input_embeddings(self, value): method forward (line 803) | def forward( FILE: lavis/models/blip2_models/modeling_opt.py function _make_causal_mask (line 72) | def _make_causal_mask( function _expand_mask (line 93) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class OPTLearnedPositionalEmbedding (line 109) | class OPTLearnedPositionalEmbedding(nn.Embedding): method __init__ (line 114) | def __init__(self, num_embeddings: int, embedding_dim: int): method forward (line 120) | def forward( class OPTAttention (line 137) | class OPTAttention(nn.Module): method __init__ (line 140) | def __init__( method _shape (line 167) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 174) | def forward( class OPTDecoderLayer (line 308) | class OPTDecoderLayer(nn.Module): method __init__ (line 309) | def __init__(self, config: OPTConfig): method forward (line 327) | def forward( class OPTPreTrainedModel (line 432) | class OPTPreTrainedModel(PreTrainedModel): method _init_weights (line 440) | def _init_weights(self, module): method _set_gradient_checkpointing (line 451) | def _set_gradient_checkpointing(self, module, value=False): class OPTDecoder (line 518) | class OPTDecoder(OPTPreTrainedModel): method __init__ (line 526) | def __init__(self, config: OPTConfig): method get_input_embeddings (line 571) | def get_input_embeddings(self): method set_input_embeddings (line 574) | def set_input_embeddings(self, value): method _prepare_decoder_attention_mask (line 578) | def _prepare_decoder_attention_mask( method forward (line 604) | def forward( class OPTModel (line 819) | class OPTModel(OPTPreTrainedModel): method __init__ (line 820) | def __init__(self, config: OPTConfig): method get_input_embeddings (line 826) | def get_input_embeddings(self): method set_input_embeddings (line 829) | def set_input_embeddings(self, value): method get_decoder (line 832) | def get_decoder(self): method forward (line 843) | def forward( class OPTForCausalLM (line 897) | class OPTForCausalLM(OPTPreTrainedModel): method __init__ (line 900) | def __init__(self, config): method get_input_embeddings (line 912) | def get_input_embeddings(self): method set_input_embeddings (line 915) | def set_input_embeddings(self, value): method get_output_embeddings (line 918) | def get_output_embeddings(self): method set_output_embeddings (line 921) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 924) | def set_decoder(self, decoder): method get_decoder (line 927) | def get_decoder(self): method forward (line 933) | def forward( method prepare_inputs_for_generation (line 1079) | def prepare_inputs_for_generation( method _reorder_cache (line 1105) | def _reorder_cache(past, beam_idx): FILE: lavis/models/blip2_models/modeling_t5.py function load_tf_weights_in_t5 (line 79) | def load_tf_weights_in_t5(model, config, tf_checkpoint_path): class T5LayerNorm (line 254) | class T5LayerNorm(nn.Module): method __init__ (line 255) | def __init__(self, hidden_size, eps=1e-6): method forward (line 263) | def forward(self, hidden_states): class T5DenseActDense (line 298) | class T5DenseActDense(nn.Module): method __init__ (line 299) | def __init__(self, config: T5Config): method forward (line 306) | def forward(self, hidden_states): class T5DenseGatedActDense (line 314) | class T5DenseGatedActDense(nn.Module): method __init__ (line 315) | def __init__(self, config: T5Config): method forward (line 323) | def forward(self, hidden_states): class T5LayerFF (line 332) | class T5LayerFF(nn.Module): method __init__ (line 333) | def __init__(self, config: T5Config): method forward (line 343) | def forward(self, hidden_states): class T5Attention (line 350) | class T5Attention(nn.Module): method __init__ (line 351) | def __init__(self, config: T5Config, has_relative_attention_bias=False): method prune_heads (line 376) | def prune_heads(self, heads): method _relative_position_bucket (line 393) | def _relative_position_bucket( method compute_bias (line 447) | def compute_bias(self, query_length, key_length, device=None): method forward (line 474) | def forward( class T5LayerSelfAttention (line 623) | class T5LayerSelfAttention(nn.Module): method __init__ (line 624) | def __init__(self, config, has_relative_attention_bias=False): method forward (line 632) | def forward( class T5LayerCrossAttention (line 659) | class T5LayerCrossAttention(nn.Module): method __init__ (line 660) | def __init__(self, config): method forward (line 666) | def forward( class T5Block (line 697) | class T5Block(nn.Module): method __init__ (line 698) | def __init__(self, config, has_relative_attention_bias=False): method forward (line 712) | def forward( class T5PreTrainedModel (line 829) | class T5PreTrainedModel(PreTrainedModel): method dummy_inputs (line 843) | def dummy_inputs(self): method _init_weights (line 853) | def _init_weights(self, module): method _set_gradient_checkpointing (line 915) | def _set_gradient_checkpointing(self, module, value=False): method _shift_right (line 919) | def _shift_right(self, input_ids): class T5Stack (line 951) | class T5Stack(T5PreTrainedModel): method __init__ (line 952) | def __init__(self, config, embed_tokens=None): method parallelize (line 977) | def parallelize(self, device_map=None): method deparallelize (line 1004) | def deparallelize(self): method get_input_embeddings (line 1015) | def get_input_embeddings(self): method set_input_embeddings (line 1018) | def set_input_embeddings(self, new_embeddings): method forward (line 1021) | def forward( class T5Model (line 1449) | class T5Model(T5PreTrainedModel): method __init__ (line 1458) | def __init__(self, config: T5Config): method parallelize (line 1482) | def parallelize(self, device_map=None): method deparallelize (line 1494) | def deparallelize(self): method get_input_embeddings (line 1503) | def get_input_embeddings(self): method set_input_embeddings (line 1506) | def set_input_embeddings(self, new_embeddings): method get_encoder (line 1511) | def get_encoder(self): method get_decoder (line 1514) | def get_decoder(self): method _prune_heads (line 1517) | def _prune_heads(self, heads_to_prune): method forward (line 1529) | def forward( class T5ForConditionalGeneration (line 1649) | class T5ForConditionalGeneration(T5PreTrainedModel): method __init__ (line 1659) | def __init__(self, config: T5Config): method parallelize (line 1687) | def parallelize(self, device_map=None): method deparallelize (line 1700) | def deparallelize(self): method get_input_embeddings (line 1710) | def get_input_embeddings(self): method set_input_embeddings (line 1713) | def set_input_embeddings(self, new_embeddings): method set_output_embeddings (line 1718) | def set_output_embeddings(self, new_embeddings): method get_output_embeddings (line 1721) | def get_output_embeddings(self): method get_encoder (line 1724) | def get_encoder(self): method get_decoder (line 1727) | def get_decoder(self): method forward (line 1734) | def forward( method prepare_inputs_for_generation (line 1895) | def prepare_inputs_for_generation( method prepare_decoder_input_ids_from_labels (line 1923) | def prepare_decoder_input_ids_from_labels(self, labels: torch.Tensor): method _reorder_cache (line 1926) | def _reorder_cache(self, past, beam_idx): class T5EncoderModel (line 1961) | class T5EncoderModel(T5PreTrainedModel): method __init__ (line 1966) | def __init__(self, config: T5Config): method parallelize (line 1983) | def parallelize(self, device_map=None): method deparallelize (line 1994) | def deparallelize(self): method get_input_embeddings (line 2001) | def get_input_embeddings(self): method set_input_embeddings (line 2004) | def set_input_embeddings(self, new_embeddings): method get_encoder (line 2008) | def get_encoder(self): method _prune_heads (line 2011) | def _prune_heads(self, heads_to_prune): method forward (line 2023) | def forward( FILE: lavis/models/blip_diffusion_models/blip_diffusion.py class ProjLayer (line 38) | class ProjLayer(nn.Module): method __init__ (line 39) | def __init__(self, in_dim, out_dim, hidden_dim, drop_p=0.1, eps=1e-12): method forward (line 50) | def forward(self, x): class BlipDiffusion (line 60) | class BlipDiffusion(BaseModel): method __init__ (line 68) | def __init__( method freeze_modules (line 152) | def freeze_modules(self): method disabled_train (line 168) | def disabled_train(self, mode=True): method pndm_scheduler (line 174) | def pndm_scheduler(self): method ddim_scheduler (line 186) | def ddim_scheduler(self): method before_training (line 193) | def before_training(self, dataset, **kwargs): method forward (line 224) | def forward(self, samples): method _build_prompt (line 270) | def _build_prompt(self, prompts, tgt_subjects, prompt_strength=1.0, pr... method _build_prompts_edit (line 279) | def _build_prompts_edit(self, cond_subject, tgt_subject, prompt): method _predict_noise (line 287) | def _predict_noise( method _init_latent (line 322) | def _init_latent(self, latent, height, width, generator, batch_size): method _forward_prompt_embeddings (line 337) | def _forward_prompt_embeddings(self, input_image, src_subject, prompt): method get_image_latents (line 352) | def get_image_latents(self, image, sample=True, rng_generator=None): method _inversion_transform (line 363) | def _inversion_transform(self, image, target_size=512): method edit (line 377) | def edit( method _ddim_inverse (line 420) | def _ddim_inverse( method generate (line 473) | def generate( method _register_attention_refine (line 559) | def _register_attention_refine( method _register_attention_control (line 592) | def _register_attention_control(self, controller): method generate_then_edit (line 626) | def generate_then_edit( method _latent_to_image (line 740) | def _latent_to_image(self, latents): method _noise_latent_step (line 751) | def _noise_latent_step( method _denoise_latent_step (line 807) | def _denoise_latent_step( method _tokenize_text (line 863) | def _tokenize_text(self, text_input, with_query=True): method forward_ctx_embeddings (line 878) | def forward_ctx_embeddings(self, input_image, text_input, ratio=None): method from_config (line 918) | def from_config(cls, cfg): method load_checkpoint_from_dir (line 950) | def load_checkpoint_from_dir(self, checkpoint_dir_or_url): method load_from_pretrained (line 985) | def load_from_pretrained(self, url_or_filename): method load_checkpoint (line 989) | def load_checkpoint(self, url_or_filename): FILE: lavis/models/blip_diffusion_models/modeling_ctx_clip.py class CtxCLIPTextModel (line 20) | class CtxCLIPTextModel(CLIPPreTrainedModel): method __init__ (line 25) | def __init__(self, config: CLIPTextConfig): method get_input_embeddings (line 31) | def get_input_embeddings(self) -> nn.Module: method set_input_embeddings (line 34) | def set_input_embeddings(self, value): method forward (line 37) | def forward( class CtxCLIPTextTransformer (line 77) | class CtxCLIPTextTransformer(nn.Module): method __init__ (line 78) | def __init__(self, config: CLIPTextConfig): method forward (line 86) | def forward( method _build_causal_attention_mask (line 171) | def _build_causal_attention_mask(self, bsz, seq_len, dtype): class CtxCLIPTextEmbeddings (line 181) | class CtxCLIPTextEmbeddings(nn.Module): method __init__ (line 182) | def __init__(self, config: CLIPTextConfig): method forward (line 196) | def forward( FILE: lavis/models/blip_diffusion_models/ptp_utils.py function text_under_image (line 29) | def text_under_image(image: np.ndarray, text: str, text_color: Tuple[int... function view_images (line 41) | def view_images(images: Union[np.ndarray, List], class AttentionControl (line 75) | class AttentionControl(abc.ABC): method step_callback (line 77) | def step_callback(self, x_t): method between_steps (line 80) | def between_steps(self): method num_uncond_att_layers (line 84) | def num_uncond_att_layers(self): method forward (line 88) | def forward (self, attn, is_cross: bool, place_in_unet: str): method __call__ (line 91) | def __call__(self, attn, is_cross: bool, place_in_unet: str): method reset (line 102) | def reset(self): method __init__ (line 106) | def __init__(self): class EmptyControl (line 112) | class EmptyControl(AttentionControl): method forward (line 114) | def forward(self, attn, is_cross: bool, place_in_unet: str): class AttentionStore (line 118) | class AttentionStore(AttentionControl): method get_empty_store (line 121) | def get_empty_store(): method forward (line 125) | def forward(self, attn, is_cross: bool, place_in_unet: str): method between_steps (line 131) | def between_steps(self): method get_average_attention (line 140) | def get_average_attention(self): method reset (line 145) | def reset(self): method __init__ (line 150) | def __init__(self): class LocalBlend (line 155) | class LocalBlend: method __call__ (line 157) | def __call__(self, x_t, attention_store): method __init__ (line 171) | def __init__(self, prompts: List[str], words, tokenizer, device, thres... class AttentionControlEdit (line 184) | class AttentionControlEdit(AttentionStore, abc.ABC): method step_callback (line 186) | def step_callback(self, x_t): method replace_self_attention (line 191) | def replace_self_attention(self, attn_base, att_replace): method replace_cross_attention (line 198) | def replace_cross_attention(self, attn_base, att_replace): method forward (line 201) | def forward(self, attn, is_cross: bool, place_in_unet: str): method __init__ (line 217) | def __init__(self, prompts, num_steps: int, class AttentionReplace (line 236) | class AttentionReplace(AttentionControlEdit): method replace_cross_attention (line 238) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 241) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionRefine (line 247) | class AttentionRefine(AttentionControlEdit): method replace_cross_attention (line 249) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 271) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... class AttentionReweight (line 278) | class AttentionReweight(AttentionControlEdit): method replace_cross_attention (line 280) | def replace_cross_attention(self, attn_base, att_replace): method __init__ (line 286) | def __init__(self, prompts, num_steps: int, cross_replace_steps: float... function get_equalizer (line 293) | def get_equalizer( function update_alpha_time_word (line 316) | def update_alpha_time_word(alpha, bounds: Union[float, Tuple[float, floa... function get_time_words_attention_alpha (line 328) | def get_time_words_attention_alpha(prompts, num_steps, class ScoreParams (line 351) | class ScoreParams: method __init__ (line 353) | def __init__(self, gap, match, mismatch): method mis_match_char (line 358) | def mis_match_char(self, x, y): function get_matrix (line 365) | def get_matrix(size_x, size_y, gap): function get_matrix (line 379) | def get_matrix(size_x, size_y, gap): function get_traceback_matrix (line 386) | def get_traceback_matrix(size_x, size_y): function global_align (line 394) | def global_align(x, y, score): function get_aligned_sequences (line 412) | def get_aligned_sequences(x, y, trace_back): function get_mapper (line 440) | def get_mapper(x: str, y: str, tokenizer, max_len=77): function get_refinement_mapper (line 454) | def get_refinement_mapper(prompts, tokenizer, max_len=77): function get_word_inds (line 464) | def get_word_inds(text: str, word_place: int, tokenizer): function get_replacement_mapper_ (line 485) | def get_replacement_mapper_(x: str, y: str, tokenizer, max_len=77): function get_replacement_mapper (line 521) | def get_replacement_mapper(prompts, tokenizer, max_len=77): class P2PCrossAttnProcessor (line 530) | class P2PCrossAttnProcessor: method __init__ (line 532) | def __init__(self, controller, place_in_unet): method __call__ (line 537) | def __call__(self, attn: CrossAttention, hidden_states, encoder_hidden... FILE: lavis/models/blip_diffusion_models/utils.py function numpy_to_pil (line 19) | def numpy_to_pil(images): function preprocess_canny (line 31) | def preprocess_canny( function generate_canny (line 46) | def generate_canny(cond_image_input, low_threshold, high_threshold): function prepare_cond_image (line 56) | def prepare_cond_image( FILE: lavis/models/blip_models/__init__.py function tie_encoder_decoder_weights (line 14) | def tie_encoder_decoder_weights( FILE: lavis/models/blip_models/blip.py class BlipBase (line 20) | class BlipBase(BaseModel): method __init__ (line 21) | def __init__(self): method init_tokenizer (line 27) | def init_tokenizer(cls): method load_from_pretrained (line 34) | def load_from_pretrained(self, url_or_filename): FILE: lavis/models/blip_models/blip_caption.py class BlipCaption (line 21) | class BlipCaption(BlipBase): method __init__ (line 40) | def __init__(self, image_encoder, text_decoder, prompt=None, max_txt_l... method forward_encoder (line 53) | def forward_encoder(self, samples): method forward_decoder (line 57) | def forward_decoder(self, samples, image_embeds): method forward (line 90) | def forward(self, samples): method generate (line 136) | def generate( method from_config (line 207) | def from_config(cls, cfg): FILE: lavis/models/blip_models/blip_classification.py class BlipClassification (line 25) | class BlipClassification(BlipBase, MomentumDistilationMixin): method __init__ (line 30) | def __init__( method _rampup_factor (line 74) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 77) | def forward(self, samples, is_train=True): method predict (line 142) | def predict(self, samples): method from_config (line 147) | def from_config(cls, cfg=None): FILE: lavis/models/blip_models/blip_feature_extractor.py class BlipFeatureExtractor (line 21) | class BlipFeatureExtractor(BlipBase): method __init__ (line 38) | def __init__(self, image_encoder, text_encoder, embed_dim, max_txt_len... method extract_features (line 58) | def extract_features(self, samples, mode="multimodal"): method from_config (line 190) | def from_config(cls, cfg=None): FILE: lavis/models/blip_models/blip_image_text_matching.py class BlipITM (line 19) | class BlipITM(BlipBase): method __init__ (line 38) | def __init__(self, image_encoder, text_encoder, embed_dim=256, max_txt... method forward (line 58) | def forward(self, samples, match_head="itm"): method itm_rank (line 101) | def itm_rank(self, image_embeds, image_atts, encoder_input_ids, match_... method from_config (line 132) | def from_config(cls, cfg=None): function compute_gradcam (line 151) | def compute_gradcam(model, visual_input, text_input, tokenized_text, blo... FILE: lavis/models/blip_models/blip_nlvr.py class BlipNLVR (line 25) | class BlipNLVR(BlipBase, MomentumDistilationMixin): method __init__ (line 42) | def __init__(self, image_encoder, text_encoder, num_classes): method forward (line 56) | def forward(self, samples, is_train=True): method predict (line 128) | def predict(self, samples): method from_config (line 133) | def from_config(cls, cfg=None): method load_from_pretrained (line 156) | def load_from_pretrained(self, url_or_filename): FILE: lavis/models/blip_models/blip_outputs.py class BlipSimilarity (line 20) | class BlipSimilarity(ModelOutput): class BlipIntermediateOutput (line 32) | class BlipIntermediateOutput(ModelOutput): class BlipOutput (line 73) | class BlipOutput(ModelOutput): class BlipOutputWithLogits (line 89) | class BlipOutputWithLogits(BlipOutput): class BlipOutputFeatures (line 95) | class BlipOutputFeatures(ModelOutput): FILE: lavis/models/blip_models/blip_pretrain.py class BlipPretrain (line 27) | class BlipPretrain(BlipBase, SharedQueueMixin, MomentumDistilationMixin): method __init__ (line 40) | def __init__( method _rampup_factor (line 111) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 114) | def forward(self, samples): method reset_queue_ptr (line 362) | def reset_queue_ptr(self): method from_config (line 366) | def from_config(cls, cfg=None): FILE: lavis/models/blip_models/blip_retrieval.py class BlipRetrieval (line 32) | class BlipRetrieval(BlipBase, MomentumDistilationMixin, SharedQueueMixin): method __init__ (line 51) | def __init__( method _rampup_factor (line 113) | def _rampup_factor(self, epoch, iters, num_iters_per_epoch): method forward (line 116) | def forward(self, samples): method reset_queue_ptr (line 357) | def reset_queue_ptr(self): method from_config (line 361) | def from_config(cls, cfg=None): method compute_sim_matrix (line 390) | def compute_sim_matrix(self, data_loader, task_cfg): FILE: lavis/models/blip_models/blip_vqa.py class BlipVQA (line 22) | class BlipVQA(BlipBase): method __init__ (line 43) | def __init__(self, image_encoder, text_encoder, text_decoder, max_txt_... method forward (line 54) | def forward(self, samples): method forward_encoder (line 104) | def forward_encoder(self, samples): method forward_decoder (line 123) | def forward_decoder(self, samples, encoder_out, **kwargs): method predict_answers (line 162) | def predict_answers( method _generate_answers (line 237) | def _generate_answers(self, samples, num_beams=3, max_length=10, min_l... method _rank_answers (line 277) | def _rank_answers(self, samples, answer_list, num_ans_candidates): method from_config (line 357) | def from_config(cls, cfg=None): FILE: lavis/models/blip_models/nlvr_encoder.py class BertEmbeddings (line 31) | class BertEmbeddings(nn.Module): method __init__ (line 34) | def __init__(self, config): method forward (line 58) | def forward( class BertSelfAttention (line 90) | class BertSelfAttention(nn.Module): method __init__ (line 91) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 128) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 131) | def get_attn_gradients(self): method save_attention_map (line 134) | def save_attention_map(self, attention_map): method get_attention_map (line 137) | def get_attention_map(self): method transpose_for_scores (line 140) | def transpose_for_scores(self, x): method forward (line 148) | def forward( class BertSelfOutput (line 256) | class BertSelfOutput(nn.Module): method __init__ (line 257) | def __init__(self, config, twin=False, merge=False): method forward (line 273) | def forward(self, hidden_states, input_tensor): class BertAttention (line 291) | class BertAttention(nn.Module): method __init__ (line 292) | def __init__(self, config, is_cross_attention=False, layer_num=-1): method prune_heads (line 306) | def prune_heads(self, heads): method forward (line 329) | def forward( class BertIntermediate (line 382) | class BertIntermediate(nn.Module): method __init__ (line 383) | def __init__(self, config): method forward (line 391) | def forward(self, hidden_states): class BertOutput (line 397) | class BertOutput(nn.Module): method __init__ (line 398) | def __init__(self, config): method forward (line 404) | def forward(self, hidden_states, input_tensor): class BertLayer (line 411) | class BertLayer(nn.Module): method __init__ (line 412) | def __init__(self, config, layer_num): method forward (line 428) | def forward( method feed_forward_chunk (line 483) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 489) | class BertEncoder(nn.Module): method __init__ (line 490) | def __init__(self, config): method forward (line 498) | def forward( class BertPooler (line 593) | class BertPooler(nn.Module): method __init__ (line 594) | def __init__(self, config): method forward (line 599) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 608) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 609) | def __init__(self, config): method forward (line 618) | def forward(self, hidden_states): class BertLMPredictionHead (line 625) | class BertLMPredictionHead(nn.Module): method __init__ (line 626) | def __init__(self, config): method forward (line 639) | def forward(self, hidden_states): class BertOnlyMLMHead (line 645) | class BertOnlyMLMHead(nn.Module): method __init__ (line 646) | def __init__(self, config): method forward (line 650) | def forward(self, sequence_output): class BertPreTrainedModel (line 655) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 665) | def _init_weights(self, module): class BertModel (line 678) | class BertModel(BertPreTrainedModel): method __init__ (line 688) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 700) | def get_input_embeddings(self): method set_input_embeddings (line 703) | def set_input_embeddings(self, value): method _prune_heads (line 706) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 714) | def get_extended_attention_mask( method forward (line 792) | def forward( FILE: lavis/models/clip_models/clip_outputs.py class ClipOutputFeatures (line 19) | class ClipOutputFeatures(ModelOutput): class ClipOutput (line 38) | class ClipOutput(ModelOutput): FILE: lavis/models/clip_models/loss.py function gather_features (line 20) | def gather_features( class ClipLoss (line 78) | class ClipLoss(nn.Module): method __init__ (line 79) | def __init__( method forward (line 100) | def forward(self, image_features, text_features, logit_scale): FILE: lavis/models/clip_models/model.py class Bottleneck (line 50) | class Bottleneck(nn.Module): method __init__ (line 53) | def __init__(self, inplanes, planes, stride=1): method forward (line 93) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 109) | class AttentionPool2d(nn.Module): method __init__ (line 110) | def __init__( method forward (line 123) | def forward(self, x): class ModifiedResNet (line 156) | class ModifiedResNet(nn.Module): method __init__ (line 164) | def __init__(self, layers, output_dim, heads, image_size=224, width=64): method _make_layer (line 195) | def _make_layer(self, planes, blocks, stride=1): method init_parameters (line 204) | def init_parameters(self): method lock (line 217) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method stem (line 226) | def stem(self, x): method forward (line 236) | def forward(self, x): class LayerNorm (line 247) | class LayerNorm(nn.LayerNorm): method forward (line 250) | def forward(self, x: torch.Tensor): class QuickGELU (line 256) | class QuickGELU(nn.Module): method forward (line 258) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 262) | class ResidualAttentionBlock(nn.Module): method __init__ (line 263) | def __init__(self, d_model: int, n_head: int, act_layer: Callable = nn... method attention (line 279) | def attention(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor]... method forward (line 282) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 288) | class Transformer(nn.Module): method __init__ (line 289) | def __init__( method forward (line 302) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class VisualTransformer (line 308) | class VisualTransformer(nn.Module): method __init__ (line 309) | def __init__( method lock (line 342) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method forward (line 349) | def forward(self, x: torch.Tensor): class CLIPVisionCfg (line 379) | class CLIPVisionCfg: class CLIPTextCfg (line 399) | class CLIPTextCfg: class CLIP (line 409) | class CLIP(BaseModel): method __init__ (line 418) | def __init__( method loss (line 501) | def loss(self): method init_parameters (line 516) | def init_parameters(self): method build_attention_mask (line 538) | def build_attention_mask(self): method lock_image_tower (line 546) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method encode_image (line 552) | def encode_image(self, image): method encode_text (line 555) | def encode_text(self, text): method forward (line 571) | def forward(self, samples): method extract_features (line 603) | def extract_features(self, samples): method predict (line 640) | def predict(self, samples): method before_evaluation (line 651) | def before_evaluation(self, dataset, task_type, **kwargs): method zero_shot_classifier (line 658) | def zero_shot_classifier(self, classnames, templates): method default_config_path (line 675) | def default_config_path(cls, model_type="base"): method from_config (line 686) | def from_config(cls, cfg=None): method zero_shot_predict (line 696) | def zero_shot_predict(self, image_path, categories): method compute_sim_matrix (line 720) | def compute_sim_matrix(self, data_loader, **kwargs): function convert_weights_to_fp16 (line 763) | def convert_weights_to_fp16(model: nn.Module): function build_model_from_openai_state_dict (line 792) | def build_model_from_openai_state_dict(state_dict: dict): function trace_model (line 873) | def trace_model(model, batch_size=256, device=torch.device("cpu")): function _natural_key (line 892) | def _natural_key(string_): function _rescan_model_configs (line 896) | def _rescan_model_configs(): function load_state_dict (line 923) | def load_state_dict(checkpoint_path: str, map_location="cpu"): function create_model (line 934) | def create_model( function create_model_and_transforms (line 1009) | def create_model_and_transforms( function list_models (line 1032) | def list_models(): function add_model_config (line 1037) | def add_model_config(path): function list_openai_models (line 1045) | def list_openai_models() -> List[str]: function load_openai_model (line 1050) | def load_openai_model( FILE: lavis/models/clip_models/pretrained.py function list_pretrained (line 92) | def list_pretrained(as_str: bool = False): function list_pretrained_tag_models (line 103) | def list_pretrained_tag_models(tag: str): function list_pretrained_model_tags (line 112) | def list_pretrained_model_tags(model: str): function get_pretrained_url (line 120) | def get_pretrained_url(model: str, tag: str): function download_pretrained (line 130) | def download_pretrained(url: str, root: str = os.path.expanduser("~/.cac... FILE: lavis/models/clip_models/timm_model.py class TimmModel (line 37) | class TimmModel(nn.Module): method __init__ (line 42) | def __init__( method lock (line 91) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method forward (line 124) | def forward(self, x): class RotAttentionPool2d (line 130) | class RotAttentionPool2d(nn.Module): method __init__ (line 139) | def __init__( method forward (line 161) | def forward(self, x): class AttentionPool2d (line 192) | class AttentionPool2d(nn.Module): method __init__ (line 200) | def __init__( method forward (line 227) | def forward(self, x): function pixel_freq_bands (line 250) | def pixel_freq_bands( function inv_freq_bands (line 266) | def inv_freq_bands( function build_sincos2d_pos_embed (line 280) | def build_sincos2d_pos_embed( function build_fourier_pos_embed (line 329) | def build_fourier_pos_embed( class FourierEmbed (line 386) | class FourierEmbed(nn.Module): method __init__ (line 387) | def __init__( method forward (line 403) | def forward(self, x): function rot (line 430) | def rot(x): function apply_rot_embed (line 434) | def apply_rot_embed(x: torch.Tensor, sin_emb, cos_emb): function apply_rot_embed_list (line 438) | def apply_rot_embed_list(x: List[torch.Tensor], sin_emb, cos_emb): function apply_rot_embed_split (line 444) | def apply_rot_embed_split(x: torch.Tensor, emb): function build_rotary_pos_embed (line 449) | def build_rotary_pos_embed( class RotaryEmbedding (line 479) | class RotaryEmbedding(nn.Module): method __init__ (line 488) | def __init__(self, dim, max_res=224, linear_bands: bool = False): method get_embed (line 497) | def get_embed(self, shape: List[int]): method forward (line 500) | def forward(self, x): function _no_grad_trunc_normal_ (line 506) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 544) | def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): FILE: lavis/models/clip_models/tokenizer.py function default_bpe (line 25) | def default_bpe(): function bytes_to_unicode (line 32) | def bytes_to_unicode(): function get_pairs (line 58) | def get_pairs(word): function basic_clean (line 70) | def basic_clean(text): function whitespace_clean (line 76) | def whitespace_clean(text): class SimpleTokenizer (line 82) | class SimpleTokenizer(object): method __init__ (line 83) | def __init__(self, bpe_path: str = default_bpe(), special_tokens=None): method bpe (line 111) | def bpe(self, token): method encode (line 152) | def encode(self, text): method decode (line 162) | def decode(self, tokens): function tokenize (line 175) | def tokenize( FILE: lavis/models/clip_models/transform.py class ResizeMaxSize (line 28) | class ResizeMaxSize(nn.Module): method __init__ (line 29) | def __init__( method forward (line 40) | def forward(self, img): function _convert_to_rgb (line 64) | def _convert_to_rgb(image): function image_transform (line 68) | def image_transform( FILE: lavis/models/clip_models/utils.py function freeze_batch_norm_2d (line 14) | def freeze_batch_norm_2d(module, module_match={}, name=""): FILE: lavis/models/clip_vit.py class Bottleneck (line 15) | class Bottleneck(nn.Module): method __init__ (line 18) | def __init__(self, inplanes, planes, stride=1): method forward (line 47) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 63) | class AttentionPool2d(nn.Module): method __init__ (line 64) | def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, o... method forward (line 73) | def forward(self, x): class LayerNorm (line 100) | class LayerNorm(nn.LayerNorm): method forward (line 103) | def forward(self, x: torch.Tensor): class QuickGELU (line 109) | class QuickGELU(nn.Module): method forward (line 110) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 114) | class ResidualAttentionBlock(nn.Module): method __init__ (line 115) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 132) | def attention(self, x: torch.Tensor): method forward (line 136) | def forward(self, x: torch.Tensor): class Transformer (line 142) | class Transformer(nn.Module): method __init__ (line 143) | def __init__(self, width: int, layers: int, heads: int, attn_mask: tor... method forward (line 149) | def forward(self, x: torch.Tensor): class VisionTransformer (line 153) | class VisionTransformer(nn.Module): method __init__ (line 154) | def __init__(self, input_resolution: int, patch_size: int, width: int,... method forward (line 171) | def forward(self, x: torch.Tensor): method get_num_layer (line 187) | def get_num_layer(self, var_name=""): function _ntuple (line 198) | def _ntuple(n): function interpolate_pos_embed (line 206) | def interpolate_pos_embed(model, state_dict, interpolation: str = 'bicub... function create_clip_vit_L (line 242) | def create_clip_vit_L(img_size=224,use_checkpoint=False,precision="fp16"): FILE: lavis/models/eva_vit.py function _cfg (line 20) | def _cfg(url='', **kwargs): class DropPath (line 30) | class DropPath(nn.Module): method __init__ (line 33) | def __init__(self, drop_prob=None): method forward (line 37) | def forward(self, x): method extra_repr (line 40) | def extra_repr(self) -> str: class Mlp (line 44) | class Mlp(nn.Module): method __init__ (line 45) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 54) | def forward(self, x): class Attention (line 64) | class Attention(nn.Module): method __init__ (line 65) | def __init__( method forward (line 118) | def forward(self, x, rel_pos_bias=None): class Block (line 151) | class Block(nn.Module): method __init__ (line 153) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 173) | def forward(self, x, rel_pos_bias=None): class PatchEmbed (line 183) | class PatchEmbed(nn.Module): method __init__ (line 186) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 198) | def forward(self, x, **kwargs): class RelativePositionBias (line 207) | class RelativePositionBias(nn.Module): method __init__ (line 209) | def __init__(self, window_size, num_heads): method forward (line 238) | def forward(self): class VisionTransformer (line 246) | class VisionTransformer(nn.Module): method __init__ (line 249) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method fix_init_weight (line 300) | def fix_init_weight(self): method _init_weights (line 308) | def _init_weights(self, m): method get_classifier (line 317) | def get_classifier(self): method reset_classifier (line 320) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 324) | def forward_features(self, x): method forward (line 349) | def forward(self, x): method get_intermediate_layers (line 354) | def get_intermediate_layers(self, x): method get_num_layer (line 372) | def get_num_layer(self, var_name=""): function interpolate_pos_embed (line 386) | def interpolate_pos_embed(model, checkpoint_model): function convert_weights_to_fp16 (line 410) | def convert_weights_to_fp16(model: nn.Module): function create_eva_vit_g (line 428) | def create_eva_vit_g(img_size=224,drop_path_rate=0.4,use_checkpoint=Fals... FILE: lavis/models/gpt_models/gpt_dialogue.py class GPTDialogue (line 18) | class GPTDialogue(BaseModel, GPT2LMHeadModel): method __init__ (line 22) | def __init__(self, config, len_video_ft=4224): method forward (line 36) | def forward( method from_config (line 107) | def from_config(cls, cfg): FILE: lavis/models/img2prompt_models/img2prompt_vqa.py class Img2PromptVQA (line 30) | class Img2PromptVQA(BaseModel): method __init__ (line 51) | def __init__( method forward_itm (line 68) | def forward_itm(self, samples, block_num=7): method itm_rank (line 103) | def itm_rank(self, image_embeds, image_atts, encoder_input_ids, match_... method forward_cap (line 138) | def forward_cap( method answer_extraction (line 252) | def answer_extraction(self, caption, num_question_generation=30): method forward_qa_generation (line 312) | def forward_qa_generation(self, samples): method create_context_prompt (line 349) | def create_context_prompt(self, samples, num_caps_per_img=30): method create_task_prompt (line 368) | def create_task_prompt( method prompts_construction (line 437) | def prompts_construction( method prepare_LLM_input (line 464) | def prepare_LLM_input( method from_config (line 555) | def from_config(cls, model_config): FILE: lavis/models/med.py class BertEmbeddings (line 56) | class BertEmbeddings(nn.Module): method __init__ (line 59) | def __init__(self, config): method forward (line 88) | def forward( class BertSelfAttention (line 126) | class BertSelfAttention(nn.Module): method __init__ (line 127) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 164) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 167) | def get_attn_gradients(self): method save_attention_map (line 170) | def save_attention_map(self, attention_map): method get_attention_map (line 173) | def get_attention_map(self): method transpose_for_scores (line 176) | def transpose_for_scores(self, x): method forward (line 184) | def forward( class BertSelfOutput (line 292) | class BertSelfOutput(nn.Module): method __init__ (line 293) | def __init__(self, config): method forward (line 299) | def forward(self, hidden_states, input_tensor): class BertAttention (line 306) | class BertAttention(nn.Module): method __init__ (line 307) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 313) | def prune_heads(self, heads): method forward (line 336) | def forward( class BertIntermediate (line 362) | class BertIntermediate(nn.Module): method __init__ (line 363) | def __init__(self, config): method forward (line 371) | def forward(self, hidden_states): class BertOutput (line 377) | class BertOutput(nn.Module): method __init__ (line 378) | def __init__(self, config): method forward (line 384) | def forward(self, hidden_states, input_tensor): class BertLayer (line 391) | class BertLayer(nn.Module): method __init__ (line 392) | def __init__(self, config, layer_num): method forward (line 422) | def forward( method feed_forward_chunk (line 499) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 505) | class BertEncoder(nn.Module): method __init__ (line 506) | def __init__(self, config): method forward (line 514) | def forward( class BertPooler (line 633) | class BertPooler(nn.Module): method __init__ (line 634) | def __init__(self, config): method forward (line 639) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 648) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 649) | def __init__(self, config): method forward (line 658) | def forward(self, hidden_states): class BertLMPredictionHead (line 665) | class BertLMPredictionHead(nn.Module): method __init__ (line 666) | def __init__(self, config): method forward (line 679) | def forward(self, hidden_states): class BertOnlyMLMHead (line 685) | class BertOnlyMLMHead(nn.Module): method __init__ (line 686) | def __init__(self, config): method forward (line 690) | def forward(self, sequence_output): class BertPreTrainedModel (line 695) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 705) | def _init_weights(self, module): class BertModel (line 718) | class BertModel(BertPreTrainedModel): method __init__ (line 728) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 740) | def get_input_embeddings(self): method set_input_embeddings (line 743) | def set_input_embeddings(self, value): method _prune_heads (line 746) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 754) | def get_extended_attention_mask( method forward (line 832) | def forward( class BertForMaskedLM (line 1005) | class BertForMaskedLM(BertPreTrainedModel): method __init__ (line 1010) | def __init__(self, config): method get_output_embeddings (line 1018) | def get_output_embeddings(self): method set_output_embeddings (line 1021) | def set_output_embeddings(self, new_embeddings): method forward (line 1024) | def forward( method prepare_inputs_for_generation (line 1106) | def prepare_inputs_for_generation( class BertLMHeadModel (line 1131) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 1136) | def __init__(self, config): method get_output_embeddings (line 1144) | def get_output_embeddings(self): method set_output_embeddings (line 1147) | def set_output_embeddings(self, new_embeddings): method forward (line 1150) | def forward( method prepare_inputs_for_generation (line 1266) | def prepare_inputs_for_generation( method _reorder_cache (line 1287) | def _reorder_cache(self, past, beam_idx): class XBertLMHeadDecoder (line 1298) | class XBertLMHeadDecoder(BertLMHeadModel): method from_config (line 1306) | def from_config(cls, cfg, from_pretrained=False): method generate_from_encoder (line 1316) | def generate_from_encoder( class XBertEncoder (line 1374) | class XBertEncoder(BertModel, BaseEncoder): method from_config (line 1376) | def from_config(cls, cfg, from_pretrained=False): method forward_automask (line 1388) | def forward_automask(self, tokenized_text, visual_embeds, **kwargs): method forward_text (line 1404) | def forward_text(self, tokenized_text, **kwargs): FILE: lavis/models/pnp_vqa_models/__init__.py function prepare_qa_input (line 11) | def prepare_qa_input(sample, num_captions, num_captions_fid): FILE: lavis/models/pnp_vqa_models/pnp_unifiedqav2_fid.py class PNPUnifiedQAv2FiD (line 20) | class PNPUnifiedQAv2FiD(T5ForConditionalGeneration, BaseModel): method __init__ (line 24) | def __init__(self, config, model_path): method forward (line 29) | def forward(self, input_ids=None, attention_mask=None, **kwargs): method generate (line 43) | def generate(self, input_ids, attention_mask, num_beams=1, min_length=... method load_unifiedqa (line 54) | def load_unifiedqa(self, state_dict): method from_config (line 59) | def from_config(cls, cfg): class T5EncoderWrapper (line 69) | class T5EncoderWrapper(torch.nn.Module): method __init__ (line 71) | def __init__(self, encoder): method forward (line 79) | def forward(self, input_ids=None, attention_mask=None, **kwargs): FILE: lavis/models/pnp_vqa_models/pnp_vqa.py class PNPVQA (line 21) | class PNPVQA(BaseModel): method __init__ (line 45) | def __init__(self, image_question_matching_model, image_captioning_model, method forward_itm (line 54) | def forward_itm(self, samples, block_num=7): method forward_cap (line 84) | def forward_cap( method forward_qa (line 174) | def forward_qa( method predict_answers (line 232) | def predict_answers( method from_config (line 321) | def from_config(cls, model_config): FILE: lavis/models/timesformer/conv2d_same.py function pad_same (line 24) | def pad_same(x, k: List[int], s: List[int], d: List[int] = (1, 1), value... function get_same_padding (line 39) | def get_same_padding(x: int, k: int, s: int, d: int): function get_padding_value (line 43) | def get_padding_value(padding, kernel_size, **kwargs) -> Tuple[Tuple, bo... function conv2d_same (line 66) | def conv2d_same( class Conv2dSame (line 79) | class Conv2dSame(nn.Conv2d): method __init__ (line 82) | def __init__( method forward (line 97) | def forward(self, x): function create_conv2d_pad (line 109) | def create_conv2d_pad(in_chs, out_chs, kernel_size, **kwargs): FILE: lavis/models/timesformer/features.py class FeatureInfo (line 21) | class FeatureInfo: method __init__ (line 22) | def __init__(self, feature_info: List[Dict], out_indices: Tuple[int]): method from_other (line 33) | def from_other(self, out_indices: Tuple[int]): method get (line 36) | def get(self, key, idx=None): method get_dicts (line 49) | def get_dicts(self, keys=None, idx=None): method channels (line 66) | def channels(self, idx=None): method reduction (line 70) | def reduction(self, idx=None): method module_name (line 74) | def module_name(self, idx=None): method __getitem__ (line 78) | def __getitem__(self, item): method __len__ (line 81) | def __len__(self): class FeatureHooks (line 85) | class FeatureHooks: method __init__ (line 92) | def __init__(self, hooks, named_modules, out_map=None, default_hook_ty... method _collect_output_hook (line 109) | def _collect_output_hook(self, hook_id, *args): method get_output (line 117) | def get_output(self, device) -> Dict[str, torch.tensor]: function _module_list (line 123) | def _module_list(module, flatten_sequential=False): function _get_feature_info (line 137) | def _get_feature_info(net, out_indices): function _get_return_layers (line 147) | def _get_return_layers(feature_info, out_map): class FeatureDictNet (line 157) | class FeatureDictNet(nn.ModuleDict): method __init__ (line 178) | def __init__( method _collect (line 207) | def _collect(self, x) -> (Dict[str, torch.Tensor]): method forward (line 221) | def forward(self, x) -> Dict[str, torch.Tensor]: class FeatureListNet (line 225) | class FeatureListNet(FeatureDictNet): method __init__ (line 231) | def __init__( method forward (line 247) | def forward(self, x) -> (List[torch.Tensor]): class FeatureHookNet (line 251) | class FeatureHookNet(nn.ModuleDict): method __init__ (line 261) | def __init__( method forward (line 304) | def forward(self, x): FILE: lavis/models/timesformer/helpers.py function load_state_dict (line 24) | def load_state_dict(checkpoint_path, use_ema=False): function load_checkpoint (line 57) | def load_checkpoint(model, checkpoint_path, use_ema=False, strict=True): function load_pretrained (line 102) | def load_pretrained( function load_pretrained_imagenet (line 235) | def load_pretrained_imagenet( function load_pretrained_kinetics (line 299) | def load_pretrained_kinetics( function resize_spatial_embedding (line 353) | def resize_spatial_embedding(state_dict, key, num_patches): function resize_temporal_embedding (line 370) | def resize_temporal_embedding(state_dict, key, num_frames): function detach_variable (line 381) | def detach_variable(inputs): function check_backward_validity (line 396) | def check_backward_validity(inputs): FILE: lavis/models/timesformer/linear.py class Linear (line 15) | class Linear(nn.Linear): method forward (line 16) | def forward(self, input: torch.Tensor) -> torch.Tensor: FILE: lavis/models/timesformer/vit.py function _cfg (line 35) | def _cfg(url="", **kwargs): class Mlp (line 60) | class Mlp(nn.Module): method __init__ (line 61) | def __init__( method forward (line 77) | def forward(self, x): class Attention (line 86) | class Attention(nn.Module): method __init__ (line 87) | def __init__( method forward (line 108) | def forward(self, x): class Block (line 134) | class Block(nn.Module): method __init__ (line 135) | def __init__( method forward (line 202) | def forward(self, x, B, T, W): class PatchEmbed (line 263) | class PatchEmbed(nn.Module): method __init__ (line 266) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 279) | def forward(self, x): class VisionTransformer (line 288) | class VisionTransformer(nn.Module): method __init__ (line 291) | def __init__( method _init_weights (line 385) | def _init_weights(self, m): method no_weight_decay (line 395) | def no_weight_decay(self): method get_classifier (line 398) | def get_classifier(self): method reset_classifier (line 401) | def reset_classifier(self, num_classes, global_pool=""): method remove_classifier (line 407) | def remove_classifier(self): method forward_features (line 411) | def forward_features(self, x): method forward (line 464) | def forward(self, x): function _conv_filter (line 470) | def _conv_filter(state_dict, patch_size=16): class vit_base_patch16_224 (line 482) | class vit_base_patch16_224(nn.Module): method __init__ (line 483) | def __init__(self, cfg, **kwargs): method forward (line 523) | def forward(self, x): class TimeSformer (line 528) | class TimeSformer(nn.Module): method __init__ (line 529) | def __init__( method forward (line 592) | def forward(self, x): method forward_features (line 596) | def forward_features(self, x): method load_state_dict (line 614) | def load_state_dict(self, pretrained_ckpt_path): FILE: lavis/models/timesformer/vit_utils.py function _no_grad_trunc_normal_ (line 31) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 67) | def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): function _ntuple (line 88) | def _ntuple(n): function get_padding (line 100) | def get_padding(kernel_size: int, stride: int = 1, dilation: int = 1, **... function get_padding_value (line 105) | def get_padding_value(padding, kernel_size, **kwargs): function get_same_padding (line 129) | def get_same_padding(x: int, k: int, s: int, d: int): function is_static_pad (line 134) | def is_static_pad(kernel_size: int, stride: int = 1, dilation: int = 1, ... function pad_same (line 140) | def pad_same(x, k, s, d=(1, 1), value=0): function adaptive_pool_feat_mult (line 154) | def adaptive_pool_feat_mult(pool_type="avg"): function drop_path (line 161) | def drop_path(x, drop_prob: float = 0.0, training: bool = False): class DropPath (line 181) | class DropPath(nn.Module): method __init__ (line 184) | def __init__(self, drop_prob=None): method forward (line 188) | def forward(self, x): FILE: lavis/models/ulip_models/ULIP_models.py class LayerNorm (line 24) | class LayerNorm(nn.LayerNorm): method forward (line 27) | def forward(self, x: torch.Tensor): class QuickGELU (line 33) | class QuickGELU(nn.Module): method forward (line 34) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 38) | class ResidualAttentionBlock(nn.Module): method __init__ (line 39) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 52) | def attention(self, x: torch.Tensor): method forward (line 56) | def forward(self, x: torch.Tensor): class Transformer (line 62) | class Transformer(nn.Module): method __init__ (line 63) | def __init__(self, width: int, layers: int, heads: int, attn_mask: tor... method forward (line 69) | def forward(self, x: torch.Tensor): class ULIP_WITH_IMAGE (line 73) | class ULIP_WITH_IMAGE(nn.Module): method __init__ (line 74) | def __init__(self, point_encoder, **kwargs): method encode_image (line 106) | def encode_image(self, image): method encode_text (line 112) | def encode_text(self, text): method build_attention_mask (line 125) | def build_attention_mask(self): method initialize_parameters (line 133) | def initialize_parameters(self): method encode_pc (line 149) | def encode_pc(self, pc): method forward (line 154) | def forward(self, pc, text=None, image=None): function get_loss (line 184) | def get_loss(args): function get_metric_names (line 188) | def get_metric_names(model): function ULIP_PointBERT (line 191) | def ULIP_PointBERT(ulip_v=2): FILE: lavis/models/ulip_models/losses.py class ULIPWithImageLoss (line 14) | class ULIPWithImageLoss(nn.Module): method __init__ (line 15) | def __init__(self): method forward (line 20) | def forward(self, outputs): FILE: lavis/models/ulip_models/pointbert/checkpoint.py function get_missing_parameters_message (line 9) | def get_missing_parameters_message(keys: List[str]) -> str: function get_unexpected_parameters_message (line 26) | def get_unexpected_parameters_message(keys: List[str]) -> str: function _strip_prefix_if_present (line 43) | def _strip_prefix_if_present(state_dict: Dict[str, Any], prefix: str) ->... function _group_checkpoint_keys (line 76) | def _group_checkpoint_keys(keys: List[str]) -> Dict[str, List[str]]: function _group_to_str (line 97) | def _group_to_str(group: List[str]) -> str: function _named_modules_with_dup (line 114) | def _named_modules_with_dup( FILE: lavis/models/ulip_models/pointbert/dvae.py class DGCNN (line 13) | class DGCNN(nn.Module): method __init__ (line 14) | def __init__(self, encoder_channel, output_channel): method get_graph_feature (line 47) | def get_graph_feature(coor_q, x_q, coor_k, x_k): method forward (line 69) | def forward(self, f, coor): function knn_point (line 109) | def knn_point(nsample, xyz, new_xyz): function square_distance (line 123) | def square_distance(src, dst): class Group (line 145) | class Group(nn.Module): method __init__ (line 146) | def __init__(self, num_group, group_size): method forward (line 152) | def forward(self, xyz): class Encoder (line 177) | class Encoder(nn.Module): method __init__ (line 178) | def __init__(self, encoder_channel): method forward (line 194) | def forward(self, point_groups): class Decoder (line 211) | class Decoder(nn.Module): method __init__ (line 212) | def __init__(self, encoder_channel, num_fine): method forward (line 241) | def forward(self, feature_global): class DiscreteVAE (line 272) | class DiscreteVAE(nn.Module): method __init__ (line 273) | def __init__(self, config, **kwargs): method recon_loss (line 297) | def recon_loss(self, ret, gt): method get_loss (line 313) | def get_loss(self, ret, gt): method forward (line 327) | def forward(self, inp, temperature=1., hard=False, **kwargs): FILE: lavis/models/ulip_models/pointbert/logger.py function get_root_logger (line 6) | def get_root_logger(log_file=None, log_level=logging.INFO, name='main'): function get_logger (line 29) | def get_logger(name, log_file=None, log_level=logging.INFO, file_mode='w'): function print_log (line 103) | def print_log(msg, logger=None, level=logging.INFO): FILE: lavis/models/ulip_models/pointbert/misc.py function index_points (line 22) | def index_points(points, idx): function fps (line 40) | def fps(xyz, npoint): function worker_init_fn (line 62) | def worker_init_fn(worker_id): function build_lambda_sche (line 65) | def build_lambda_sche(opti, config): function build_lambda_bnsche (line 73) | def build_lambda_bnsche(model, config): function set_random_seed (line 81) | def set_random_seed(seed, deterministic=False): function is_seq_of (line 108) | def is_seq_of(seq, expected_type, seq_type=None): function set_bn_momentum_default (line 130) | def set_bn_momentum_default(bn_momentum): class BNMomentumScheduler (line 136) | class BNMomentumScheduler(object): method __init__ (line 138) | def __init__( method step (line 156) | def step(self, epoch=None): method get_momentum (line 163) | def get_momentum(self, epoch=None): function seprate_point_cloud (line 170) | def seprate_point_cloud(xyz, num_points, crop, fixed_points = None, padd... function get_ptcloud_img (line 225) | def get_ptcloud_img(ptcloud): function visualize_KITTI (line 246) | def visualize_KITTI(path, data_list, titles = ['input','pred'], cmap=['b... function random_dropping (line 275) | def random_dropping(pc, e): function random_scale (line 285) | def random_scale(partial, scale_range=[0.8, 1.2]): FILE: lavis/models/ulip_models/pointbert/point_encoder.py class Mlp (line 11) | class Mlp(nn.Module): method __init__ (line 12) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 21) | def forward(self, x): class Attention (line 30) | class Attention(nn.Module): method __init__ (line 31) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method forward (line 43) | def forward(self, x): class Block (line 58) | class Block(nn.Module): method __init__ (line 59) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 73) | def forward(self, x): class TransformerEncoder (line 79) | class TransformerEncoder(nn.Module): method __init__ (line 83) | def __init__(self, embed_dim=768, depth=4, num_heads=12, mlp_ratio=4.,... method forward (line 95) | def forward(self, x, pos): class PointTransformer (line 101) | class PointTransformer(nn.Module): method __init__ (line 102) | def __init__(self, config, **kwargs): method build_loss_func (line 155) | def build_loss_func(self): method get_loss_acc (line 158) | def get_loss_acc(self, pred, gt, smoothing=True): method load_model_from_ckpt (line 179) | def load_model_from_ckpt(self, bert_ckpt_path): method forward (line 206) | def forward(self, pts): FILE: lavis/models/ulip_models/utils/build.py function build_dataset_from_cfg (line 7) | def build_dataset_from_cfg(cfg, default_args = None): FILE: lavis/models/ulip_models/utils/config.py function log_args_to_file (line 6) | def log_args_to_file(args, pre='args', logger=None): function log_config_to_file (line 10) | def log_config_to_file(cfg, pre='cfg', logger=None): function merge_new_config (line 18) | def merge_new_config(config, new_config): function cfg_from_yaml_file (line 37) | def cfg_from_yaml_file(cfg_file): function get_config (line 47) | def get_config(args, logger=None): function save_experiment_config (line 60) | def save_experiment_config(args, config, logger = None): FILE: lavis/models/ulip_models/utils/io.py class IO (line 6) | class IO: method get (line 8) | def get(cls, file_path): method _read_npy (line 24) | def _read_npy(cls, file_path): method _read_pcd (line 30) | def _read_pcd(cls, file_path): method _read_txt (line 36) | def _read_txt(cls, file_path): method _read_h5 (line 40) | def _read_h5(cls, file_path): FILE: lavis/models/ulip_models/utils/logger.py function get_root_logger (line 6) | def get_root_logger(log_file=None, log_level=logging.INFO, name='main'): function get_logger (line 29) | def get_logger(name, log_file=None, log_level=logging.INFO, file_mode='w'): function print_log (line 103) | def print_log(msg, logger=None, level=logging.INFO): FILE: lavis/models/ulip_models/utils/registry.py class Registry (line 6) | class Registry: method __init__ (line 32) | def __init__(self, name, build_func=None, parent=None, scope=None): method __len__ (line 56) | def __len__(self): method __contains__ (line 59) | def __contains__(self, key): method __repr__ (line 62) | def __repr__(self): method infer_scope (line 69) | def infer_scope(): method split_scope_key (line 89) | def split_scope_key(key): method name (line 108) | def name(self): method scope (line 112) | def scope(self): method module_dict (line 116) | def module_dict(self): method children (line 120) | def children(self): method get (line 123) | def get(self, key): method build (line 146) | def build(self, *args, **kwargs): method _add_children (line 149) | def _add_children(self, registry): method _register_module (line 168) | def _register_module(self, module_class, module_name=None, force=False): method deprecated_register_module (line 183) | def deprecated_register_module(self, cls=None, force=False): method register_module (line 193) | def register_module(self, name=None, force=False, module=None): function build_from_cfg (line 246) | def build_from_cfg(cfg, registry, default_args=None): FILE: lavis/models/ulip_models/utils/tokenizer.py function default_bpe (line 13) | def default_bpe(): function bytes_to_unicode (line 18) | def bytes_to_unicode(): function get_pairs (line 40) | def get_pairs(word): function basic_clean (line 52) | def basic_clean(text): function whitespace_clean (line 58) | def whitespace_clean(text): class SimpleTokenizer (line 64) | class SimpleTokenizer(object): method __init__ (line 65) | def __init__(self, bpe_path: str = default_bpe()): method bpe (line 82) | def bpe(self, token): method encode (line 123) | def encode(self, text): method decode (line 131) | def decode(self, tokens): method __call__ (line 136) | def __call__(self, texts, context_length=77): FILE: lavis/models/ulip_models/utils/utils.py function merge_new_config (line 14) | def merge_new_config(config, new_config): function cfg_from_yaml_file (line 32) | def cfg_from_yaml_file(cfg_file): function get_model (line 42) | def get_model(model): function setup_for_distributed (line 50) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 65) | def is_dist_avail_and_initialized(): function get_world_size (line 73) | def get_world_size(): function get_rank (line 79) | def get_rank(): function is_main_process (line 85) | def is_main_process(): function save_on_master (line 89) | def save_on_master(state, is_best, output_dir): function init_distributed_mode (line 98) | def init_distributed_mode(args): function scaled_all_reduce (line 123) | def scaled_all_reduce(tensors, is_scale=True): function all_gather_batch (line 148) | def all_gather_batch(tensors): class GatherLayer (line 174) | class GatherLayer(autograd.Function): method forward (line 181) | def forward(ctx, x): method backward (line 187) | def backward(ctx, *grads): function all_gather_batch_with_grad (line 193) | def all_gather_batch_with_grad(tensors): function cosine_scheduler (line 215) | def cosine_scheduler(base_value, final_value, epochs, niter_per_ep, warm... class GaussianBlur (line 229) | class GaussianBlur(object): method __init__ (line 232) | def __init__(self, sigma=[.1, 2.]): method __call__ (line 235) | def __call__(self, x): FILE: lavis/models/vit.py class Mlp (line 26) | class Mlp(nn.Module): method __init__ (line 29) | def __init__( method forward (line 45) | def forward(self, x): class Attention (line 54) | class Attention(nn.Module): method __init__ (line 55) | def __init__( method save_attn_gradients (line 76) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 79) | def get_attn_gradients(self): method save_attention_map (line 82) | def save_attention_map(self, attention_map): method get_attention_map (line 85) | def get_attention_map(self): method forward (line 88) | def forward(self, x, register_hook=False): class Block (line 115) | class Block(nn.Module): method __init__ (line 116) | def __init__( method forward (line 155) | def forward(self, x, register_hook=False): class VisionTransformer (line 161) | class VisionTransformer(nn.Module): method __init__ (line 167) | def __init__( method _init_weights (line 252) | def _init_weights(self, m): method no_weight_decay (line 262) | def no_weight_decay(self): method forward (line 265) | def forward(self, x, register_blk=-1): method load_pretrained (line 284) | def load_pretrained(self, checkpoint_path, prefix=""): function _load_weights (line 289) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function resize_pos_embed (line 402) | def resize_pos_embed(posemb, posemb_new, num_tokens=1, gs_new=()): function interpolate_pos_embed (line 426) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): class VisionTransformerEncoder (line 458) | class VisionTransformerEncoder(VisionTransformer, BaseEncoder): method from_config (line 460) | def from_config(cls, cfg, from_pretrained=False): method forward_features (line 526) | def forward_features(self, x, register_blk=-1): FILE: lavis/processors/__init__.py function load_processor (line 61) | def load_processor(name, cfg=None): FILE: lavis/processors/alpro_processors.py class AlproVideoBaseProcessor (line 21) | class AlproVideoBaseProcessor(BaseProcessor): method __init__ (line 22) | def __init__(self, mean=None, std=None, n_frms=MAX_INT): class ToUint8 (line 33) | class ToUint8(object): method __init__ (line 34) | def __init__(self): method __call__ (line 37) | def __call__(self, tensor): method __repr__ (line 40) | def __repr__(self): class ToTHWC (line 44) | class ToTHWC(object): method __init__ (line 52) | def __init__(self): method __call__ (line 55) | def __call__(self, tensor): method __repr__ (line 58) | def __repr__(self): class ResizeVideo (line 62) | class ResizeVideo(object): method __init__ (line 63) | def __init__(self, target_size, interpolation_mode="bilinear"): method __call__ (line 67) | def __call__(self, clip): method __repr__ (line 77) | def __repr__(self): class AlproVideoTrainProcessor (line 82) | class AlproVideoTrainProcessor(AlproVideoBaseProcessor): method __init__ (line 83) | def __init__( method __call__ (line 130) | def __call__(self, vpath, start_sec=None, end_sec=None): method from_config (line 176) | def from_config(cls, cfg=None): class AlproVideoEvalProcessor (line 203) | class AlproVideoEvalProcessor(AlproVideoBaseProcessor): method __init__ (line 204) | def __init__(self, image_size=256, mean=None, std=None, n_frms=MAX_INT... method __call__ (line 221) | def __call__(self, vpath, start_sec=None, end_sec=None): method from_config (line 260) | def from_config(cls, cfg=None): FILE: lavis/processors/audio_processors.py class BeatsAudioProcessor (line 23) | class BeatsAudioProcessor(BaseProcessor): method __init__ (line 24) | def __init__(self, model_name, sampling_rate, n_frames, frame_length, ... method _load_audio (line 38) | def _load_audio(self, aupath): method __call__ (line 55) | def __call__(self, aupath, start_sec=None, end_sec=None): method from_config (line 131) | def from_config(cls, cfg=None): FILE: lavis/processors/base_processor.py class BaseProcessor (line 11) | class BaseProcessor: method __init__ (line 12) | def __init__(self): method __call__ (line 16) | def __call__(self, item): method from_config (line 20) | def from_config(cls, cfg=None): method build (line 23) | def build(self, **kwargs): FILE: lavis/processors/blip_diffusion_processors.py class BlipDiffusionInputImageProcessor (line 19) | class BlipDiffusionInputImageProcessor(BlipImageBaseProcessor): method __init__ (line 20) | def __init__( method __call__ (line 37) | def __call__(self, item): method from_config (line 41) | def from_config(cls, cfg=None): class BlipDiffusionTargetImageProcessor (line 54) | class BlipDiffusionTargetImageProcessor(BaseProcessor): method __init__ (line 55) | def __init__( method __call__ (line 70) | def __call__(self, item): method from_config (line 74) | def from_config(cls, cfg=None): FILE: lavis/processors/blip_processors.py class BlipImageBaseProcessor (line 18) | class BlipImageBaseProcessor(BaseProcessor): method __init__ (line 19) | def __init__(self, mean=None, std=None): class BlipCaptionProcessor (line 29) | class BlipCaptionProcessor(BaseProcessor): method __init__ (line 30) | def __init__(self, prompt="", max_words=50): method __call__ (line 34) | def __call__(self, caption): method from_config (line 40) | def from_config(cls, cfg=None): method pre_caption (line 49) | def pre_caption(self, caption): class BlipQuestionProcessor (line 72) | class BlipQuestionProcessor(BaseProcessor): method __init__ (line 73) | def __init__(self, max_words=50): method __call__ (line 76) | def __call__(self, question): method from_config (line 80) | def from_config(cls, cfg=None): method pre_question (line 88) | def pre_question(self, question): class BlipImageTrainProcessor (line 105) | class BlipImageTrainProcessor(BlipImageBaseProcessor): method __init__ (line 106) | def __init__( method __call__ (line 141) | def __call__(self, item): method from_config (line 145) | def from_config(cls, cfg=None): class BlipImageEvalProcessor (line 167) | class BlipImageEvalProcessor(BlipImageBaseProcessor): method __init__ (line 168) | def __init__(self, image_size=384, mean=None, std=None): method __call__ (line 181) | def __call__(self, item): method from_config (line 185) | def from_config(cls, cfg=None): class Blip2ImageTrainProcessor (line 198) | class Blip2ImageTrainProcessor(BlipImageBaseProcessor): method __init__ (line 199) | def __init__( method __call__ (line 217) | def __call__(self, item): method from_config (line 221) | def from_config(cls, cfg=None): FILE: lavis/processors/clip_processors.py function _convert_to_rgb (line 15) | def _convert_to_rgb(image): class ClipImageTrainProcessor (line 20) | class ClipImageTrainProcessor(BlipImageBaseProcessor): method __init__ (line 21) | def __init__( method from_config (line 41) | def from_config(cls, cfg=None): class ClipImageEvalProcessor (line 63) | class ClipImageEvalProcessor(BlipImageBaseProcessor): method __init__ (line 64) | def __init__(self, image_size=224, mean=None, std=None): method from_config (line 79) | def from_config(cls, cfg=None): FILE: lavis/processors/functional_video.py function _is_tensor_video_clip (line 13) | def _is_tensor_video_clip(clip): function crop (line 23) | def crop(clip, i, j, h, w): function resize (line 33) | def resize(clip, target_size, interpolation_mode): function resized_crop (line 43) | def resized_crop(clip, i, j, h, w, size, interpolation_mode="bilinear"): function center_crop (line 63) | def center_crop(clip, crop_size): function to_tensor (line 76) | def to_tensor(clip): function normalize (line 93) | def normalize(clip, mean, std, inplace=False): function hflip (line 112) | def hflip(clip): FILE: lavis/processors/gpt_processors.py class GPTVideoFeatureBaseProcessor (line 39) | class GPTVideoFeatureBaseProcessor(BaseProcessor): method __init__ (line 40) | def __init__(self, visual_ft=["i3d_rgb"], audio_ft=["vggish"]): class GPTDialogueProcessor (line 46) | class GPTDialogueProcessor(BaseProcessor): method __init__ (line 47) | def __init__(self, max_turns=3, use_caption=True): method sample_sequence (line 53) | def sample_sequence(self, caption, history, answer): method padding (line 77) | def padding(self, seq, pad_token=-1): method get_attention_mask (line 85) | def get_attention_mask(self, seq, pad_token=-1): method __call__ (line 90) | def __call__(self, ann): method from_config (line 111) | def from_config(cls, cfg=None): class GPTVideoFeatureProcessor (line 122) | class GPTVideoFeatureProcessor(GPTVideoFeatureBaseProcessor): method __init__ (line 123) | def __init__(self, visual_ft, audio_ft): method padding (line 128) | def padding(self, seq): method get_attention_mask (line 134) | def get_attention_mask(self, seq): method __call__ (line 137) | def __call__(self, ft_root, vname): method from_config (line 164) | def from_config(cls, cfg=None): FILE: lavis/processors/instruction_text_processors.py class BlipInstructionProcessor (line 412) | class BlipInstructionProcessor(BaseProcessor): method __init__ (line 413) | def __init__(self, prompt, max_words, modality, task, cmu_dict_path): method classification_output (line 431) | def classification_output(self, label): method starts_with_vowel_sound (line 443) | def starts_with_vowel_sound(self,word): method __call__ (line 448) | def __call__(self, caption): method from_config (line 470) | def from_config(classification, cfg=None): method pre_caption (line 481) | def pre_caption(self, caption): FILE: lavis/processors/randaugment.py function identity_func (line 15) | def identity_func(img): function autocontrast_func (line 19) | def autocontrast_func(img, cutoff=0): function equalize_func (line 52) | def equalize_func(img): function rotate_func (line 76) | def rotate_func(img, degree, fill=(0, 0, 0)): function solarize_func (line 87) | def solarize_func(img, thresh=128): function color_func (line 97) | def color_func(img, factor): function contrast_func (line 115) | def contrast_func(img, factor): function brightness_func (line 129) | def brightness_func(img, factor): function sharpness_func (line 138) | def sharpness_func(img, factor): function shear_x_func (line 159) | def shear_x_func(img, factor, fill=(0, 0, 0)): function translate_x_func (line 168) | def translate_x_func(img, offset, fill=(0, 0, 0)): function translate_y_func (line 180) | def translate_y_func(img, offset, fill=(0, 0, 0)): function posterize_func (line 192) | def posterize_func(img, bits): function shear_y_func (line 200) | def shear_y_func(img, factor, fill=(0, 0, 0)): function cutout_func (line 209) | def cutout_func(img, pad_size, replace=(0, 0, 0)): function enhance_level_to_args (line 223) | def enhance_level_to_args(MAX_LEVEL): function shear_level_to_args (line 230) | def shear_level_to_args(MAX_LEVEL, replace_value): function translate_level_to_args (line 240) | def translate_level_to_args(translate_const, MAX_LEVEL, replace_value): function cutout_level_to_args (line 250) | def cutout_level_to_args(cutout_const, MAX_LEVEL, replace_value): function solarize_level_to_args (line 258) | def solarize_level_to_args(MAX_LEVEL): function none_level_to_args (line 266) | def none_level_to_args(level): function posterize_level_to_args (line 270) | def posterize_level_to_args(MAX_LEVEL): function rotate_level_to_args (line 278) | def rotate_level_to_args(MAX_LEVEL, replace_value): class RandomAugment (line 326) | class RandomAugment(object): method __init__ (line 327) | def __init__(self, N=2, M=10, isPIL=False, augs=[]): method get_random_ops (line 336) | def get_random_ops(self): method __call__ (line 340) | def __call__(self, img): class VideoRandomAugment (line 352) | class VideoRandomAugment(object): method __init__ (line 353) | def __init__(self, N=2, M=10, p=0.0, tensor_in_tensor_out=True, augs=[]): method get_random_ops (line 363) | def get_random_ops(self): method __call__ (line 367) | def __call__(self, frames): method _aug (line 386) | def _aug(self, img, ops, apply_or_not): FILE: lavis/processors/transforms_video.py class RandomCropVideo (line 31) | class RandomCropVideo(RandomCrop): method __init__ (line 32) | def __init__(self, size): method __call__ (line 38) | def __call__(self, clip): method __repr__ (line 49) | def __repr__(self) -> str: class RandomResizedCropVideo (line 53) | class RandomResizedCropVideo(RandomResizedCrop): method __init__ (line 54) | def __init__( method __call__ (line 74) | def __call__(self, clip): method __repr__ (line 85) | def __repr__(self) -> str: class CenterCropVideo (line 89) | class CenterCropVideo: method __init__ (line 90) | def __init__(self, crop_size): method __call__ (line 96) | def __call__(self, clip): method __repr__ (line 106) | def __repr__(self) -> str: class NormalizeVideo (line 110) | class NormalizeVideo: method __init__ (line 119) | def __init__(self, mean, std, inplace=False): method __call__ (line 124) | def __call__(self, clip): method __repr__ (line 131) | def __repr__(self) -> str: class ToTensorVideo (line 135) | class ToTensorVideo: method __init__ (line 141) | def __init__(self): method __call__ (line 144) | def __call__(self, clip): method __repr__ (line 153) | def __repr__(self) -> str: class RandomHorizontalFlipVideo (line 157) | class RandomHorizontalFlipVideo: method __init__ (line 164) | def __init__(self, p=0.5): method __call__ (line 167) | def __call__(self, clip): method __repr__ (line 178) | def __repr__(self) -> str: FILE: lavis/processors/ulip_processors.py function pc_norm (line 23) | def pc_norm(pc): function random_sample (line 31) | def random_sample(permutation, pc, num): function pil_loader (line 36) | def pil_loader(path): function pc_normalize (line 42) | def pc_normalize(pc): function farthest_point_sample (line 49) | def farthest_point_sample(point, npoint): function rotate_point_cloud (line 72) | def rotate_point_cloud(batch_data): function random_point_dropout (line 92) | def random_point_dropout(batch_pc, max_dropout_ratio=0.875): function random_scale_point_cloud (line 101) | def random_scale_point_cloud(batch_data, scale_low=0.8, scale_high=1.25): function shift_point_cloud (line 114) | def shift_point_cloud(batch_data, shift_range=0.1): function jitter_point_cloud (line 127) | def jitter_point_cloud(batch_data, sigma=0.01, clip=0.05): function rotate_perturbation_point_cloud (line 140) | def rotate_perturbation_point_cloud(batch_data, angle_sigma=0.06, angle_... class ULIPPCProcessor (line 166) | class ULIPPCProcessor(BlipImageBaseProcessor): method __init__ (line 167) | def __init__( method __call__ (line 188) | def __call__(self, pc_data_path): method from_config (line 242) | def from_config(cls, cfg=None): FILE: lavis/runners/runner_base.py class RunnerBase (line 39) | class RunnerBase: method __init__ (line 47) | def __init__(self, cfg, task, model, datasets, job_id): method device (line 69) | def device(self): method use_distributed (line 76) | def use_distributed(self): method model (line 80) | def model(self): method optimizer (line 100) | def optimizer(self): method scaler (line 123) | def scaler(self): method lr_scheduler (line 133) | def lr_scheduler(self): method dataloaders (line 165) | def dataloaders(self) -> dict: method cuda_enabled (line 264) | def cuda_enabled(self): method max_epoch (line 268) | def max_epoch(self): method log_freq (line 272) | def log_freq(self): method save_freq (line 277) | def save_freq(self): method val_freq (line 282) | def val_freq(self): method save_last (line 287) | def save_last(self): method init_lr (line 292) | def init_lr(self): method min_lr (line 296) | def min_lr(self): method accum_grad_iters (line 300) | def accum_grad_iters(self): method valid_splits (line 304) | def valid_splits(self): method test_splits (line 313) | def test_splits(self): method train_splits (line 319) | def train_splits(self): method evaluate_only (line 328) | def evaluate_only(self): method use_dist_eval_sampler (line 335) | def use_dist_eval_sampler(self): method resume_ckpt_path (line 339) | def resume_ckpt_path(self): method train_loader (line 343) | def train_loader(self): method setup_output_dir (line 348) | def setup_output_dir(self): method train (line 363) | def train(self): method evaluate (line 436) | def evaluate(self, cur_epoch="best", skip_reload=False): method train_epoch (line 447) | def train_epoch(self, epoch): method eval_epoch (line 464) | def eval_epoch(self, split_name, cur_epoch, skip_reload=False): method unwrap_dist_model (line 498) | def unwrap_dist_model(self, model): method create_loaders (line 504) | def create_loaders( method _save_checkpoint (line 586) | def _save_checkpoint(self, cur_epoch, is_best=False): method _reload_best_model (line 614) | def _reload_best_model(self, model): method _load_checkpoint (line 634) | def _load_checkpoint(self, url_or_filename): method log_stats (line 659) | def log_stats(self, stats, split_name): method log_config (line 668) | def log_config(self): FILE: lavis/runners/runner_iter.py class RunnerIter (line 25) | class RunnerIter(RunnerBase): method __init__ (line 41) | def __init__(self, cfg, task, model, datasets, job_id): method max_epoch (line 57) | def max_epoch(self): method cur_epoch (line 61) | def cur_epoch(self): method _progress (line 68) | def _progress(self, cur_iters): method train (line 71) | def train(self): method train_iters (line 150) | def train_iters(self, epoch, start_iters): method _save_checkpoint (line 169) | def _save_checkpoint(self, cur_iters, is_best=False, is_last=False): method _load_checkpoint (line 195) | def _load_checkpoint(self, url_or_filename): method dataloaders (line 220) | def dataloaders(self) -> dict: FILE: lavis/tasks/__init__.py function setup_task (line 22) | def setup_task(cfg): FILE: lavis/tasks/base_task.py class BaseTask (line 19) | class BaseTask: method __init__ (line 20) | def __init__(self, **kwargs): method setup_task (line 26) | def setup_task(cls, **kwargs): method build_model (line 29) | def build_model(self, cfg): method build_datasets (line 35) | def build_datasets(self, cfg): method train_step (line 62) | def train_step(self, model, samples): method valid_step (line 70) | def valid_step(self, model, samples): method before_training (line 73) | def before_training(self, model, dataset, **kwargs): method before_evaluation (line 76) | def before_evaluation(self, model, dataset, **kwargs): method after_evaluation (line 79) | def after_evaluation(self, **kwargs): method inference_step (line 82) | def inference_step(self): method evaluation (line 85) | def evaluation(self, model, data_loader, cuda_enabled=True): method train_epoch (line 104) | def train_epoch( method train_iters (line 129) | def train_iters( method _train_inner_loop (line 157) | def _train_inner_loop( method save_result (line 257) | def save_result(result, result_dir, filename, remove_duplicate=""): FILE: lavis/tasks/captioning.py class CaptionTask (line 18) | class CaptionTask(BaseTask): method __init__ (line 19) | def __init__(self, num_beams, max_len, min_len, repetition_penalty, le... method setup_task (line 41) | def setup_task(cls, cfg): method build_datasets (line 79) | def build_datasets(self, cfg): method valid_step (line 101) | def valid_step(self, model, samples): method after_evaluation (line 125) | def after_evaluation(self, val_result, split_name, epoch, **kwargs): method _report_metrics (line 143) | def _report_metrics(self, eval_result_file, split_name): function load_gt_file (line 165) | def load_gt_file(file_path): function convert_to_coco_gt (line 186) | def convert_to_coco_gt(data, outpath, caption_key, sample_id_key, split,... function coco_caption_eval (line 222) | def coco_caption_eval(coco_gt_root, results_file, split, annotation_file... FILE: lavis/tasks/dialogue.py class DialogueTask (line 21) | class DialogueTask(BaseTask): method __init__ (line 22) | def __init__(self, num_beams, max_len, min_len, evaluate, report_metri... method setup_task (line 33) | def setup_task(cls, cfg): method valid_step (line 51) | def valid_step(self, model, samples): method after_evaluation (line 57) | def after_evaluation(self, val_result, split_name, epoch, **kwargs): method _report_metrics (line 68) | def _report_metrics(self, eval_result_file, split_name): function coco_dialogue_eval (line 93) | def coco_dialogue_eval(coco_gt_root, results_file, split): FILE: lavis/tasks/image_text_pretrain.py class ImageTextPretrainTask (line 13) | class ImageTextPretrainTask(BaseTask): method __init__ (line 14) | def __init__(self): method evaluation (line 17) | def evaluation(self, model, data_loader, cuda_enabled=True): FILE: lavis/tasks/multimodal_classification.py class MultimodalClassificationTask (line 21) | class MultimodalClassificationTask(BaseTask): method __init__ (line 22) | def __init__(self, method setup_task (line 35) | def setup_task(cls, cfg): method valid_step (line 50) | def valid_step(self, model, samples): method after_evaluation (line 101) | def after_evaluation(self, val_result, split_name, epoch, **kwargs): method _report_metrics (line 116) | def _report_metrics(self, eval_result_file, split_name): FILE: lavis/tasks/retrieval.py class RetrievalTask (line 20) | class RetrievalTask(BaseTask): method __init__ (line 21) | def __init__(self, cfg): method setup_task (line 27) | def setup_task(cls, cfg): method evaluation (line 32) | def evaluation(self, model, data_loader, **kwargs): method after_evaluation (line 49) | def after_evaluation(self, val_result, **kwargs): method _report_metrics (line 54) | def _report_metrics(scores_i2t, scores_t2i, txt2img, img2txt): FILE: lavis/tasks/text_to_image_generation.py class TextToImageGenerationTask (line 13) | class TextToImageGenerationTask(BaseTask): method __init__ (line 14) | def __init__(self, cfg): method setup_task (line 20) | def setup_task(cls, cfg): FILE: lavis/tasks/vqa.py class VQATask (line 23) | class VQATask(BaseTask): method __init__ (line 24) | def __init__( method setup_task (line 60) | def setup_task(cls, cfg): method build_datasets (line 95) | def build_datasets(self, cfg): method valid_step (line 132) | def valid_step(self, model, samples): method after_evaluation (line 154) | def after_evaluation(self, val_result, split_name, **kwargs): method _report_metrics (line 167) | def _report_metrics(self, result_file, split): function convert_to_coco_gt (line 204) | def convert_to_coco_gt(data, outpath_questions, outpath_annotations, spl... class AOKVQATask (line 237) | class AOKVQATask(VQATask): method valid_step (line 238) | def valid_step(self, model, samples): method _report_metrics (line 262) | def _report_metrics(self, result_file, split): method _save_result_leaderboard (line 299) | def _save_result_leaderboard(self, results): class GQATask (line 322) | class GQATask(VQATask): method valid_step (line 323) | def valid_step(self, model, samples): method build_datasets (line 345) | def build_datasets(self, cfg): method _report_metrics (line 366) | def _report_metrics(self, result_file, split): class DisCRNTask (line 410) | class DisCRNTask(VQATask): method valid_step (line 411) | def valid_step(self, model, samples): method build_datasets (line 438) | def build_datasets(self, cfg): method _report_metrics (line 443) | def _report_metrics(self, result_file, split): FILE: lavis/tasks/vqa_reading_comprehension.py class VQARCTask (line 23) | class VQARCTask(VQATask): method __init__ (line 24) | def __init__( method setup_task (line 39) | def setup_task(cls, cfg): method valid_step (line 61) | def valid_step(self, model, samples): method after_evaluation (line 93) | def after_evaluation(self, val_result, split_name, **kwargs): method save_gradcam (line 122) | def save_gradcam(self, result, result_dir, filename, remove_duplicate=... class GQARCTask (line 157) | class GQARCTask(VQARCTask): method valid_step (line 158) | def valid_step(self, model, samples): method _report_metrics (line 193) | def _report_metrics(self, result_file, split): method _save_result_leaderboard (line 232) | def _save_result_leaderboard(self, results): FILE: projects/img2llm-vqa/img2llm_vqa.py function load_model (line 149) | def load_model(model_selection): function postprocess_Answer (line 153) | def postprocess_Answer(text): FILE: projects/instructblip/run_demo.py function inference (line 91) | def inference(image, prompt, min_len, max_len, beam_size, len_penalty, r... FILE: projects/xinstructblip/data_aug/3d_qa_data_generation.py function get_output (line 33) | def get_output(input_text, input_len=128, output_len=128): FILE: projects/xinstructblip/data_aug/audio_qa_data_generation.py function get_output (line 34) | def get_output(input_text, input_len=128, output_len=128): FILE: projects/xinstructblip/demo/run_demo.py function as_mesh (line 25) | def as_mesh(scene_or_mesh): function convert_mesh_to_numpy (line 44) | def convert_mesh_to_numpy(mesh_file, npoints=8192): function load_mesh (line 67) | def load_mesh(mesh_file_name): function setup_seeds (line 70) | def setup_seeds(seed=42): function inference (line 112) | def inference(image, point_cloud, audio, video, prompt, qformer_prompt, ... FILE: projects/xinstructblip/discrn/caption_baseline/predict_image.py function check_positive (line 27) | def check_positive(value): function check_float_range (line 33) | def check_float_range(min_val, max_val): function setup_seeds (line 41) | def setup_seeds(seed): function inference (line 208) | def inference(image, prompt, min_len=1, max_len=250, beam_size=5, len_pe... FILE: projects/xinstructblip/discrn/caption_baseline/predict_pc.py function check_positive (line 24) | def check_positive(value): function check_float_range (line 30) | def check_float_range(min_val, max_val): function setup_seeds (line 38) | def setup_seeds(seed): function inference (line 205) | def inference(image, prompt, min_len=1, max_len=250, beam_size=5, len_pe... FILE: projects/xinstructblip/discrn/caption_baseline/predict_video.py function check_positive (line 27) | def check_positive(value): function check_float_range (line 33) | def check_float_range(min_val, max_val): function setup_seeds (line 41) | def setup_seeds(seed): function inference (line 209) | def inference(image, prompt, min_len=1, max_len=250, beam_size=5, len_pe... FILE: projects/xinstructblip/discrn/data_generation/audiocaps_video_audio.py function get_pair_by_sim (line 48) | def get_pair_by_sim(c1, clist): function get_output (line 61) | def get_output(input_text, input_len=128, output_len=128): FILE: projects/xinstructblip/discrn/data_generation/objaverse_img_3d.py function get_pair_by_sim (line 41) | def get_pair_by_sim(c1, clist): function get_output (line 54) | def get_output(input_text, input_len=128, output_len=128): FILE: setup.py function fetch_requirements (line 16) | def fetch_requirements(filename): FILE: tests/models/test_albef.py class TestAlbef (line 26) | class TestAlbef: method test_vqa (line 27) | def test_vqa(self): method test_vqa_forward (line 45) | def test_vqa_forward(self): method test_retrieval (line 81) | def test_retrieval(self): method test_pretrain (line 122) | def test_pretrain(self): FILE: tests/models/test_blip.py class TestBlip (line 26) | class TestBlip: method test_caption (line 27) | def test_caption(self): method test_caption_large (line 48) | def test_caption_large(self): method test_caption_forward (line 69) | def test_caption_forward(self): method test_vqa (line 114) | def test_vqa(self): method test_retrieval (line 138) | def test_retrieval(self): method test_pretrain (line 179) | def test_pretrain(self): method test_feature_extractor (line 213) | def test_feature_extractor(self): method test_itm (line 263) | def test_itm(self): FILE: tests/models/test_blip2.py class TestBlip2 (line 24) | class TestBlip2: method test_blip2_opt2p7b (line 25) | def test_blip2_opt2p7b(self): method test_blip2_opt2p7b_coco (line 45) | def test_blip2_opt2p7b_coco(self): method test_blip2_opt6p7b (line 68) | def test_blip2_opt6p7b(self): method test_blip2_opt6p7b_coco (line 88) | def test_blip2_opt6p7b_coco(self): method test_blip2_flant5xl (line 111) | def test_blip2_flant5xl(self): method test_blip2_flant5xxl (line 131) | def test_blip2_flant5xxl(self): FILE: tests/models/test_pnp_vqa.py class TestPNPVQA (line 26) | class TestPNPVQA: method test_vqa (line 27) | def test_vqa(self): method test_itm (line 57) | def test_itm(self): method test_caption (line 76) | def test_caption(self): method test_qa (line 98) | def test_qa(self): FILE: train.py function parse_args (line 35) | def parse_args(): function setup_seeds (line 54) | def setup_seeds(config): function get_runner_class (line 65) | def get_runner_class(cfg): function main (line 74) | def main():