SYMBOL INDEX (1459 symbols across 185 files) FILE: XMem/dataset/reseed.py function reseed (line 4) | def reseed(seed): FILE: XMem/dataset/static_dataset.py class StaticTransformDataset (line 16) | class StaticTransformDataset(Dataset): method __init__ (line 24) | def __init__(self, parameters, num_frames=3, max_num_obj=1): method _get_sample (line 90) | def _get_sample(self, idx): method __getitem__ (line 128) | def __getitem__(self, idx): method __len__ (line 178) | def __len__(self): FILE: XMem/dataset/tps.py function pick_random_points (line 8) | def pick_random_points(h, w, n_samples): function warp_dual_cv (line 14) | def warp_dual_cv(img, mask, c_src, c_dst): function random_tps_warp (line 22) | def random_tps_warp(img, mask, scale, n_ctrl_pts=12): FILE: XMem/dataset/util.py function all_to_onehot (line 4) | def all_to_onehot(masks, labels): FILE: XMem/dataset/vos_dataset.py class VOSDataset (line 15) | class VOSDataset(Dataset): method __init__ (line 25) | def __init__(self, im_root, gt_root, max_jump, is_bl, subset=None, num... method __getitem__ (line 97) | def __getitem__(self, idx): method __len__ (line 215) | def __len__(self): FILE: XMem/eval_batch.py function run_eval (line 16) | def run_eval(meta_expression, temp_xmem_anno, final_xmem_anno, img_dir, ... function main (line 23) | def main(): FILE: XMem/generate_xmem_data_single.py function generate (line 20) | def generate(obj, temp_xmem_anno, final_xmem_anno): function main (line 47) | def main(): FILE: XMem/inference/data/mask_mapper.py class MaskMapper (line 7) | class MaskMapper: method __init__ (line 19) | def __init__(self): method convert_mask (line 26) | def convert_mask(self, mask, exhaustive=False): method remap_index_mask (line 57) | def remap_index_mask(self, mask): FILE: XMem/inference/data/test_datasets.py class LongTestDataset (line 9) | class LongTestDataset: method __init__ (line 11) | def __init__(self, meta_expression, data_root, size=-1, img_dir = '', ... method get_datasets (line 34) | def get_datasets(self): method __len__ (line 46) | def __len__(self): class DAVISTestDataset (line 50) | class DAVISTestDataset: method __init__ (line 51) | def __init__(self, data_root, imset='2017/val.txt', size=-1): method get_datasets (line 69) | def get_datasets(self): method __len__ (line 78) | def __len__(self): class YouTubeVOSTestDataset (line 82) | class YouTubeVOSTestDataset: method __init__ (line 83) | def __init__(self, data_root, split, size=480): method get_datasets (line 104) | def get_datasets(self): method __len__ (line 114) | def __len__(self): FILE: XMem/inference/data/video_reader.py class VideoReader (line 14) | class VideoReader(Dataset): method __init__ (line 18) | def __init__(self, vid_name, image_dir, mask_dir, size=-1, to_save=Non... method __getitem__ (line 59) | def __getitem__(self, idx): method resize_mask (line 92) | def resize_mask(self, mask): method get_palette (line 99) | def get_palette(self): method __len__ (line 102) | def __len__(self): FILE: XMem/inference/inference_core.py class InferenceCore (line 8) | class InferenceCore: method __init__ (line 9) | def __init__(self, network:XMem, config): method clear_memory (line 22) | def clear_memory(self): method update_config (line 29) | def update_config(self, config): method set_all_labels (line 38) | def set_all_labels(self, all_labels): method step (line 42) | def step(self, image, mask=None, valid_labels=None, end=False): FILE: XMem/inference/interact/fbrs/controller.py class InteractiveController (line 11) | class InteractiveController: method __init__ (line 12) | def __init__(self, net, device, predictor_params, prob_thresh=0.5): method set_image (line 27) | def set_image(self, image): method add_click (line 33) | def add_click(self, x, y, is_positive): method undo_click (line 52) | def undo_click(self): method partially_finish_object (line 61) | def partially_finish_object(self): method finish_object (line 72) | def finish_object(self): method reset_last_object (line 82) | def reset_last_object(self): method reset_predictor (line 88) | def reset_predictor(self, predictor_params=None): method current_object_prob (line 97) | def current_object_prob(self): method is_incomplete_mask (line 105) | def is_incomplete_mask(self): method result_mask (line 109) | def result_mask(self): FILE: XMem/inference/interact/fbrs/inference/clicker.py class Clicker (line 10) | class Clicker(object): method __init__ (line 11) | def __init__(self, gt_mask=None, init_clicks=None, ignore_label=-1): method make_next_click (line 24) | def make_next_click(self, pred_mask): method get_clicks (line 29) | def get_clicks(self, clicks_limit=None): method _get_click (line 32) | def _get_click(self, pred_mask, padding=True): method add_click (line 61) | def add_click(self, click): method _remove_last_click (line 73) | def _remove_last_click(self): method reset_clicks (line 85) | def reset_clicks(self): method get_state (line 94) | def get_state(self): method set_state (line 97) | def set_state(self, state): method __len__ (line 102) | def __len__(self): FILE: XMem/inference/interact/fbrs/inference/evaluation.py function evaluate_dataset (line 16) | def evaluate_dataset(dataset, predictor, oracle_eval=False, **kwargs): function evaluate_sample (line 36) | def evaluate_sample(image_nd, instances_mask, predictor, max_iou_thr, FILE: XMem/inference/interact/fbrs/inference/predictors/__init__.py function get_predictor (line 8) | def get_predictor(net, brs_mode, device, FILE: XMem/inference/interact/fbrs/inference/predictors/base.py class BasePredictor (line 7) | class BasePredictor(object): method __init__ (line 8) | def __init__(self, net, device, method set_input_image (line 28) | def set_input_image(self, image_nd): method get_prediction (line 35) | def get_prediction(self, clicker): method _get_prediction (line 56) | def _get_prediction(self, image_nd, clicks_lists, is_image_changed): method _get_transform_states (line 60) | def _get_transform_states(self): method _set_transform_states (line 63) | def _set_transform_states(self, states): method apply_transforms (line 68) | def apply_transforms(self, image_nd, clicks_lists): method get_points_nd (line 76) | def get_points_nd(self, clicks_lists): method get_states (line 96) | def get_states(self): method set_states (line 99) | def set_states(self, states): FILE: XMem/inference/interact/fbrs/inference/predictors/brs.py class BRSBasePredictor (line 10) | class BRSBasePredictor(BasePredictor): method __init__ (line 11) | def __init__(self, model, device, opt_functor, optimize_after_n_clicks... method set_input_image (line 19) | def set_input_image(self, image_nd): method _get_clicks_maps_nd (line 24) | def _get_clicks_maps_nd(self, clicks_lists, image_shape, radius=1): method get_states (line 46) | def get_states(self): method set_states (line 49) | def set_states(self, states): class FeatureBRSPredictor (line 54) | class FeatureBRSPredictor(BRSBasePredictor): method __init__ (line 55) | def __init__(self, model, device, opt_functor, insertion_mode='after_d... method _get_prediction (line 69) | def _get_prediction(self, image_nd, clicks_lists, is_image_changed): method _get_head_input (line 121) | def _get_head_input(self, image_nd, points): class HRNetFeatureBRSPredictor (line 143) | class HRNetFeatureBRSPredictor(BRSBasePredictor): method __init__ (line 144) | def __init__(self, model, device, opt_functor, insertion_mode='A', **k... method _get_prediction (line 156) | def _get_prediction(self, image_nd, clicks_lists, is_image_changed): method _get_head_input (line 209) | def _get_head_input(self, image_nd, points): class InputBRSPredictor (line 228) | class InputBRSPredictor(BRSBasePredictor): method __init__ (line 229) | def __init__(self, model, device, opt_functor, optimize_target='rgb', ... method _get_prediction (line 233) | def _get_prediction(self, image_nd, clicks_lists, is_image_changed): FILE: XMem/inference/interact/fbrs/inference/predictors/brs_functors.py class BaseOptimizer (line 8) | class BaseOptimizer: method __init__ (line 9) | def __init__(self, optimizer_params, method init_click (line 33) | def init_click(self, get_prediction_logits, pos_mask, neg_mask, device... method __call__ (line 41) | def __call__(self, x): method unpack_opt_params (line 79) | def unpack_opt_params(self, opt_params): class InputOptimizer (line 83) | class InputOptimizer(BaseOptimizer): method unpack_opt_params (line 84) | def unpack_opt_params(self, opt_params): class ScaleBiasOptimizer (line 94) | class ScaleBiasOptimizer(BaseOptimizer): method __init__ (line 95) | def __init__(self, *args, scale_act=None, reg_bias_weight=10.0, **kwar... method unpack_opt_params (line 100) | def unpack_opt_params(self, opt_params): FILE: XMem/inference/interact/fbrs/inference/predictors/brs_losses.py class BRSMaskLoss (line 6) | class BRSMaskLoss(torch.nn.Module): method __init__ (line 7) | def __init__(self, eps=1e-5): method forward (line 11) | def forward(self, result, pos_mask, neg_mask): class OracleMaskLoss (line 29) | class OracleMaskLoss(torch.nn.Module): method __init__ (line 30) | def __init__(self): method set_gt_mask (line 37) | def set_gt_mask(self, gt_mask): method forward (line 41) | def forward(self, result, pos_mask, neg_mask): FILE: XMem/inference/interact/fbrs/inference/transforms/base.py class BaseTransform (line 4) | class BaseTransform(object): method __init__ (line 5) | def __init__(self): method transform (line 8) | def transform(self, image_nd, clicks_lists): method inv_transform (line 11) | def inv_transform(self, prob_map): method reset (line 14) | def reset(self): method get_state (line 17) | def get_state(self): method set_state (line 20) | def set_state(self, state): class SigmoidForPred (line 24) | class SigmoidForPred(BaseTransform): method transform (line 25) | def transform(self, image_nd, clicks_lists): method inv_transform (line 28) | def inv_transform(self, prob_map): method reset (line 31) | def reset(self): method get_state (line 34) | def get_state(self): method set_state (line 37) | def set_state(self, state): FILE: XMem/inference/interact/fbrs/inference/transforms/crops.py class Crops (line 10) | class Crops(BaseTransform): method __init__ (line 11) | def __init__(self, crop_size=(320, 480), min_overlap=0.2): method transform (line 20) | def transform(self, image_nd, clicks_lists): method inv_transform (line 51) | def inv_transform(self, prob_map): method get_state (line 67) | def get_state(self): method set_state (line 70) | def set_state(self, state): method reset (line 73) | def reset(self): function get_offsets (line 79) | def get_offsets(length, crop_size, min_overlap_ratio=0.2): FILE: XMem/inference/interact/fbrs/inference/transforms/flip.py class AddHorizontalFlip (line 7) | class AddHorizontalFlip(BaseTransform): method transform (line 8) | def transform(self, image_nd, clicks_lists): method inv_transform (line 23) | def inv_transform(self, prob_map): method get_state (line 30) | def get_state(self): method set_state (line 33) | def set_state(self, state): method reset (line 36) | def reset(self): FILE: XMem/inference/interact/fbrs/inference/transforms/limit_longest_side.py class LimitLongestSide (line 4) | class LimitLongestSide(ZoomIn): method __init__ (line 5) | def __init__(self, max_size=800): method transform (line 8) | def transform(self, image_nd, clicks_lists): FILE: XMem/inference/interact/fbrs/inference/transforms/zoom_in.py class ZoomIn (line 8) | class ZoomIn(BaseTransform): method __init__ (line 9) | def __init__(self, method transform (line 29) | def transform(self, image_nd, clicks_lists): method inv_transform (line 65) | def inv_transform(self, prob_map): method check_possible_recalculation (line 85) | def check_possible_recalculation(self): method get_state (line 98) | def get_state(self): method set_state (line 102) | def set_state(self, state): method reset (line 105) | def reset(self): method _transform_clicks (line 112) | def _transform_clicks(self, clicks_list): function get_object_roi (line 127) | def get_object_roi(pred_mask, clicks_list, expansion_ratio, min_crop_size): function get_roi_image_nd (line 142) | def get_roi_image_nd(image_nd, object_roi, target_size): function check_object_roi (line 163) | def check_object_roi(object_roi, clicks_list): FILE: XMem/inference/interact/fbrs/inference/utils.py function get_time_metrics (line 11) | def get_time_metrics(all_ious, elapsed_time): function load_is_model (line 21) | def load_is_model(checkpoint, device, backbone='auto', **kwargs): function load_hrnet_is_model (line 40) | def load_hrnet_is_model(state_dict, device, backbone='auto', width=48, o... function load_deeplab_is_model (line 67) | def load_deeplab_is_model(state_dict, device, backbone='auto', deeplab_c... function get_iou (line 103) | def get_iou(gt_mask, pred_mask, ignore_label=-1): function compute_noc_metric (line 113) | def compute_noc_metric(all_ious, iou_thrs, max_clicks=20): function find_checkpoint (line 133) | def find_checkpoint(weights_folder, checkpoint_name): function get_results_table (line 156) | def get_results_table(noc_list, over_max_list, brs_type, dataset_name, m... FILE: XMem/inference/interact/fbrs/model/initializer.py class Initializer (line 6) | class Initializer(object): method __init__ (line 7) | def __init__(self, local_init=True, gamma=None): method __call__ (line 11) | def __call__(self, m): method _init_weight (line 31) | def _init_weight(self, data): method _init_bias (line 34) | def _init_bias(self, data): method _init_gamma (line 37) | def _init_gamma(self, data): method _init_beta (line 43) | def _init_beta(self, data): class Bilinear (line 47) | class Bilinear(Initializer): method __init__ (line 48) | def __init__(self, scale, groups, in_channels, **kwargs): method _init_weight (line 54) | def _init_weight(self, data): method get_bilinear_kernel (line 67) | def get_bilinear_kernel(scale): class XavierGluon (line 79) | class XavierGluon(Initializer): method __init__ (line 80) | def __init__(self, rnd_type='uniform', factor_type='avg', magnitude=3,... method _init_weight (line 87) | def _init_weight(self, arr): FILE: XMem/inference/interact/fbrs/model/is_deeplab_model.py function get_deeplab_model (line 9) | def get_deeplab_model(backbone='resnet50', deeplab_ch=256, aspp_dropout=... class DistMapsModel (line 30) | class DistMapsModel(nn.Module): method __init__ (line 31) | def __init__(self, feature_extractor, head, norm_layer=nn.BatchNorm2d,... method forward (line 50) | def forward(self, image, points): method load_weights (line 68) | def load_weights(self, path_to_weights): method get_trainable_params (line 74) | def get_trainable_params(self): FILE: XMem/inference/interact/fbrs/model/is_hrnet_model.py function get_hrnet_model (line 8) | def get_hrnet_model(width=48, ocr_width=256, small=False, norm_radius=260, class DistMapsHRNetModel (line 24) | class DistMapsHRNetModel(nn.Module): method __init__ (line 25) | def __init__(self, feature_extractor, use_rgb_conv=True, with_aux_outp... method forward (line 43) | def forward(self, image, points): method load_weights (line 67) | def load_weights(self, path_to_weights): method get_trainable_params (line 73) | def get_trainable_params(self): FILE: XMem/inference/interact/fbrs/model/losses.py class NormalizedFocalLossSigmoid (line 9) | class NormalizedFocalLossSigmoid(nn.Module): method __init__ (line 10) | def __init__(self, axis=-1, alpha=0.25, gamma=2, method forward (line 30) | def forward(self, pred, label, sample_weight=None): method log_states (line 66) | def log_states(self, sw, name, global_step): class FocalLoss (line 70) | class FocalLoss(nn.Module): method __init__ (line 71) | def __init__(self, axis=-1, alpha=0.25, gamma=2, method forward (line 88) | def forward(self, pred, label, sample_weight=None): class SigmoidBinaryCrossEntropyLoss (line 113) | class SigmoidBinaryCrossEntropyLoss(nn.Module): method __init__ (line 114) | def __init__(self, from_sigmoid=False, weight=None, batch_axis=0, igno... method forward (line 121) | def forward(self, pred, label): FILE: XMem/inference/interact/fbrs/model/metrics.py class TrainMetric (line 7) | class TrainMetric(object): method __init__ (line 8) | def __init__(self, pred_outputs, gt_outputs): method update (line 12) | def update(self, *args, **kwargs): method get_epoch_value (line 15) | def get_epoch_value(self): method reset_epoch_stats (line 18) | def reset_epoch_stats(self): method log_states (line 21) | def log_states(self, sw, tag_prefix, global_step): method name (line 25) | def name(self): class AdaptiveIoU (line 29) | class AdaptiveIoU(TrainMetric): method __init__ (line 30) | def __init__(self, init_thresh=0.4, thresh_step=0.025, thresh_beta=0.9... method update (line 44) | def update(self, pred, gt): method get_epoch_value (line 67) | def get_epoch_value(self): method reset_epoch_stats (line 73) | def reset_epoch_stats(self): method log_states (line 77) | def log_states(self, sw, tag_prefix, global_step): method iou_thresh (line 82) | def iou_thresh(self): function _compute_iou (line 86) | def _compute_iou(pred_mask, gt_mask, ignore_mask=None, keep_ignore=False): FILE: XMem/inference/interact/fbrs/model/modeling/basic_blocks.py class ConvHead (line 6) | class ConvHead(nn.Module): method __init__ (line 7) | def __init__(self, out_channels, in_channels=32, num_layers=1, method forward (line 23) | def forward(self, *inputs): class SepConvHead (line 27) | class SepConvHead(nn.Module): method __init__ (line 28) | def __init__(self, num_outputs, in_channels, mid_channels, num_layers=1, method forward (line 51) | def forward(self, *inputs): class SeparableConv2d (line 57) | class SeparableConv2d(nn.Module): method __init__ (line 58) | def __init__(self, in_channels, out_channels, dw_kernel, dw_padding, d... method forward (line 70) | def forward(self, x): FILE: XMem/inference/interact/fbrs/model/modeling/deeplab_v3.py class DeepLabV3Plus (line 12) | class DeepLabV3Plus(nn.Module): method __init__ (line 13) | def __init__(self, backbone='resnet50', norm_layer=nn.BatchNorm2d, method load_pretrained_weights (line 51) | def load_pretrained_weights(self): method set_prediction_mode (line 64) | def set_prediction_mode(self): method forward (line 68) | def forward(self, x): class _SkipProject (line 84) | class _SkipProject(nn.Module): method __init__ (line 85) | def __init__(self, in_channels, out_channels, norm_layer=nn.BatchNorm2d): method forward (line 95) | def forward(self, x): class _DeepLabHead (line 99) | class _DeepLabHead(nn.Module): method __init__ (line 100) | def __init__(self, out_channels, in_channels, mid_channels=256, norm_l... method forward (line 111) | def forward(self, x): class _ASPP (line 115) | class _ASPP(nn.Module): method __init__ (line 116) | def __init__(self, in_channels, atrous_rates, out_channels=256, method forward (line 144) | def forward(self, x): class _AsppPooling (line 150) | class _AsppPooling(nn.Module): method __init__ (line 151) | def __init__(self, in_channels, out_channels, norm_layer): method forward (line 162) | def forward(self, x): function _ASPPConv (line 167) | def _ASPPConv(in_channels, out_channels, atrous_rate, norm_layer): FILE: XMem/inference/interact/fbrs/model/modeling/hrnet_ocr.py class HighResolutionModule (line 13) | class HighResolutionModule(nn.Module): method __init__ (line 14) | def __init__(self, num_branches, blocks, num_blocks, num_inchannels, method _check_branches (line 33) | def _check_branches(self, num_branches, num_blocks, num_inchannels, nu... method _make_one_branch (line 49) | def _make_one_branch(self, branch_index, block, num_blocks, num_channels, method _make_branches (line 74) | def _make_branches(self, num_branches, block, num_blocks, num_channels): method _make_fuse_layers (line 83) | def _make_fuse_layers(self): method get_num_inchannels (line 125) | def get_num_inchannels(self): method forward (line 128) | def forward(self, x): class HighResolutionNet (line 155) | class HighResolutionNet(nn.Module): method __init__ (line 156) | def __init__(self, width, num_classes, ocr_width=256, small=False, method _make_transition_layer (line 239) | def _make_transition_layer( method _make_layer (line 274) | def _make_layer(self, block, inplanes, planes, blocks, stride=1): method _make_stage (line 292) | def _make_stage(self, block, num_inchannels, method forward (line 318) | def forward(self, x): method compute_hrnet_feats (line 329) | def compute_hrnet_feats(self, x): method load_pretrained_weights (line 379) | def load_pretrained_weights(self, pretrained_path=''): FILE: XMem/inference/interact/fbrs/model/modeling/ocr.py class SpatialGather_Module (line 7) | class SpatialGather_Module(nn.Module): method __init__ (line 14) | def __init__(self, cls_num=0, scale=1): method forward (line 19) | def forward(self, feats, probs): class SpatialOCR_Module (line 30) | class SpatialOCR_Module(nn.Module): method __init__ (line 36) | def __init__(self, method forward (line 55) | def forward(self, feats, proxy_feats): class ObjectAttentionBlock2D (line 63) | class ObjectAttentionBlock2D(nn.Module): method __init__ (line 77) | def __init__(self, method forward (line 117) | def forward(self, x, proxy): FILE: XMem/inference/interact/fbrs/model/modeling/resnet.py class ResNetBackbone (line 5) | class ResNetBackbone(torch.nn.Module): method __init__ (line 6) | def __init__(self, backbone='resnet50', pretrained_base=True, dilated=... method forward (line 29) | def forward(self, x): FILE: XMem/inference/interact/fbrs/model/modeling/resnetv1b.py class BasicBlockV1b (line 6) | class BasicBlockV1b(nn.Module): method __init__ (line 9) | def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=... method forward (line 23) | def forward(self, x): class BottleneckV1b (line 42) | class BottleneckV1b(nn.Module): method __init__ (line 45) | def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=... method forward (line 62) | def forward(self, x): class ResNetV1b (line 85) | class ResNetV1b(nn.Module): method __init__ (line 114) | def __init__(self, block, layers, classes=1000, dilated=True, deep_ste... method _make_layer (line 153) | def _make_layer(self, block, planes, blocks, stride=1, dilation=1, method forward (line 197) | def forward(self, x): function _safe_state_dict_filtering (line 217) | def _safe_state_dict_filtering(orig_dict, model_dict_keys): function resnet34_v1b (line 227) | def resnet34_v1b(pretrained=False, **kwargs): function resnet50_v1s (line 240) | def resnet50_v1s(pretrained=False, **kwargs): function resnet101_v1s (line 253) | def resnet101_v1s(pretrained=False, **kwargs): function resnet152_v1s (line 266) | def resnet152_v1s(pretrained=False, **kwargs): FILE: XMem/inference/interact/fbrs/model/ops.py function select_activation_function (line 9) | def select_activation_function(activation): class BilinearConvTranspose2d (line 23) | class BilinearConvTranspose2d(nn.ConvTranspose2d): method __init__ (line 24) | def __init__(self, in_channels, out_channels, scale, groups=1): class DistMaps (line 39) | class DistMaps(nn.Module): method __init__ (line 40) | def __init__(self, norm_radius, spatial_scale=1.0, cpu_mode=False): method get_coord_features (line 46) | def get_coord_features(self, points, batchsize, rows, cols): method forward (line 82) | def forward(self, x, coords): FILE: XMem/inference/interact/fbrs/model/syncbn/modules/functional/_csrc.py function _load_C_extensions (line 27) | def _load_C_extensions(): FILE: XMem/inference/interact/fbrs/model/syncbn/modules/functional/csrc/cuda/common.h function __device__ (line 29) | __device__ Pair() {} function __device__ (line 30) | __device__ Pair(T _v1, T _v2) : v1(_v1), v2(_v2) {} function __device__ (line 31) | __device__ Pair(T v) : v1(v), v2(v) {} function __device__ (line 32) | __device__ Pair(int v) : v1(v), v2(v) {} function getMSB (line 54) | int getMSB(int val) { return 31 - __clz(val); } function getNumThreads (line 56) | static int getNumThreads(int nElem) { FILE: XMem/inference/interact/fbrs/model/syncbn/modules/functional/csrc/ext_lib.cpp function PYBIND11_MODULE (line 3) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: XMem/inference/interact/fbrs/model/syncbn/modules/functional/syncbn.py function _count_samples (line 20) | def _count_samples(x): class BatchNorm2dSyncFunc (line 28) | class BatchNorm2dSyncFunc(Function): method forward (line 31) | def forward(ctx, x, weight, bias, running_mean, running_var, method backward (line 95) | def backward(ctx, dz): FILE: XMem/inference/interact/fbrs/model/syncbn/modules/nn/syncbn.py class _BatchNorm (line 26) | class _BatchNorm(nn.Module): method __init__ (line 32) | def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=True, method reset_parameters (line 55) | def reset_parameters(self): method _check_input_dim (line 63) | def _check_input_dim(self, input): method forward (line 66) | def forward(self, input): method extra_repr (line 77) | def extra_repr(self): class BatchNorm2dNoSync (line 84) | class BatchNorm2dNoSync(_BatchNorm): method _check_input_dim (line 89) | def _check_input_dim(self, input): class BatchNorm2dSync (line 95) | class BatchNorm2dSync(BatchNorm2dNoSync): method __init__ (line 100) | def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=True, method forward (line 113) | def forward(self, x): method __repr__ (line 139) | def __repr__(self): FILE: XMem/inference/interact/fbrs/utils/misc.py function get_dims_with_exclusion (line 7) | def get_dims_with_exclusion(dim, exclude=None): function get_unique_labels (line 15) | def get_unique_labels(mask): function get_bbox_from_mask (line 19) | def get_bbox_from_mask(mask): function expand_bbox (line 28) | def expand_bbox(bbox, expand_ratio, min_crop_size=None): function clamp_bbox (line 46) | def clamp_bbox(bbox, rmin, rmax, cmin, cmax): function get_bbox_iou (line 51) | def get_bbox_iou(b1, b2): function get_segments_iou (line 57) | def get_segments_iou(s1, s2): FILE: XMem/inference/interact/fbrs/utils/vis.py function visualize_instances (line 7) | def visualize_instances(imask, bg_color=255, function get_palette (line 26) | def get_palette(num_cls): function visualize_mask (line 43) | def visualize_mask(mask, num_cls): function visualize_proposals (line 50) | def visualize_proposals(proposals_info, point_color=(255, 0, 0), point_r... function draw_probmap (line 60) | def draw_probmap(x): function draw_points (line 64) | def draw_points(image, points, color, radius=3): function draw_instance_map (line 72) | def draw_instance_map(x, palette=None): function blend_mask (line 80) | def blend_mask(image, mask, alpha=0.6): function get_boundaries (line 89) | def get_boundaries(instances_masks, boundaries_width=1): function draw_with_blend_and_clicks (line 105) | def draw_with_blend_and_clicks(img, mask=None, alpha=0.6, clicks_list=No... FILE: XMem/inference/interact/fbrs_controller.py class FBRSController (line 6) | class FBRSController: method __init__ (line 7) | def __init__(self, checkpoint_path, device='cuda:0', max_size=800): method unanchor (line 33) | def unanchor(self): method interact (line 36) | def interact(self, image, x, y, is_positive): method undo (line 48) | def undo(self): FILE: XMem/inference/interact/gui.py class App (line 48) | class App(QWidget): method __init__ (line 49) | def __init__(self, net: XMem, method resizeEvent (line 387) | def resizeEvent(self, event): method console_push_text (line 390) | def console_push_text(self, text): method interaction_radio_clicked (line 394) | def interaction_radio_clicked(self, event): method load_current_image_mask (line 413) | def load_current_image_mask(self, no_mask=False): method load_current_torch_image_mask (line 425) | def load_current_torch_image_mask(self, no_mask=False): method compose_current_im (line 432) | def compose_current_im(self): method update_interact_vis (line 436) | def update_interact_vis(self): method update_minimap (line 457) | def update_minimap(self): method update_current_image_fast (line 471) | def update_current_image_fast(self): method show_current_frame (line 485) | def show_current_frame(self, fast=False): method pixel_pos_to_image_pos (line 497) | def pixel_pos_to_image_pos(self, x, y): method is_pos_out_of_bound (line 517) | def is_pos_out_of_bound(self, x, y): method get_scaled_pos (line 529) | def get_scaled_pos(self, x, y): method clear_visualization (line 537) | def clear_visualization(self): method reset_this_interaction (line 541) | def reset_this_interaction(self): method set_viz_mode (line 548) | def set_viz_mode(self): method save_current_mask (line 552) | def save_current_mask(self): method tl_slide (line 556) | def tl_slide(self): method brush_slide (line 569) | def brush_slide(self): method on_forward_propagation (line 579) | def on_forward_propagation(self): method on_backward_propagation (line 589) | def on_backward_propagation(self): method on_pause (line 599) | def on_pause(self): method on_propagation (line 608) | def on_propagation(self): method pause_propagation (line 647) | def pause_propagation(self): method on_commit (line 650) | def on_commit(self): method on_prev_frame (line 654) | def on_prev_frame(self): method on_next_frame (line 659) | def on_next_frame(self): method on_play_video_timer (line 664) | def on_play_video_timer(self): method on_play_video (line 670) | def on_play_video(self): method on_export_visualization (line 678) | def on_export_visualization(self): method on_object_dial_change (line 697) | def on_object_dial_change(self): method on_reset_mask (line 701) | def on_reset_mask(self): method on_zoom_plus (line 710) | def on_zoom_plus(self): method on_zoom_minus (line 715) | def on_zoom_minus(self): method set_navi_enable (line 720) | def set_navi_enable(self, boolean): method hit_number_key (line 729) | def hit_number_key(self, number): method clear_brush (line 742) | def clear_brush(self): method vis_brush (line 746) | def vis_brush(self, ex, ey): method on_mouse_press (line 752) | def on_mouse_press(self, event): method on_mouse_motion (line 803) | def on_mouse_motion(self, event): method update_interacted_mask (line 818) | def update_interacted_mask(self): method complete_interaction (line 825) | def complete_interaction(self): method on_mouse_release (line 830) | def on_mouse_release(self, event): method wheelEvent (line 856) | def wheelEvent(self, event): method update_gpu_usage (line 865) | def update_gpu_usage(self): method on_gpu_timer (line 884) | def on_gpu_timer(self): method update_memory_size (line 887) | def update_memory_size(self): method on_work_min_change (line 907) | def on_work_min_change(self): method on_work_max_change (line 912) | def on_work_max_change(self): method update_config (line 917) | def update_config(self): method on_clear_memory (line 927) | def on_clear_memory(self): method _open_file (line 936) | def _open_file(self, prompt): method on_import_mask (line 941) | def on_import_mask(self): method on_import_layer (line 969) | def on_import_layer(self): method _try_load_layer (line 976) | def _try_load_layer(self, file_name): method on_save_visualization_toggle (line 1000) | def on_save_visualization_toggle(self): FILE: XMem/inference/interact/gui_utils.py function create_parameter_box (line 5) | def create_parameter_box(min_val, max_val, text, step=1, callback=None): function create_gauge (line 26) | def create_gauge(text): function apply_to_all_children_widget (line 43) | def apply_to_all_children_widget(layout, func): FILE: XMem/inference/interact/interaction.py function aggregate_sbg (line 18) | def aggregate_sbg(prob, keep_bg=False, hard=False): function aggregate_wbg (line 36) | def aggregate_wbg(prob, keep_bg=False, hard=False): class Interaction (line 53) | class Interaction: method __init__ (line 54) | def __init__(self, image, prev_mask, true_size, controller): method predict (line 65) | def predict(self): class FreeInteraction (line 69) | class FreeInteraction(Interaction): method __init__ (line 70) | def __init__(self, image, prev_mask, true_size, num_objects): method set_size (line 83) | def set_size(self, size): method push_point (line 90) | def push_point(self, x, y, k, vis=None): method end_path (line 123) | def end_path(self): method predict (line 127) | def predict(self): class ScribbleInteraction (line 134) | class ScribbleInteraction(Interaction): method __init__ (line 135) | def __init__(self, image, prev_mask, true_size, controller, num_objects): method push_point (line 153) | def push_point(self, x, y, k, vis=None): method end_path (line 187) | def end_path(self): method predict (line 191) | def predict(self): class ClickInteraction (line 197) | class ClickInteraction(Interaction): method __init__ (line 198) | def __init__(self, image, prev_mask, true_size, controller, tar_obj): method push_point (line 215) | def push_point(self, x, y, neg, vis=None): method predict (line 245) | def predict(self): FILE: XMem/inference/interact/interactive_utils.py function image_to_torch (line 10) | def image_to_torch(frame: np.ndarray, device='cuda'): function torch_prob_to_numpy_mask (line 17) | def torch_prob_to_numpy_mask(prob): function index_numpy_to_one_hot_torch (line 22) | def index_numpy_to_one_hot_torch(mask, num_classes): function get_visualization (line 48) | def get_visualization(mode, image, mask, layer, target_object): function get_visualization_torch (line 66) | def get_visualization_torch(mode, image, prob, layer, target_object): function overlay_davis (line 84) | def overlay_davis(image, mask, alpha=0.5, fade=False): function overlay_popup (line 97) | def overlay_popup(image, mask, target_object): function overlay_layer (line 106) | def overlay_layer(image, mask, layer, target_object): function overlay_davis_torch (line 118) | def overlay_davis_torch(image, mask, alpha=0.5, fade=False): function overlay_popup_torch (line 138) | def overlay_popup_torch(image, mask, target_object): function overlay_layer_torch (line 159) | def overlay_layer_torch(image, prob, layer, target_object): FILE: XMem/inference/interact/resource_manager.py class LRU (line 18) | class LRU: method __init__ (line 19) | def __init__(self, func, maxsize=128): method __call__ (line 24) | def __call__(self, *args): method invalidate (line 35) | def invalidate(self, key): class ResourceManager (line 39) | class ResourceManager: method __init__ (line 40) | def __init__(self, config): method _extract_frames (line 103) | def _extract_frames(self, video): method _copy_resize_frames (line 124) | def _copy_resize_frames(self, images): method save_mask (line 141) | def save_mask(self, ti, mask): method save_visualization (line 151) | def save_visualization(self, ti, image): method _get_image_unbuffered (line 163) | def _get_image_unbuffered(self, ti): method _get_mask_unbuffered (line 171) | def _get_mask_unbuffered(self, ti): method read_external_image (line 183) | def read_external_image(self, file_name, size=None): method invalidate (line 193) | def invalidate(self, ti): method __len__ (line 197) | def __len__(self): method h (line 201) | def h(self): method w (line 205) | def w(self): FILE: XMem/inference/interact/s2m/_deeplab.py class DeepLabV3 (line 13) | class DeepLabV3(_SimpleSegmentationModel): class DeepLabHeadV3Plus (line 30) | class DeepLabHeadV3Plus(nn.Module): method __init__ (line 31) | def __init__(self, in_channels, low_level_channels, num_classes, aspp_... method forward (line 49) | def forward(self, feature): method _init_weight (line 55) | def _init_weight(self): class DeepLabHead (line 63) | class DeepLabHead(nn.Module): method __init__ (line 64) | def __init__(self, in_channels, num_classes, aspp_dilate=[12, 24, 36]): method forward (line 76) | def forward(self, feature): method _init_weight (line 79) | def _init_weight(self): class AtrousSeparableConvolution (line 87) | class AtrousSeparableConvolution(nn.Module): method __init__ (line 90) | def __init__(self, in_channels, out_channels, kernel_size, method forward (line 102) | def forward(self, x): method _init_weight (line 105) | def _init_weight(self): class ASPPConv (line 113) | class ASPPConv(nn.Sequential): method __init__ (line 114) | def __init__(self, in_channels, out_channels, dilation): class ASPPPooling (line 122) | class ASPPPooling(nn.Sequential): method __init__ (line 123) | def __init__(self, in_channels, out_channels): method forward (line 130) | def forward(self, x): class ASPP (line 135) | class ASPP(nn.Module): method __init__ (line 136) | def __init__(self, in_channels, atrous_rates): method forward (line 159) | def forward(self, x): function convert_to_separable_conv (line 168) | def convert_to_separable_conv(module): FILE: XMem/inference/interact/s2m/s2m_network.py function _segm_resnet (line 7) | def _segm_resnet(name, backbone_name, num_classes, output_stride, pretra... function _load_model (line 34) | def _load_model(arch_type, backbone, num_classes, output_stride, pretrai... function deeplabv3_resnet50 (line 44) | def deeplabv3_resnet50(num_classes=1, output_stride=16, pretrained_backb... function deeplabv3plus_resnet50 (line 56) | def deeplabv3plus_resnet50(num_classes=1, output_stride=16, pretrained_b... FILE: XMem/inference/interact/s2m/s2m_resnet.py function conv3x3 (line 17) | def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): function conv1x1 (line 23) | def conv1x1(in_planes, out_planes, stride=1): class Bottleneck (line 28) | class Bottleneck(nn.Module): method __init__ (line 31) | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, method forward (line 48) | def forward(self, x): class ResNet (line 71) | class ResNet(nn.Module): method __init__ (line 73) | def __init__(self, block, layers, num_classes=1000, zero_init_residual... method _make_layer (line 122) | def _make_layer(self, block, planes, blocks, stride=1, dilate=False): method forward (line 146) | def forward(self, x): function _resnet (line 164) | def _resnet(arch, block, layers, pretrained, progress, **kwargs): function resnet50 (line 173) | def resnet50(pretrained=False, progress=True, **kwargs): FILE: XMem/inference/interact/s2m/utils.py class _SimpleSegmentationModel (line 9) | class _SimpleSegmentationModel(nn.Module): method __init__ (line 10) | def __init__(self, backbone, classifier): method forward (line 15) | def forward(self, x): class IntermediateLayerGetter (line 23) | class IntermediateLayerGetter(nn.ModuleDict): method __init__ (line 54) | def __init__(self, model, return_layers): method forward (line 71) | def forward(self, x): FILE: XMem/inference/interact/s2m_controller.py class S2MController (line 8) | class S2MController: method __init__ (line 15) | def __init__(self, s2m_net:S2M, num_objects, ignore_class, device='cud... method interact (line 21) | def interact(self, image, prev_mask, scr_mask): FILE: XMem/inference/interact/timer.py class Timer (line 3) | class Timer: method __init__ (line 4) | def __init__(self): method start (line 8) | def start(self): method pause (line 14) | def pause(self): method count (line 19) | def count(self): method format (line 27) | def format(self): method __str__ (line 32) | def __str__(self): FILE: XMem/inference/kv_memory_store.py class KeyValueMemoryStore (line 4) | class KeyValueMemoryStore: method __init__ (line 18) | def __init__(self, count_usage: bool): method add (line 36) | def add(self, key, value, shrinkage, selection, objects: List[int]): method update_usage (line 92) | def update_usage(self, usage): method sieve_by_range (line 101) | def sieve_by_range(self, start: int, end: int, min_size: int): method remove_obsolete_features (line 135) | def remove_obsolete_features(self, max_size: int): method get_usage (line 158) | def get_usage(self): method get_all_sliced (line 166) | def get_all_sliced(self, start: int, end: int): method get_v_size (line 183) | def get_v_size(self, ni: int): method engaged (line 186) | def engaged(self): method size (line 190) | def size(self): method num_groups (line 197) | def num_groups(self): method key (line 201) | def key(self): method value (line 205) | def value(self): method shrinkage (line 209) | def shrinkage(self): method selection (line 213) | def selection(self): FILE: XMem/inference/memory_manager.py class MemoryManager (line 8) | class MemoryManager: method __init__ (line 12) | def __init__(self, config): method update_config (line 38) | def update_config(self, config): method _readout (line 53) | def _readout(self, affinity, v): method match_memory (line 57) | def match_memory(self, query_key, selection): method add_memory (line 152) | def add_memory(self, key, shrinkage, value, objects, selection=None): method create_hidden_state (line 192) | def create_hidden_state(self, n, sample_key): method set_hidden (line 205) | def set_hidden(self, hidden): method get_hidden (line 208) | def get_hidden(self): method compress_features (line 211) | def compress_features(self): method consolidation (line 243) | def consolidation(self, candidate_key, candidate_shrinkage, candidate_... FILE: XMem/merge_multi_scale.py function search_options (line 19) | def search_options(options, name): function process_vid (line 26) | def process_vid(vid): FILE: XMem/merge_results.py function merge (line 18) | def merge(obj): FILE: XMem/model/aggregate.py function aggregate (line 6) | def aggregate(prob, dim, return_logits=False): FILE: XMem/model/cbam.py class BasicConv (line 7) | class BasicConv(nn.Module): method __init__ (line 8) | def __init__(self, in_planes, out_planes, kernel_size, stride=1, paddi... method forward (line 13) | def forward(self, x): class Flatten (line 17) | class Flatten(nn.Module): method forward (line 18) | def forward(self, x): class ChannelGate (line 21) | class ChannelGate(nn.Module): method __init__ (line 22) | def __init__(self, gate_channels, reduction_ratio=16, pool_types=['avg... method forward (line 32) | def forward(self, x): class ChannelPool (line 50) | class ChannelPool(nn.Module): method forward (line 51) | def forward(self, x): class SpatialGate (line 54) | class SpatialGate(nn.Module): method __init__ (line 55) | def __init__(self): method forward (line 60) | def forward(self, x): class CBAM (line 66) | class CBAM(nn.Module): method __init__ (line 67) | def __init__(self, gate_channels, reduction_ratio=16, pool_types=['avg... method forward (line 73) | def forward(self, x): FILE: XMem/model/group_modules.py function interpolate_groups (line 15) | def interpolate_groups(g, ratio, mode, align_corners): function upsample_groups (line 22) | def upsample_groups(g, ratio=2, mode='bilinear', align_corners=False): function downsample_groups (line 25) | def downsample_groups(g, ratio=1/2, mode='area', align_corners=None): class GConv2D (line 29) | class GConv2D(nn.Conv2d): method forward (line 30) | def forward(self, g): class GroupResBlock (line 36) | class GroupResBlock(nn.Module): method __init__ (line 37) | def __init__(self, in_dim, out_dim): method forward (line 48) | def forward(self, g): class MainToGroupDistributor (line 58) | class MainToGroupDistributor(nn.Module): method __init__ (line 59) | def __init__(self, x_transform=None, method='cat', reverse_order=False): method forward (line 66) | def forward(self, x, g): FILE: XMem/model/losses.py function dice_loss (line 8) | def dice_loss(input_mask, cls_gt): class BootstrappedCE (line 23) | class BootstrappedCE(nn.Module): method __init__ (line 24) | def __init__(self, start_warm, end_warm, top_p=0.15): method forward (line 31) | def forward(self, input, target, it): class LossComputer (line 46) | class LossComputer: method __init__ (line 47) | def __init__(self, config): method compute (line 52) | def compute(self, data, num_objects, it): FILE: XMem/model/memory_util.py function get_similarity (line 7) | def get_similarity(mk, ms, qk, qe): function do_softmax (line 41) | def do_softmax(similarity, top_k: Optional[int]=None, inplace=False, ret... function get_affinity (line 67) | def get_affinity(mk, ms, qk, qe): function readout (line 73) | def readout(affinity, mv): FILE: XMem/model/modules.py class FeatureFusionBlock (line 22) | class FeatureFusionBlock(nn.Module): method __init__ (line 23) | def __init__(self, x_in_dim, g_in_dim, g_mid_dim, g_out_dim): method forward (line 31) | def forward(self, x, g): class HiddenUpdater (line 44) | class HiddenUpdater(nn.Module): method __init__ (line 46) | def __init__(self, g_dims, mid_dim, hidden_dim): method forward (line 58) | def forward(self, g, h): class HiddenReinforcer (line 77) | class HiddenReinforcer(nn.Module): method __init__ (line 79) | def __init__(self, g_dim, hidden_dim): method forward (line 86) | def forward(self, g, h): class ValueEncoder (line 102) | class ValueEncoder(nn.Module): method __init__ (line 103) | def __init__(self, value_dim, hidden_dim, single_object=False): method forward (line 124) | def forward(self, image, image_feat_f16, h, masks, others, is_deep_upd... class KeyEncoder (line 153) | class KeyEncoder(nn.Module): method __init__ (line 154) | def __init__(self): method forward (line 166) | def forward(self, f): class UpsampleBlock (line 178) | class UpsampleBlock(nn.Module): method __init__ (line 179) | def __init__(self, skip_dim, g_up_dim, g_out_dim, scale_factor=2): method forward (line 186) | def forward(self, skip_f, up_g): class KeyProjection (line 194) | class KeyProjection(nn.Module): method __init__ (line 195) | def __init__(self, in_dim, keydim): method forward (line 207) | def forward(self, x, need_s, need_e): class Decoder (line 214) | class Decoder(nn.Module): method __init__ (line 215) | def __init__(self, val_dim, hidden_dim): method forward (line 229) | def forward(self, f16, f8, f4, hidden_state, memory_readout, h_out=True): FILE: XMem/model/network.py class XMem (line 19) | class XMem(nn.Module): method __init__ (line 20) | def __init__(self, config, model_path=None, map_location=None): method encode_key (line 42) | def encode_key(self, frame, need_sk=True, need_ek=True): method encode_value (line 74) | def encode_value(self, frame, image_feat_f16, h16, masks, is_deep_upda... method read_memory (line 91) | def read_memory(self, query_key, query_selection, memory_key, method segment (line 109) | def segment(self, multi_scale_features, memory_readout, method forward (line 124) | def forward(self, mode, *args, **kwargs): method init_hyperparameters (line 137) | def init_hyperparameters(self, config, model_path=None, map_location=N... method load_weights (line 188) | def load_weights(self, src_dict, init_as_zero_if_needed=False): FILE: XMem/model/resnet.py function load_weights_add_extra_dim (line 14) | def load_weights_add_extra_dim(target, source_state, extra_dim=1): function conv3x3 (line 41) | def conv3x3(in_planes, out_planes, stride=1, dilation=1): class BasicBlock (line 46) | class BasicBlock(nn.Module): method __init__ (line 49) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati... method forward (line 59) | def forward(self, x): class Bottleneck (line 78) | class Bottleneck(nn.Module): method __init__ (line 81) | def __init__(self, inplanes, planes, stride=1, downsample=None, dilati... method forward (line 94) | def forward(self, x): class ResNet (line 117) | class ResNet(nn.Module): method __init__ (line 118) | def __init__(self, block, layers=(3, 4, 23, 3), extra_dim=0): method _make_layer (line 138) | def _make_layer(self, block, planes, blocks, stride=1, dilation=1): function resnet18 (line 154) | def resnet18(pretrained=True, extra_dim=0): function resnet50 (line 160) | def resnet50(pretrained=True, extra_dim=0): FILE: XMem/model/trainer.py class XMemTrainer (line 20) | class XMemTrainer: method __init__ (line 21) | def __init__(self, config, logger=None, save_path=None, local_rank=0, ... method do_pass (line 56) | def do_pass(self, data, it=0): method save_network (line 160) | def save_network(self, it): method save_checkpoint (line 170) | def save_checkpoint(self, it): method load_checkpoint (line 185) | def load_checkpoint(self, path): method load_network_in_memory (line 204) | def load_network_in_memory(self, src_dict): method load_network (line 208) | def load_network(self, path): method train (line 216) | def train(self): method val (line 223) | def val(self): method test (line 229) | def test(self): FILE: XMem/scripts/resize_youtube.py function resize_vid_jpeg (line 12) | def resize_vid_jpeg(inputs): function resize_vid_anno (line 28) | def resize_vid_anno(inputs): function resize_all (line 45) | def resize_all(in_path, out_path): FILE: XMem/tracking.py function run_eval (line 22) | def run_eval(meta_expression, temp_xmem_anno, final_xmem_anno, img_dir, ... function generate (line 29) | def generate(obj, temp_xmem_anno, final_xmem_anno): function prepare (line 56) | def prepare(args): function inference (line 90) | def inference(args): function main (line 112) | def main(): FILE: XMem/train.py function worker_init_fn (line 114) | def worker_init_fn(worker_id): function construct_loader (line 119) | def construct_loader(dataset): function renew_vos_loader (line 125) | def renew_vos_loader(max_skip, finetune=False): function renew_bl_loader (line 140) | def renew_bl_loader(max_skip, finetune=False): FILE: XMem/util/configuration.py function none_or_default (line 4) | def none_or_default(x, default): class Configuration (line 7) | class Configuration(): method parse (line 8) | def parse(self, unknown_arg_ok=False): method get_stage_parameters (line 113) | def get_stage_parameters(self, stage): method __getitem__ (line 128) | def __getitem__(self, key): method __setitem__ (line 131) | def __setitem__(self, key, value): method __str__ (line 134) | def __str__(self): FILE: XMem/util/image_saver.py function tensor_to_numpy (line 8) | def tensor_to_numpy(image): function tensor_to_np_float (line 12) | def tensor_to_np_float(image): function detach_to_cpu (line 16) | def detach_to_cpu(x): function transpose_np (line 19) | def transpose_np(x): function tensor_to_gray_im (line 22) | def tensor_to_gray_im(x): function tensor_to_im (line 28) | def tensor_to_im(x): function get_image_array (line 46) | def get_image_array(images, grid_shape, captions={}): function base_transform (line 81) | def base_transform(im, size): function im_transform (line 94) | def im_transform(im, size): function mask_transform (line 97) | def mask_transform(mask, size): function out_transform (line 100) | def out_transform(mask, size): function pool_pairs (line 103) | def pool_pairs(images, size, num_objects): FILE: XMem/util/load_subset.py function load_sub_davis (line 8) | def load_sub_davis(path='util/davis_subset.txt'): function load_sub_yv (line 13) | def load_sub_yv(path='util/yv_subset.txt'): FILE: XMem/util/log_integrator.py class Integrator (line 10) | class Integrator: method __init__ (line 11) | def __init__(self, logger, distributed=True, local_rank=0, world_size=1): method add_tensor (line 22) | def add_tensor(self, key, tensor): method add_dict (line 36) | def add_dict(self, tensor_dict): method add_hook (line 40) | def add_hook(self, hook): method reset_except_hooks (line 51) | def reset_except_hooks(self): method finalize (line 56) | def finalize(self, prefix, it, f=None): FILE: XMem/util/logger.py function tensor_to_numpy (line 12) | def tensor_to_numpy(image): function detach_to_cpu (line 16) | def detach_to_cpu(x): function fix_width_trunc (line 19) | def fix_width_trunc(x): class TensorboardLogger (line 22) | class TensorboardLogger: method __init__ (line 23) | def __init__(self, short_id, id, git_info): method log_scalar (line 47) | def log_scalar(self, tag, x, step): method log_metrics (line 53) | def log_metrics(self, l1_tag, l2_tag, val, step, f=None): method log_im (line 62) | def log_im(self, tag, x, step): method log_cv2 (line 71) | def log_cv2(self, tag, x, step): method log_seg (line 78) | def log_seg(self, tag, x, step): method log_gray (line 87) | def log_gray(self, tag, x, step): method log_string (line 95) | def log_string(self, tag, x): FILE: XMem/util/tensor_util.py function compute_tensor_iu (line 4) | def compute_tensor_iu(seg, gt): function compute_tensor_iou (line 10) | def compute_tensor_iou(seg, gt): function pad_divide_by (line 17) | def pad_divide_by(in_img, d): function unpad (line 34) | def unpad(img, pad): FILE: merge_lora_weights_and_save_hf_model.py function parse_args (line 24) | def parse_args(args): function main (line 54) | def main(args): FILE: model/VISA.py function dice_loss (line 18) | def dice_loss( function sigmoid_ce_loss (line 42) | def sigmoid_ce_loss( class VisaMetaModel (line 60) | class VisaMetaModel: method __init__ (line 61) | def __init__( method initialize_lisa_modules (line 77) | def initialize_lisa_modules(self, config): class VisaModel (line 102) | class VisaModel(VisaMetaModel, ChatUniViLlamaModel): method __init__ (line 103) | def __init__( class VISAForCausalLM (line 121) | class VISAForCausalLM(ChatUniViLlamaForCausalLM): method __init__ (line 122) | def __init__( method get_visual_embs (line 147) | def get_visual_embs(self, pixel_values: torch.FloatTensor): method forward (line 152) | def forward(self, **kwargs): method model_forward (line 157) | def model_forward( method evaluate (line 334) | def evaluate(self, *args, **kwargs): FILE: model/llava/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 17) | class Conversation: method get_prompt (line 31) | def get_prompt(self): method append_message (line 109) | def append_message(self, role, message): method get_images (line 112) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 171) | def to_gradio_chatbot(self): method copy (line 205) | def copy(self): method dict (line 217) | def dict(self): FILE: model/llava/mm_utils.py function load_image_from_base64 (line 11) | def load_image_from_base64(image): function process_images (line 15) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 19) | def tokenizer_image_token( function get_model_name_from_path (line 47) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 56) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 57) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 71) | def __call__( FILE: model/llava/model/apply_delta.py function apply_delta (line 13) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: model/llava/model/builder.py function load_pretrained_model (line 27) | def load_pretrained_model( FILE: model/llava/model/consolidate.py function consolidate_ckpt (line 13) | def consolidate_ckpt(src_path, dst_path): FILE: model/llava/model/language_model/llava_llama.py class LlavaConfig (line 28) | class LlavaConfig(LlamaConfig): class LlavaLlamaModel (line 32) | class LlavaLlamaModel(LlavaMetaModel, LlamaModel): method __init__ (line 35) | def __init__(self, config: LlamaConfig): class LlavaLlamaForCausalLM (line 39) | class LlavaLlamaForCausalLM(LlamaForCausalLM, LlavaMetaForCausalLM): method __init__ (line 42) | def __init__(self, config): method get_model (line 52) | def get_model(self): method forward (line 55) | def forward( method prepare_inputs_for_generation (line 137) | def prepare_inputs_for_generation( FILE: model/llava/model/language_model/llava_mpt.py class LlavaMPTConfig (line 29) | class LlavaMPTConfig(MPTConfig): class LlavaMPTModel (line 33) | class LlavaMPTModel(LlavaMetaModel, MPTModel): method __init__ (line 36) | def __init__(self, config: MPTConfig): method embed_tokens (line 40) | def embed_tokens(self, x): class LlavaMPTForCausalLM (line 44) | class LlavaMPTForCausalLM(MPTForCausalLM, LlavaMetaForCausalLM): method __init__ (line 48) | def __init__(self, config): method get_model (line 66) | def get_model(self): method _set_gradient_checkpointing (line 69) | def _set_gradient_checkpointing(self, module, value=False): method forward (line 73) | def forward( method prepare_inputs_for_generation (line 138) | def prepare_inputs_for_generation( FILE: model/llava/model/language_model/mpt/adapt_tokenizer.py function adapt_tokenizer_for_denoising (line 10) | def adapt_tokenizer_for_denoising(tokenizer: Tokenizer): class AutoTokenizerForMOD (line 30) | class AutoTokenizerForMOD(AutoTokenizer): method from_pretrained (line 42) | def from_pretrained(cls, *args, **kwargs): FILE: model/llava/model/language_model/mpt/attention.py function _reset_is_causal (line 15) | def _reset_is_causal( function scaled_multihead_dot_product_attention (line 28) | def scaled_multihead_dot_product_attention( function check_valid_inputs (line 103) | def check_valid_inputs(*tensors, valid_dtypes=[torch.float16, torch.bflo... function flash_attn_fn (line 115) | def flash_attn_fn( function triton_flash_attn_fn (line 190) | def triton_flash_attn_fn( class MultiheadAttention (line 261) | class MultiheadAttention(nn.Module): method __init__ (line 268) | def __init__( method forward (line 322) | def forward( class MultiQueryAttention (line 357) | class MultiQueryAttention(nn.Module): method __init__ (line 364) | def __init__( method forward (line 419) | def forward( function attn_bias_shape (line 457) | def attn_bias_shape( function build_attn_bias (line 474) | def build_attn_bias( function gen_slopes (line 497) | def gen_slopes(n_heads, alibi_bias_max=8, device=None): function build_alibi_bias (line 507) | def build_alibi_bias( FILE: model/llava/model/language_model/mpt/blocks.py class MPTMLP (line 11) | class MPTMLP(nn.Module): method __init__ (line 12) | def __init__( method forward (line 21) | def forward(self, x): class MPTBlock (line 25) | class MPTBlock(nn.Module): method __init__ (line 26) | def __init__( method forward (line 72) | def forward( FILE: model/llava/model/language_model/mpt/configuration_mpt.py class MPTConfig (line 30) | class MPTConfig(PretrainedConfig): method __init__ (line 33) | def __init__( method _set_config_defaults (line 134) | def _set_config_defaults(self, config, config_defaults): method _validate_config (line 140) | def _validate_config(self): FILE: model/llava/model/language_model/mpt/custom_embedding.py class SharedEmbedding (line 7) | class SharedEmbedding(nn.Embedding): method forward (line 8) | def forward(self, input: Tensor, unembed: bool = False) -> Tensor: FILE: model/llava/model/language_model/mpt/flash_attn_triton.py function _fwd_kernel (line 59) | def _fwd_kernel( function _bwd_preprocess_do_o_dot (line 271) | def _bwd_preprocess_do_o_dot( function _bwd_store_dk_dv (line 317) | def _bwd_store_dk_dv( function _bwd_kernel_one_col_block (line 350) | def _bwd_kernel_one_col_block( function init_to_zero (line 574) | def init_to_zero(name): function _bwd_kernel (line 609) | def _bwd_kernel( function _flash_attn_forward (line 751) | def _flash_attn_forward(q, k, v, bias=None, causal=False, softmax_scale=... function _flash_attn_backward (line 833) | def _flash_attn_backward( class FlashAttnQKVPackedFunc (line 938) | class FlashAttnQKVPackedFunc(torch.autograd.Function): method forward (line 940) | def forward(ctx, qkv, bias=None, causal=False, softmax_scale=None): method backward (line 962) | def backward(ctx, do): class FlashAttnKVPackedFunc (line 989) | class FlashAttnKVPackedFunc(torch.autograd.Function): method forward (line 991) | def forward(ctx, q, kv, bias=None, causal=False, softmax_scale=None): method backward (line 1013) | def backward(ctx, do): class FlashAttnFunc (line 1042) | class FlashAttnFunc(torch.autograd.Function): method forward (line 1044) | def forward(ctx, q, k, v, bias=None, causal=False, softmax_scale=None): method backward (line 1061) | def backward(ctx, do): FILE: model/llava/model/language_model/mpt/hf_prefixlm_converter.py function _convert_gpt_causal_lm_to_prefix_lm (line 45) | def _convert_gpt_causal_lm_to_prefix_lm(model: CAUSAL_GPT_TYPES) -> CAUS... function _convert_bloom_causal_lm_to_prefix_lm (line 183) | def _convert_bloom_causal_lm_to_prefix_lm(model: BloomForCausalLM) -> Bl... function _convert_opt_causal_lm_to_prefix_lm (line 531) | def _convert_opt_causal_lm_to_prefix_lm(model: OPTForCausalLM) -> OPTFor... function convert_hf_causal_lm_to_prefix_lm (line 661) | def convert_hf_causal_lm_to_prefix_lm(model: CAUSAL_LM_TYPES) -> CAUSAL_... function add_bidirectional_mask_if_missing (line 732) | def add_bidirectional_mask_if_missing(batch: Dict[str, Any]): FILE: model/llava/model/language_model/mpt/meta_init_context.py function init_empty_weights (line 8) | def init_empty_weights(include_buffers: bool = False): function init_on_device (line 40) | def init_on_device(device: torch.device, include_buffers: bool = False): FILE: model/llava/model/language_model/mpt/modeling_mpt.py class MPTPreTrainedModel (line 35) | class MPTPreTrainedModel(PreTrainedModel): class MPTModel (line 41) | class MPTModel(MPTPreTrainedModel): method __init__ (line 42) | def __init__(self, config: MPTConfig): method get_input_embeddings (line 109) | def get_input_embeddings(self): method set_input_embeddings (line 112) | def set_input_embeddings(self, value): method _attn_bias (line 116) | def _attn_bias( method _apply_prefix_mask (line 169) | def _apply_prefix_mask(self, attn_bias: torch.Tensor, prefix_mask: tor... method _apply_sequence_id (line 192) | def _apply_sequence_id( method forward (line 208) | def forward( method param_init_fn (line 361) | def param_init_fn(self, module): method fsdp_wrap_fn (line 370) | def fsdp_wrap_fn(self, module): method activation_checkpointing_fn (line 373) | def activation_checkpointing_fn(self, module): class MPTForCausalLM (line 377) | class MPTForCausalLM(MPTPreTrainedModel): method __init__ (line 378) | def __init__(self, config: MPTConfig): method get_input_embeddings (line 401) | def get_input_embeddings(self): method set_input_embeddings (line 404) | def set_input_embeddings(self, value): method get_output_embeddings (line 407) | def get_output_embeddings(self): method set_output_embeddings (line 410) | def set_output_embeddings(self, new_embeddings): method set_decoder (line 413) | def set_decoder(self, decoder): method get_decoder (line 416) | def get_decoder(self): method forward (line 419) | def forward( method param_init_fn (line 476) | def param_init_fn(self, module): method fsdp_wrap_fn (line 485) | def fsdp_wrap_fn(self, module): method activation_checkpointing_fn (line 488) | def activation_checkpointing_fn(self, module): method prepare_inputs_for_generation (line 491) | def prepare_inputs_for_generation( method _reorder_cache (line 525) | def _reorder_cache(past_key_values, beam_idx): FILE: model/llava/model/language_model/mpt/norm.py function _cast_if_autocast_enabled (line 4) | def _cast_if_autocast_enabled(tensor): class LPLayerNorm (line 16) | class LPLayerNorm(torch.nn.LayerNorm): method __init__ (line 17) | def __init__( method forward (line 33) | def forward(self, x): function rms_norm (line 54) | def rms_norm(x, weight=None, eps=1e-05): class RMSNorm (line 61) | class RMSNorm(torch.nn.Module): method __init__ (line 62) | def __init__( method forward (line 74) | def forward(self, x): class LPRMSNorm (line 78) | class LPRMSNorm(RMSNorm): method __init__ (line 79) | def __init__( method forward (line 90) | def forward(self, x): FILE: model/llava/model/language_model/mpt/param_init_fns.py function torch_default_param_init_fn_ (line 13) | def torch_default_param_init_fn_(module: nn.Module, verbose: int = 0, **... function fused_init_helper_ (line 21) | def fused_init_helper_(module: nn.Module, init_fn_): function generic_param_init_fn_ (line 33) | def generic_param_init_fn_( function _normal_init_ (line 164) | def _normal_init_(std, mean=0.0): function _normal_param_init_fn_ (line 168) | def _normal_param_init_fn_( function baseline_param_init_fn_ (line 195) | def baseline_param_init_fn_( function small_param_init_fn_ (line 223) | def small_param_init_fn_( function neox_param_init_fn_ (line 247) | def neox_param_init_fn_( function kaiming_uniform_param_init_fn_ (line 277) | def kaiming_uniform_param_init_fn_( function kaiming_normal_param_init_fn_ (line 314) | def kaiming_normal_param_init_fn_( function xavier_uniform_param_init_fn_ (line 351) | def xavier_uniform_param_init_fn_( function xavier_normal_param_init_fn_ (line 381) | def xavier_normal_param_init_fn_( FILE: model/llava/model/llava_arch.py class LlavaMetaModel (line 29) | class LlavaMetaModel: method __init__ (line 30) | def __init__(self, config): method get_vision_tower (line 37) | def get_vision_tower(self): method initialize_vision_modules (line 43) | def initialize_vision_modules(self, model_args, fsdp=None): class LlavaMetaForCausalLM (line 85) | class LlavaMetaForCausalLM(ABC): method get_model (line 87) | def get_model(self): method get_vision_tower (line 90) | def get_vision_tower(self): method encode_images (line 93) | def encode_images(self, images): method prepare_inputs_labels_for_multimodal (line 98) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 350) | def initialize_vision_tokenizer(self, model_args, num_new_tokens): FILE: model/llava/model/make_delta.py function make_delta (line 13) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: model/llava/model/multimodal_encoder/builder.py function build_vision_tower (line 4) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: model/llava/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 6) | class CLIPVisionTower(nn.Module): method __init__ (line 7) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 21) | def load_model(self): method feature_select (line 31) | def feature_select(self, image_forward_outs): method forward (line 42) | def forward(self, images): method dummy_feature (line 63) | def dummy_feature(self): method dtype (line 67) | def dtype(self): method device (line 71) | def device(self): method config (line 75) | def config(self): method hidden_size (line 82) | def hidden_size(self): method num_patches (line 86) | def num_patches(self): FILE: model/llava/model/utils.py function auto_upgrade (line 4) | def auto_upgrade(config): FILE: model/llava/train/llama_flash_attn_monkey_patch.py function forward (line 21) | def forward( function _prepare_decoder_attention_mask (line 109) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 116) | def replace_llama_attn_with_flash_attn(): FILE: model/llava/train/llava_trainer.py function maybe_zero_3 (line 8) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 23) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): class LLaVATrainer (line 36) | class LLaVATrainer(Trainer): method _save_checkpoint (line 37) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 63) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: model/llava/train/train.py function rank0_print (line 40) | def rank0_print(*args): class ModelArguments (line 46) | class ModelArguments: class DataArguments (line 62) | class DataArguments: class TrainingArguments (line 74) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 107) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 125) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 150) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 160) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 172) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 185) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, output... function smart_tokenizer_and_embedding_resize (line 227) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 254) | def _tokenize_fn( function _mask_targets (line 281) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 292) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 314) | def preprocess_multimodal(sources: Sequence[str], data_args: DataArgumen... function preprocess_llama_2 (line 344) | def preprocess_llama_2( function preprocess_v1 (line 430) | def preprocess_v1( function preprocess_mpt (line 516) | def preprocess_mpt( function preprocess_plain (line 592) | def preprocess_plain( function preprocess (line 621) | def preprocess( class LazySupervisedDataset (line 681) | class LazySupervisedDataset(Dataset): method __init__ (line 684) | def __init__( method __len__ (line 698) | def __len__(self): method __getitem__ (line 701) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 764) | class DataCollatorForSupervisedDataset(object): method __call__ (line 769) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 797) | def make_supervised_data_module( function train (line 810) | def train(): FILE: model/llava/utils.py function build_logger (line 20) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 64) | class StreamToLogger(object): method __init__ (line 69) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 75) | def __getattr__(self, attr): method write (line 78) | def write(self, buf): method flush (line 92) | def flush(self): function disable_torch_init (line 98) | def disable_torch_init(): function violates_moderation (line 108) | def violates_moderation(text): function pretty_print_semaphore (line 131) | def pretty_print_semaphore(semaphore): FILE: model/segment_anything/automatic_mask_generator.py class SamAutomaticMaskGenerator (line 24) | class SamAutomaticMaskGenerator: method __init__ (line 25) | def __init__( method generate (line 127) | def generate(self, image: np.ndarray) -> List[Dict[str, Any]]: method _generate_masks (line 189) | def _generate_masks(self, image: np.ndarray) -> MaskData: method _process_crop (line 217) | def _process_crop( method _process_batch (line 260) | def _process_batch( method postprocess_small_regions (line 324) | def postprocess_small_regions( FILE: model/segment_anything/build_sam.py function build_sam_vit_h (line 15) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 28) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 38) | def build_sam_vit_b(checkpoint=None): function _build_sam (line 56) | def _build_sam( FILE: model/segment_anything/modeling/common.py class MLPBlock (line 13) | class MLPBlock(nn.Module): method __init__ (line 14) | def __init__( method forward (line 25) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 31) | class LayerNorm2d(nn.Module): method __init__ (line 32) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 38) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: model/segment_anything/modeling/image_encoder.py class ImageEncoderViT (line 17) | class ImageEncoderViT(nn.Module): method __init__ (line 18) | def __init__( method forward (line 110) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 128) | class Block(nn.Module): method __init__ (line 131) | def __init__( method forward (line 177) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 196) | class Attention(nn.Module): method __init__ (line 199) | def __init__( method forward (line 235) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 263) | def window_partition( function window_unpartition (line 291) | def window_unpartition( function get_rel_pos (line 321) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 354) | def add_decomposed_rel_pos( class PatchEmbed (line 395) | class PatchEmbed(nn.Module): method __init__ (line 400) | def __init__( method forward (line 422) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: model/segment_anything/modeling/mask_decoder.py class MaskDecoder (line 16) | class MaskDecoder(nn.Module): method __init__ (line 17) | def __init__( method forward (line 75) | def forward( method predict_masks (line 116) | def predict_masks( method forward_modified_v3 (line 167) | def forward_modified_v3( class MLP (line 209) | class MLP(nn.Module): method __init__ (line 210) | def __init__( method forward (line 226) | def forward(self, x): FILE: model/segment_anything/modeling/prompt_encoder.py class PromptEncoder (line 16) | class PromptEncoder(nn.Module): method __init__ (line 17) | def __init__( method get_dense_pe (line 67) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 78) | def _embed_points( method _embed_boxes (line 100) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 111) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 116) | def _get_batch_size( method _get_device (line 137) | def _get_device(self) -> torch.device: method forward (line 140) | def forward( class PositionEmbeddingRandom (line 189) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 194) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 203) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 216) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 231) | def forward_with_coords( FILE: model/segment_anything/modeling/sam.py class Sam (line 18) | class Sam(nn.Module): method __init__ (line 22) | def __init__( method device (line 52) | def device(self) -> Any: method forward (line 56) | def forward( method postprocess_masks (line 137) | def postprocess_masks( method preprocess (line 174) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: model/segment_anything/modeling/transformer.py class TwoWayTransformer (line 16) | class TwoWayTransformer(nn.Module): method __init__ (line 17) | def __init__( method forward (line 62) | def forward( class TwoWayAttentionBlock (line 109) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 110) | def __init__( method forward (line 151) | def forward( class Attention (line 185) | class Attention(nn.Module): method __init__ (line 191) | def __init__( method _separate_heads (line 210) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 215) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 220) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: model/segment_anything/predictor.py class SamPredictor (line 16) | class SamPredictor: method __init__ (line 17) | def __init__( method set_image (line 33) | def set_image( method set_torch_image (line 64) | def set_torch_image( method predict (line 93) | def predict( method predict_torch (line 178) | def predict_torch( method get_image_embedding (line 258) | def get_image_embedding(self) -> torch.Tensor: method device (line 274) | def device(self) -> torch.device: method reset_image (line 277) | def reset_image(self) -> None: FILE: model/segment_anything/utils/amg.py class MaskData (line 16) | class MaskData: method __init__ (line 22) | def __init__(self, **kwargs) -> None: method __setitem__ (line 29) | def __setitem__(self, key: str, item: Any) -> None: method __delitem__ (line 35) | def __delitem__(self, key: str) -> None: method __getitem__ (line 38) | def __getitem__(self, key: str) -> Any: method items (line 41) | def items(self) -> ItemsView[str, Any]: method filter (line 44) | def filter(self, keep: torch.Tensor) -> None: method cat (line 59) | def cat(self, new_stats: "MaskData") -> None: method to_numpy (line 72) | def to_numpy(self) -> None: function is_box_near_crop_edge (line 78) | def is_box_near_crop_edge( function box_xyxy_to_xywh (line 91) | def box_xyxy_to_xywh(box_xyxy: torch.Tensor) -> torch.Tensor: function batch_iterator (line 98) | def batch_iterator(batch_size: int, *args) -> Generator[List[Any], None,... function mask_to_rle_pytorch (line 107) | def mask_to_rle_pytorch(tensor: torch.Tensor) -> List[Dict[str, Any]]: function rle_to_mask (line 138) | def rle_to_mask(rle: Dict[str, Any]) -> np.ndarray: function area_from_rle (line 152) | def area_from_rle(rle: Dict[str, Any]) -> int: function calculate_stability_score (line 156) | def calculate_stability_score( function build_point_grid (line 179) | def build_point_grid(n_per_side: int) -> np.ndarray: function build_all_layer_point_grids (line 189) | def build_all_layer_point_grids( function generate_crop_boxes (line 200) | def generate_crop_boxes( function uncrop_boxes_xyxy (line 237) | def uncrop_boxes_xyxy(boxes: torch.Tensor, crop_box: List[int]) -> torch... function uncrop_points (line 246) | def uncrop_points(points: torch.Tensor, crop_box: List[int]) -> torch.Te... function uncrop_masks (line 255) | def uncrop_masks( function remove_small_regions (line 267) | def remove_small_regions( function coco_encode_rle (line 294) | def coco_encode_rle(uncompressed_rle: Dict[str, Any]) -> Dict[str, Any]: function batched_mask_to_box (line 303) | def batched_mask_to_box(masks: torch.Tensor) -> torch.Tensor: FILE: model/segment_anything/utils/onnx.py class SamOnnxModel (line 17) | class SamOnnxModel(nn.Module): method __init__ (line 25) | def __init__( method resize_longest_image_size (line 42) | def resize_longest_image_size( method _embed_points (line 51) | def _embed_points( method _embed_masks (line 74) | def _embed_masks( method mask_postprocessing (line 85) | def mask_postprocessing( method select_masks (line 105) | def select_masks( method forward (line 121) | def forward( FILE: model/segment_anything/utils/transforms.py class ResizeLongestSide (line 17) | class ResizeLongestSide: method __init__ (line 24) | def __init__(self, target_length: int) -> None: method apply_image (line 27) | def apply_image(self, image: np.ndarray) -> np.ndarray: method apply_coords (line 36) | def apply_coords( method apply_boxes (line 52) | def apply_boxes( method apply_image_torch (line 62) | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: method apply_coords_torch (line 76) | def apply_coords_torch( method apply_boxes_torch (line 92) | def apply_boxes_torch( method get_preprocess_shape (line 103) | def get_preprocess_shape( FILE: model/tf/modeling_outputs.py class CausalLMOutputWithPastAndLabel (line 8) | class CausalLMOutputWithPastAndLabel(ModelOutput): FILE: model/univi/conversation.py class SeparatorStyle (line 6) | class SeparatorStyle(Enum): class Conversation (line 16) | class Conversation: method get_prompt (line 29) | def get_prompt(self): method append_message (line 106) | def append_message(self, role, message): method get_images (line 109) | def get_images(self, return_pil=False): method to_gradio_chatbot (line 158) | def to_gradio_chatbot(self): method copy (line 191) | def copy(self): method dict (line 202) | def dict(self): FILE: model/univi/demo.py class Chat (line 13) | class Chat: method __init__ (line 14) | def __init__(self, model_path, conv_mode="simple"): method get_prompt (line 34) | def get_prompt(self, qs, state): method _get_rawvideo_dec (line 39) | def _get_rawvideo_dec(self, video_path, image_processor, max_frames=MA... method generate (line 77) | def generate(self, images_tensor: list, prompt: str, first_run: bool, ... FILE: model/univi/eval/evaluate/evaluate_benchmark_1_correctness.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 84) | def main(): FILE: model/univi/eval/evaluate/evaluate_benchmark_2_detailed_orientation.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 84) | def main(): FILE: model/univi/eval/evaluate/evaluate_benchmark_3_context.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 84) | def main(): FILE: model/univi/eval/evaluate/evaluate_benchmark_4_temporal.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 83) | def main(): FILE: model/univi/eval/evaluate/evaluate_benchmark_5_consistency.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 89) | def main(): FILE: model/univi/eval/evaluate/evaluate_gpt_review_visual.py function get_eval (line 11) | def get_eval(content: str, max_tokens: int): function parse_score (line 36) | def parse_score(review): FILE: model/univi/eval/evaluate/evaluate_science_qa.py function get_args (line 9) | def get_args(): function convert_caps (line 20) | def convert_caps(results): function get_pred_idx (line 29) | def get_pred_idx(prediction, choices, options): FILE: model/univi/eval/evaluate/evaluate_video_qa.py function read_jsonl (line 10) | def read_jsonl(file): function parse_args (line 18) | def parse_args(): function annotate (line 29) | def annotate(prediction_set, caption_files, output_dir): function main (line 83) | def main(): FILE: model/univi/eval/evaluate/summarize_gpt_review.py function parse_args (line 8) | def parse_args(): FILE: model/univi/eval/model_coco_vqa.py function get_acc (line 19) | def get_acc(file): function split_list (line 61) | def split_list(lst, n): function get_chunk (line 67) | def get_chunk(lst, n, k): class LogitsProcessor (line 72) | class LogitsProcessor(ABC): method __call__ (line 74) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... function eval_model (line 81) | def eval_model(args): FILE: model/univi/eval/model_video_consistency.py function split_list (line 18) | def split_list(lst, n): function get_chunk (line 24) | def get_chunk(lst, n, k): function _get_rawvideo_dec (line 29) | def _get_rawvideo_dec(video_path, image_processor, max_frames=MAX_IMAGE_... function eval_model (line 90) | def eval_model(args): FILE: model/univi/eval/model_video_general.py function split_list (line 18) | def split_list(lst, n): function get_chunk (line 24) | def get_chunk(lst, n, k): function _get_rawvideo_dec (line 29) | def _get_rawvideo_dec(video_path, image_processor, max_frames=MAX_IMAGE_... function eval_model (line 90) | def eval_model(args): FILE: model/univi/eval/model_video_qa.py function read_json (line 18) | def read_json(file): function split_list (line 23) | def split_list(lst, n): function get_chunk (line 29) | def get_chunk(lst, n, k): function _get_rawvideo_dec (line 34) | def _get_rawvideo_dec(video_path, image_processor, max_frames=MAX_IMAGE_... function eval_model (line 95) | def eval_model(args): FILE: model/univi/eval/model_vqa.py function split_list (line 16) | def split_list(lst, n): function get_chunk (line 22) | def get_chunk(lst, n, k): function eval_model (line 27) | def eval_model(args): FILE: model/univi/eval/model_vqa_scienceqa.py function split_list (line 19) | def split_list(lst, n): function get_chunk (line 25) | def get_chunk(lst, n, k): function eval_model (line 30) | def eval_model(args): FILE: model/univi/mm_utils.py function load_image_from_base64 (line 10) | def load_image_from_base64(image): function process_images (line 14) | def process_images(images, image_processor, model_cfg): function tokenizer_image_token (line 18) | def tokenizer_image_token(prompt, tokenizer, image_token_index=IMAGE_TOK... function get_model_name_from_path (line 41) | def get_model_name_from_path(model_path): class KeywordsStoppingCriteria (line 50) | class KeywordsStoppingCriteria(StoppingCriteria): method __init__ (line 51) | def __init__(self, keywords, tokenizer, input_ids): method __call__ (line 62) | def __call__(self, output_ids: torch.LongTensor, scores: torch.FloatTe... FILE: model/univi/model/apply_delta.py function apply_delta (line 9) | def apply_delta(base_model_path, target_model_path, delta_path): FILE: model/univi/model/arch.py class MetaModel (line 10) | class MetaModel: method __init__ (line 11) | def __init__(self, config): method get_vision_tower (line 35) | def get_vision_tower(self): method initialize_vision_modules (line 41) | def initialize_vision_modules(self, model_args, fsdp=None): method initialize_cluster_modules (line 71) | def initialize_cluster_modules(self, model_args): class ChatUniViMetaForCausalLM (line 88) | class ChatUniViMetaForCausalLM(ABC): method get_model (line 90) | def get_model(self): method get_vision_tower (line 93) | def get_vision_tower(self): method encode_images (line 96) | def encode_images(self, images): method positional_encoding (line 100) | def positional_encoding(self, x, num_features=1024, max_len=64): method project (line 110) | def project(self, image_features, input_type="image"): method prepare_inputs_labels_for_multimodal (line 219) | def prepare_inputs_labels_for_multimodal( method initialize_vision_tokenizer (line 340) | def initialize_vision_tokenizer(self, model_args, tokenizer): FILE: model/univi/model/builder.py function load_pretrained_model (line 11) | def load_pretrained_model(model_path, model_base, model_name, load_8bit=... FILE: model/univi/model/cluster.py function _no_grad_trunc_normal_ (line 7) | def _no_grad_trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 43) | def trunc_normal_(tensor, mean=0., std=1., a=-2., b=2.): function drop_path (line 67) | def drop_path(x, drop_prob: float = 0., training: bool = False): class DropPath (line 80) | class DropPath(nn.Module): method __init__ (line 83) | def __init__(self, drop_prob=None): method forward (line 87) | def forward(self, x): function index_points (line 91) | def index_points(points, idx): function cluster_dpc_knn (line 111) | def cluster_dpc_knn(token_dict, cluster_num, k=5, token_mask=None): function merge_tokens (line 174) | def merge_tokens(token_dict, idx_cluster, cluster_num, token_weight=None): class CTM (line 226) | class CTM(nn.Module): method __init__ (line 227) | def __init__(self, sample_ratio, embed_dim, dim_out, k=5): method forward (line 233) | def forward(self, token_dict, sample_ratio=None): class TCBlock (line 259) | class TCBlock(nn.Module): method __init__ (line 260) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=True, qk_sca... method _init_weights (line 265) | def _init_weights(self, m): method forward (line 280) | def forward(self, inputs): FILE: model/univi/model/consolidate.py function consolidate_ckpt (line 13) | def consolidate_ckpt(src_path, dst_path): FILE: model/univi/model/dataloader.py function _get_rawvideo_dec (line 9) | def _get_rawvideo_dec(video_path, image_processor, max_frames=64, image_... FILE: model/univi/model/language_model/llama.py class ChatUniViConfig (line 12) | class ChatUniViConfig(LlamaConfig): class ChatUniViLlamaModel (line 16) | class ChatUniViLlamaModel(MetaModel, LlamaModel): method __init__ (line 19) | def __init__(self, config: LlamaConfig): class ChatUniViLlamaForCausalLM (line 23) | class ChatUniViLlamaForCausalLM(LlamaForCausalLM, ChatUniViMetaForCausal... method __init__ (line 26) | def __init__(self, config): method get_model (line 33) | def get_model(self): method forward (line 36) | def forward( method prepare_inputs_for_generation (line 113) | def prepare_inputs_for_generation( FILE: model/univi/model/make_delta.py function make_delta (line 13) | def make_delta(base_model_path, target_model_path, delta_path, hub_repo_... FILE: model/univi/model/multimodal_encoder/builder.py function build_vision_tower (line 5) | def build_vision_tower(vision_tower_cfg, **kwargs): FILE: model/univi/model/multimodal_encoder/clip_encoder.py class CLIPVisionTower (line 7) | class CLIPVisionTower(nn.Module): method __init__ (line 8) | def __init__(self, vision_tower, args=None, delay_load=False): method load_model (line 26) | def load_model(self): method feature_select (line 34) | def feature_select(self, image_forward_outs, select_feature='patch'): method forward (line 45) | def forward(self, images, select_feature='patch'): method dummy_feature (line 59) | def dummy_feature(self): method dtype (line 63) | def dtype(self): method device (line 67) | def device(self): method config (line 71) | def config(self): method hidden_size (line 78) | def hidden_size(self): method num_patches (line 82) | def num_patches(self): FILE: model/univi/model/multimodal_encoder/eva_encoder.py class EVAVisionTower (line 7) | class EVAVisionTower(nn.Module): method __init__ (line 8) | def __init__(self, vision_tower, args, delay_load=False): method load_model (line 22) | def load_model(self): method feature_select (line 32) | def feature_select(self, image_forward_outs, select_feature='patch'): method forward (line 43) | def forward(self, images, select_feature='patch'): method dummy_feature (line 57) | def dummy_feature(self): method dtype (line 61) | def dtype(self): method device (line 65) | def device(self): method config (line 69) | def config(self): method hidden_size (line 76) | def hidden_size(self): method num_patches (line 80) | def num_patches(self): FILE: model/univi/model/multimodal_encoder/eva_vit.py function _cfg (line 21) | def _cfg(url='', **kwargs): class DropPath (line 31) | class DropPath(nn.Module): method __init__ (line 35) | def __init__(self, drop_prob=None): method forward (line 39) | def forward(self, x): method extra_repr (line 42) | def extra_repr(self) -> str: class Mlp (line 46) | class Mlp(nn.Module): method __init__ (line 47) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 56) | def forward(self, x): class Attention (line 66) | class Attention(nn.Module): method __init__ (line 67) | def __init__( method forward (line 120) | def forward(self, x, rel_pos_bias=None): class Block (line 153) | class Block(nn.Module): method __init__ (line 155) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 175) | def forward(self, x, rel_pos_bias=None): class PatchEmbed (line 185) | class PatchEmbed(nn.Module): method __init__ (line 189) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 201) | def forward(self, x, **kwargs): class RelativePositionBias (line 210) | class RelativePositionBias(nn.Module): method __init__ (line 212) | def __init__(self, window_size, num_heads): method forward (line 241) | def forward(self): class VisionTransformer (line 249) | class VisionTransformer(nn.Module): method __init__ (line 253) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method fix_init_weight (line 305) | def fix_init_weight(self): method _init_weights (line 313) | def _init_weights(self, m): method get_classifier (line 322) | def get_classifier(self): method reset_classifier (line 325) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 329) | def forward_features(self, x): method forward (line 355) | def forward(self, x): method get_intermediate_layers (line 360) | def get_intermediate_layers(self, x): function interpolate_pos_embed (line 379) | def interpolate_pos_embed(model, checkpoint_model): function convert_weights_to_fp16 (line 403) | def convert_weights_to_fp16(model: nn.Module): function create_eva_vit_g (line 421) | def create_eva_vit_g(img_size=224, drop_path_rate=0.4, use_checkpoint=Fa... FILE: model/univi/model/multimodal_encoder/processor.py class BaseProcessor (line 6) | class BaseProcessor: method __init__ (line 7) | def __init__(self, mean=None, std=None): class ImageTrainProcessor (line 16) | class ImageTrainProcessor(BaseProcessor): method __init__ (line 17) | def __init__(self, image_size=224, mean=None, std=None, min_scale=0.5,... method preprocess (line 30) | def preprocess(self, item, return_tensors): class ImageEvalProcessor (line 34) | class ImageEvalProcessor(BaseProcessor): method __init__ (line 35) | def __init__(self, image_size=224, mean=None, std=None): method preprocess (line 48) | def preprocess(self, item, return_tensors): class QWenImageProcessor (line 52) | class QWenImageProcessor(BaseProcessor): method __init__ (line 53) | def __init__(self, image_size=224, mean=None, std=None): method preprocess (line 67) | def preprocess(self, item, return_tensors): FILE: model/univi/model/multimodal_encoder/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: model/univi/train/llama_flash_attn_monkey_patch.py function forward (line 19) | def forward( function _prepare_decoder_attention_mask (line 107) | def _prepare_decoder_attention_mask( function replace_llama_attn_with_flash_attn (line 114) | def replace_llama_attn_with_flash_attn(): FILE: model/univi/train/train.py function rank0_print (line 42) | def rank0_print(*args): class ModelArguments (line 48) | class ModelArguments: class DataArguments (line 64) | class DataArguments: class TrainingArguments (line 73) | class TrainingArguments(transformers.TrainingArguments): function maybe_zero_3 (line 108) | def maybe_zero_3(param, ignore_status=False, name=None): function get_peft_state_maybe_zero_3 (line 123) | def get_peft_state_maybe_zero_3(named_params, bias): function get_peft_state_non_lora_maybe_zero_3 (line 148) | def get_peft_state_non_lora_maybe_zero_3(named_params, require_grad_only... function get_mm_adapter_state_maybe_zero_3 (line 156) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): function find_all_linear_names (line 162) | def find_all_linear_names(model): function safe_save_model_for_hf_trainer (line 176) | def safe_save_model_for_hf_trainer(trainer: transformers.Trainer, function smart_tokenizer_and_embedding_resize (line 214) | def smart_tokenizer_and_embedding_resize( function _tokenize_fn (line 239) | def _tokenize_fn(strings: Sequence[str], function _mask_targets (line 266) | def _mask_targets(target, tokenized_lens, speakers): function _add_speaker_and_signal (line 277) | def _add_speaker_and_signal(header, source, get_conversation=True): function preprocess_multimodal (line 298) | def preprocess_multimodal( function preprocess_llama_2 (line 338) | def preprocess_llama_2( function preprocess_v1 (line 426) | def preprocess_v1( function preprocess_mpt (line 508) | def preprocess_mpt( function preprocess_plain (line 574) | def preprocess_plain( function preprocess (line 596) | def preprocess( class LazySupervisedDataset (line 644) | class LazySupervisedDataset(Dataset): method __init__ (line 647) | def __init__(self, tokenizer: transformers.PreTrainedTokenizer, method __len__ (line 673) | def __len__(self): method __getitem__ (line 676) | def __getitem__(self, i) -> Dict[str, torch.Tensor]: class DataCollatorForSupervisedDataset (line 797) | class DataCollatorForSupervisedDataset(object): method __call__ (line 802) | def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: function make_supervised_data_module (line 840) | def make_supervised_data_module(tokenizer: transformers.PreTrainedTokeni... function train (line 850) | def train(): FILE: model/univi/train/trainer.py function maybe_zero_3 (line 7) | def maybe_zero_3(param, ignore_status=False, name=None): function get_mm_adapter_state_maybe_zero_3 (line 21) | def get_mm_adapter_state_maybe_zero_3(named_params, keys_to_match): class ChatUniViTrainer (line 27) | class ChatUniViTrainer(Trainer): method _save_checkpoint (line 28) | def _save_checkpoint(self, model, trial, metrics=None): method _save (line 49) | def _save(self, output_dir: Optional[str] = None, state_dict=None): FILE: model/univi/utils.py function build_logger (line 17) | def build_logger(logger_name, logger_filename): class StreamToLogger (line 60) | class StreamToLogger(object): method __init__ (line 64) | def __init__(self, logger, log_level=logging.INFO): method __getattr__ (line 70) | def __getattr__(self, attr): method write (line 73) | def write(self, buf): method flush (line 87) | def flush(self): function disable_torch_init (line 93) | def disable_torch_init(): function violates_moderation (line 102) | def violates_moderation(text): function pretty_print_semaphore (line 123) | def pretty_print_semaphore(semaphore): FILE: tools/eval_davis17.py function eval_queue (line 23) | def eval_queue(q, rank, out_dict, mevis_pred_path): function get_meta_exp (line 58) | def get_meta_exp(mevis_exp_path, ): FILE: tools/eval_mevis.py function eval_queue (line 22) | def eval_queue(q, rank, out_dict, mevis_pred_path): FILE: tools/eval_revos.py function eval_queue (line 26) | def eval_queue(q, rank, out_dict, visa_pred_path): FILE: tools/generate_foreground_mask.py function get_args (line 18) | def get_args(): function merge_rle (line 24) | def merge_rle(masks_rle_list: list, height: int, width: int): function main (line 51) | def main(): FILE: tools/metrics.py function get_r2vos_accuracy (line 6) | def get_r2vos_accuracy(gt_masks: List[np.ndarray], pred_masks: List[np.n... function get_r2vos_robustness (line 23) | def get_r2vos_robustness(gt_masks: List[np.ndarray], pred_masks: List[np... function db_eval_iou (line 43) | def db_eval_iou(annotation, segmentation, void_pixels=None): function db_eval_boundary (line 77) | def db_eval_boundary(annotation, segmentation, void_pixels=None, bound_t... function f_measure (line 94) | def f_measure(foreground_mask, gt_mask, void_pixels=None, bound_th=0.008): function _seg2bmap (line 158) | def _seg2bmap(seg, width=None, height=None): FILE: tools/zip_mp_mevis.py function zip_files (line 16) | def zip_files(path, temp_zip_file): function main (line 24) | def main(): FILE: tools/zip_mp_refytvos.py function zip_files (line 16) | def zip_files(path, temp_zip_file): function main (line 24) | def main(): FILE: train_ds.py function parse_args (line 29) | def parse_args(args): function main (line 132) | def main(args): function train (line 466) | def train( function validate (line 601) | def validate(val_loader, model_engine, epoch, writer, args): function rvos_validate (line 667) | def rvos_validate(val_loader, model_engine, epoch, writer, args): FILE: utils/chatunivi_dataset.py function _get_rawvideo_dec (line 24) | def _get_rawvideo_dec(video_path, image_processor, max_frames=64, image_... function get_zero_image (line 69) | def get_zero_image(processor): class ChatUniviDataset (line 75) | class ChatUniviDataset(torch.utils.data.Dataset): method __init__ (line 87) | def __init__( method load_data (line 128) | def load_data(self, dataset_name: str): method __len__ (line 139) | def __len__(self): method __getitem__ (line 142) | def __getitem__(self, i, max_try: int = 10): method sample_data (line 173) | def sample_data(self, ): FILE: utils/conversation.py class SeparatorStyle (line 10) | class SeparatorStyle(Enum): class Conversation (line 22) | class Conversation: method get_prompt (line 48) | def get_prompt(self): method append_message (line 109) | def append_message(self, role, message): method to_gradio_chatbot (line 112) | def to_gradio_chatbot(self): method copy (line 121) | def copy(self): method dict (line 136) | def dict(self): function get_default_conv_template (line 283) | def get_default_conv_template(model_name): FILE: utils/d2_datasets/mevis_utils.py function load_mevis_json (line 22) | def load_mevis_json(image_root, json_file, dataset_name, is_train: bool ... FILE: utils/d2_datasets/refytvos_utils.py function encode_anno_mask (line 32) | def encode_anno_mask(frames, vid_len, img_folder, video, obj_id, anno_id... function load_refytvos_json (line 47) | def load_refytvos_json(img_folder: str, ann_file: str, dataset_name: str... FILE: utils/d2_datasets/ytvis_api/ytvos.py function _isArrayLike (line 41) | def _isArrayLike(obj): class YTVOS (line 45) | class YTVOS: method __init__ (line 46) | def __init__(self, annotation_file=None): method createIndex (line 65) | def createIndex(self): method info (line 96) | def info(self): method getAnnIds (line 104) | def getAnnIds(self, vidIds=[], catIds=[], areaRng=[], iscrowd=None): method getCatIds (line 132) | def getCatIds(self, catNms=[], supNms=[], catIds=[]): method getVidIds (line 154) | def getVidIds(self, vidIds=[], catIds=[]): method loadAnns (line 175) | def loadAnns(self, ids=[]): method loadCats (line 186) | def loadCats(self, ids=[]): method loadVids (line 197) | def loadVids(self, ids=[]): method loadRes (line 209) | def loadRes(self, resFile): method annToRLE (line 259) | def annToRLE(self, ann, frameId): method annToMask (line 280) | def annToMask(self, ann, frameId): FILE: utils/d2_datasets/ytvis_api/ytvoseval.py class YTVOSeval (line 10) | class YTVOSeval: method __init__ (line 60) | def __init__(self, cocoGt=None, cocoDt=None, iouType='segm'): method _prepare (line 85) | def _prepare(self): method evaluate (line 129) | def evaluate(self): method computeIoU (line 173) | def computeIoU(self, vidId, catId): method computeOks (line 221) | def computeOks(self, imgId, catId): method evaluateVid (line 264) | def evaluateVid(self, vidId, catId, aRng, maxDet): method accumulate (line 344) | def accumulate(self, p = None): method summarize (line 451) | def summarize(self): method __str__ (line 524) | def __str__(self): class Params (line 527) | class Params: method setDetParams (line 531) | def setDetParams(self): method setKpParams (line 544) | def setKpParams(self): method __init__ (line 555) | def __init__(self, iouType='segm'): FILE: utils/data_processing.py function get_mask_from_json (line 9) | def get_mask_from_json(json_path, img): FILE: utils/dataset.py function collate_fn (line 36) | def collate_fn( class HybridDataset (line 187) | class HybridDataset(torch.utils.data.Dataset): method __init__ (line 193) | def __init__( method __len__ (line 342) | def __len__(self): method __getitem__ (line 345) | def __getitem__(self, idx): class ValDataset (line 356) | class ValDataset(torch.utils.data.Dataset): method __init__ (line 362) | def __init__( method __len__ (line 421) | def __len__(self): method preprocess (line 427) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method __getitem__ (line 439) | def __getitem__(self, idx): FILE: utils/grefcoco.py function load_grefcoco_json (line 25) | def load_grefcoco_json( FILE: utils/grefer.py class G_REFER (line 36) | class G_REFER: method __init__ (line 37) | def __init__(self, data_root, dataset="grefcoco", splitBy="unc"): method _toList (line 75) | def _toList(x): method match_any (line 79) | def match_any(a, b): method createIndex (line 84) | def createIndex(self): method getRefIds (line 164) | def getRefIds(self, image_ids=[], cat_ids=[], split=[]): method getAnnIds (line 186) | def getAnnIds(self, image_ids=[], ref_ids=[]): method getImgIds (line 210) | def getImgIds(self, ref_ids=[]): method getCatIds (line 219) | def getCatIds(self): method loadRefs (line 222) | def loadRefs(self, ref_ids=[]): method loadAnns (line 225) | def loadAnns(self, ann_ids=[]): method loadImgs (line 230) | def loadImgs(self, image_ids=[]): method loadCats (line 233) | def loadCats(self, cat_ids=[]): method getRefBox (line 236) | def getRefBox(self, ref_id): method showRef (line 240) | def showRef(self, ref, seg_box="seg"): method getMask (line 302) | def getMask(self, ann): method getMaskByRef (line 322) | def getMaskByRef(self, ref=None, ref_id=None, merge=False): method showMask (line 348) | def showMask(self, ref): FILE: utils/random_list.py function lcg (line 3) | def lcg(modulus, a, c, seed): function get_random_number (line 9) | def get_random_number(probabilities, values, generator): function get_random_list (line 20) | def get_random_list(probabilities, values, length, seed: int = 0): FILE: utils/reason_seg_dataset.py class ReasonSegDataset (line 20) | class ReasonSegDataset(torch.utils.data.Dataset): method __init__ (line 26) | def __init__( method __len__ (line 93) | def __len__(self): method preprocess (line 96) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method __getitem__ (line 108) | def __getitem__(self, idx): FILE: utils/refer.py class REFER (line 44) | class REFER: method __init__ (line 45) | def __init__(self, data_root, dataset="refcoco", splitBy="unc"): method createIndex (line 82) | def createIndex(self): method getRefIds (line 145) | def getRefIds(self, image_ids=[], cat_ids=[], ref_ids=[], split=""): method getAnnIds (line 180) | def getAnnIds(self, image_ids=[], cat_ids=[], ref_ids=[]): method getImgIds (line 206) | def getImgIds(self, ref_ids=[]): method getCatIds (line 215) | def getCatIds(self): method loadRefs (line 218) | def loadRefs(self, ref_ids=[]): method loadAnns (line 224) | def loadAnns(self, ann_ids=[]): method loadImgs (line 230) | def loadImgs(self, image_ids=[]): method loadCats (line 236) | def loadCats(self, cat_ids=[]): method getRefBox (line 242) | def getRefBox(self, ref_id): method showRef (line 247) | def showRef(self, ref, seg_box="seg"): method getMask (line 309) | def getMask(self, ref): method showMask (line 361) | def showMask(self, ref): FILE: utils/refer_seg_dataset.py class ReferSegDataset (line 19) | class ReferSegDataset(torch.utils.data.Dataset): method __init__ (line 25) | def __init__( method __len__ (line 105) | def __len__(self): method preprocess (line 108) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method __getitem__ (line 120) | def __getitem__(self, idx): FILE: utils/rvos_dataset.py function get_zero_image (line 43) | def get_zero_image(processor): class RVOSDataset (line 48) | class RVOSDataset(torch.utils.data.Dataset): method __init__ (line 54) | def __init__( method __len__ (line 119) | def __len__(self): method __getitem__ (line 122) | def __getitem__(self, idx): method preprocess (line 179) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method sample_data (line 192) | def sample_data(self,): FILE: utils/rvos_eval_dataset.py function get_zero_image (line 46) | def get_zero_image(processor): class RVOSEvalDataset (line 50) | class RVOSEvalDataset(torch.utils.data.Dataset): method __init__ (line 56) | def __init__( method __len__ (line 91) | def __len__(self): method load_data (line 94) | def load_data(self, ): method __getitem__ (line 137) | def __getitem__(self, idx): method preprocess (line 221) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: utils/sem_seg_dataset.py function init_mapillary (line 20) | def init_mapillary(base_image_dir): function init_ade20k (line 39) | def init_ade20k(base_image_dir): function init_cocostuff (line 69) | def init_cocostuff(base_image_dir): function init_paco_lvis (line 88) | def init_paco_lvis(base_image_dir): function init_pascal_part (line 112) | def init_pascal_part(base_image_dir): class SemSegDataset (line 127) | class SemSegDataset(torch.utils.data.Dataset): method __init__ (line 133) | def __init__( method __len__ (line 173) | def __len__(self): method preprocess (line 176) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method __getitem__ (line 188) | def __getitem__(self, idx): FILE: utils/utils.py function convert2imagesplit (line 89) | def convert2imagesplit(sent: str, video_len: int) -> str: class Summary (line 95) | class Summary(Enum): class AverageMeter (line 102) | class AverageMeter(object): method __init__ (line 105) | def __init__(self, name, fmt=":f", summary_type=Summary.AVERAGE): method reset (line 111) | def reset(self): method update (line 117) | def update(self, val, n=1): method all_reduce (line 123) | def all_reduce(self): method __str__ (line 146) | def __str__(self): method summary (line 150) | def summary(self): function intersectionAndUnionGPU (line 166) | def intersectionAndUnionGPU(output, target, K, ignore_index=255): class ProgressMeter (line 181) | class ProgressMeter(object): method __init__ (line 182) | def __init__(self, num_batches, meters, prefix=""): method display (line 187) | def display(self, batch): method display_summary (line 192) | def display_summary(self): method _get_batch_fmtstr (line 197) | def _get_batch_fmtstr(self, num_batches): function dict_to_cuda (line 203) | def dict_to_cuda(input_dict): FILE: utils/vqa_dataset.py function preprocess_multimodal (line 16) | def preprocess_multimodal(source, mm_use_im_start_end): class VQADataset (line 32) | class VQADataset(torch.utils.data.Dataset): method __init__ (line 38) | def __init__( method __len__ (line 69) | def __len__(self): method preprocess (line 72) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: method __getitem__ (line 84) | def __getitem__(self, idx): FILE: utils_llamavid/llamavid_client.py function call (line 22) | def call(video_dir: str, question: str, ): function call_batch (line 30) | def call_batch(params_list: List[Tuple[str, str]], ): function main (line 65) | def main(): FILE: utils_llamavid/llamavid_server.py class VideoFeatureExtractor (line 32) | class VideoFeatureExtractor: method __init__ (line 34) | def __init__( method __call__ (line 57) | def __call__(self, video_dir: str) -> dict: class LLaMAVIDGenerator (line 84) | class LLaMAVIDGenerator: method __init__ (line 89) | def __init__( method __call__ (line 116) | def __call__( class Inferencer (line 175) | class Inferencer: method __init__ (line 176) | def __init__( method __call__ (line 194) | def __call__(self, video_dir: str, question: str): class InferenceServer (line 198) | class InferenceServer(Inferencer): method __init__ (line 200) | def __init__(self, **kwargs): method post (line 208) | def post(self): function parse_args (line 222) | def parse_args(): function main (line 240) | def main():