SYMBOL INDEX (473 symbols across 31 files) FILE: bsr/degradations.py function sigma_matrix2 (line 16) | def sigma_matrix2(sig_x, sig_y, theta): function mesh_grid (line 32) | def mesh_grid(kernel_size): function pdf2 (line 50) | def pdf2(sigma_matrix, grid): function cdf2 (line 66) | def cdf2(d_matrix, grid): function bivariate_Gaussian (line 84) | def bivariate_Gaussian(kernel_size, sig_x, sig_y, theta, grid=None, isot... function bivariate_generalized_Gaussian (line 112) | def bivariate_generalized_Gaussian(kernel_size, sig_x, sig_y, theta, bet... function bivariate_plateau (line 143) | def bivariate_plateau(kernel_size, sig_x, sig_y, theta, beta, grid=None,... function random_bivariate_Gaussian (line 176) | def random_bivariate_Gaussian(kernel_size, function random_bivariate_generalized_Gaussian (line 220) | def random_bivariate_generalized_Gaussian(kernel_size, function random_bivariate_plateau (line 272) | def random_bivariate_plateau(kernel_size, function random_mixed_kernels (line 324) | def random_mixed_kernels(kernel_list, function circular_lowpass_kernel (line 389) | def circular_lowpass_kernel(cutoff, kernel_size, pad_to=0): function generate_gaussian_noise (line 419) | def generate_gaussian_noise(img, sigma=10, gray_noise=False): function add_gaussian_noise (line 438) | def add_gaussian_noise(img, sigma=10, clip=True, rounds=False, gray_nois... function generate_gaussian_noise_pt (line 460) | def generate_gaussian_noise_pt(img, sigma=10, gray_noise=0): function add_gaussian_noise_pt (line 492) | def add_gaussian_noise_pt(img, sigma=10, gray_noise=0, clip=True, rounds... function random_generate_gaussian_noise (line 515) | def random_generate_gaussian_noise(img, sigma_range=(0, 10), gray_prob=0): function random_add_gaussian_noise (line 524) | def random_add_gaussian_noise(img, sigma_range=(0, 1.0), gray_prob=0, cl... function random_generate_gaussian_noise_pt (line 536) | def random_generate_gaussian_noise_pt(img, sigma_range=(0, 10), gray_pro... function random_add_gaussian_noise_pt (line 544) | def random_add_gaussian_noise_pt(img, sigma_range=(0, 1.0), gray_prob=0,... function generate_poisson_noise (line 559) | def generate_poisson_noise(img, scale=1.0, gray_noise=False): function add_poisson_noise (line 586) | def add_poisson_noise(img, scale=1.0, clip=True, rounds=False, gray_nois... function generate_poisson_noise_pt (line 609) | def generate_poisson_noise_pt(img, scale=1.0, gray_noise=0): function add_poisson_noise_pt (line 657) | def add_poisson_noise_pt(img, scale=1.0, clip=True, rounds=False, gray_n... function random_generate_poisson_noise (line 685) | def random_generate_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0): function random_add_poisson_noise (line 694) | def random_add_poisson_noise(img, scale_range=(0, 1.0), gray_prob=0, cli... function random_generate_poisson_noise_pt (line 706) | def random_generate_poisson_noise_pt(img, scale_range=(0, 1.0), gray_pro... function random_add_poisson_noise_pt (line 714) | def random_add_poisson_noise_pt(img, scale_range=(0, 1.0), gray_prob=0, ... function add_jpg_compression (line 731) | def add_jpg_compression(img, quality=90): function random_add_jpg_compression (line 750) | def random_add_jpg_compression(img, quality_range=(90, 100)): FILE: bsr/transforms.py function mod_crop (line 6) | def mod_crop(img, scale): function paired_random_crop (line 26) | def paired_random_crop(img_gts, img_lqs, gt_patch_size, scale, gt_path=N... function augment (line 94) | def augment(imgs, hflip=True, rotation=True, flows=None, return_status=F... function img_rotate (line 161) | def img_rotate(img, angle, center=None, scale=1.0): FILE: bsr/utils/color_util.py function rgb2ycbcr (line 5) | def rgb2ycbcr(img, y_only=False): function bgr2ycbcr (line 38) | def bgr2ycbcr(img, y_only=False): function ycbcr2rgb (line 71) | def ycbcr2rgb(img): function ycbcr2bgr (line 100) | def ycbcr2bgr(img): function _convert_input_type_range (line 129) | def _convert_input_type_range(img): function _convert_output_type_range (line 156) | def _convert_output_type_range(img, dst_type): function rgb2ycbcr_pt (line 186) | def rgb2ycbcr_pt(img, y_only=False): FILE: bsr/utils/diffjpeg.py function diff_round (line 26) | def diff_round(x): function quality_to_factor (line 32) | def quality_to_factor(quality): class RGB2YCbCrJpeg (line 49) | class RGB2YCbCrJpeg(nn.Module): method __init__ (line 53) | def __init__(self): method forward (line 60) | def forward(self, image): class ChromaSubsampling (line 73) | class ChromaSubsampling(nn.Module): method __init__ (line 77) | def __init__(self): method forward (line 80) | def forward(self, image): class BlockSplitting (line 98) | class BlockSplitting(nn.Module): method __init__ (line 102) | def __init__(self): method forward (line 106) | def forward(self, image): class DCT8x8 (line 121) | class DCT8x8(nn.Module): method __init__ (line 125) | def __init__(self): method forward (line 134) | def forward(self, image): class YQuantize (line 148) | class YQuantize(nn.Module): method __init__ (line 155) | def __init__(self, rounding): method forward (line 160) | def forward(self, image, factor=1): class CQuantize (line 178) | class CQuantize(nn.Module): method __init__ (line 185) | def __init__(self, rounding): method forward (line 190) | def forward(self, image, factor=1): class CompressJpeg (line 208) | class CompressJpeg(nn.Module): method __init__ (line 215) | def __init__(self, rounding=torch.round): method forward (line 222) | def forward(self, image, factor=1): class YDequantize (line 247) | class YDequantize(nn.Module): method __init__ (line 251) | def __init__(self): method forward (line 255) | def forward(self, image, factor=1): class CDequantize (line 272) | class CDequantize(nn.Module): method __init__ (line 276) | def __init__(self): method forward (line 280) | def forward(self, image, factor=1): class iDCT8x8 (line 297) | class iDCT8x8(nn.Module): method __init__ (line 301) | def __init__(self): method forward (line 310) | def forward(self, image): class BlockMerging (line 324) | class BlockMerging(nn.Module): method __init__ (line 328) | def __init__(self): method forward (line 331) | def forward(self, patches, height, width): class ChromaUpsampling (line 348) | class ChromaUpsampling(nn.Module): method __init__ (line 352) | def __init__(self): method forward (line 355) | def forward(self, y, cb, cr): class YCbCr2RGBJpeg (line 378) | class YCbCr2RGBJpeg(nn.Module): method __init__ (line 382) | def __init__(self): method forward (line 389) | def forward(self, image): class DeCompressJpeg (line 401) | class DeCompressJpeg(nn.Module): method __init__ (line 408) | def __init__(self, rounding=torch.round): method forward (line 417) | def forward(self, y, cb, cr, imgh, imgw, factor=1): class DiffJPEG (line 449) | class DiffJPEG(nn.Module): method __init__ (line 457) | def __init__(self, differentiable=True): method forward (line 467) | def forward(self, x, quality): FILE: bsr/utils/dist_util.py function init_dist (line 10) | def init_dist(launcher, backend='nccl', **kwargs): function _init_dist_pytorch (line 21) | def _init_dist_pytorch(backend, **kwargs): function _init_dist_slurm (line 28) | def _init_dist_slurm(backend, port=None): function get_dist_info (line 60) | def get_dist_info(): function master_only (line 74) | def master_only(func): FILE: bsr/utils/download_util.py function download_file_from_google_drive (line 11) | def download_file_from_google_drive(file_id, save_path): function get_confirm_token (line 41) | def get_confirm_token(response): function save_response_content (line 48) | def save_response_content(response, destination, file_size=None, chunk_s... function load_file_from_url (line 69) | def load_file_from_url(url, model_dir=None, progress=True, file_name=None): FILE: bsr/utils/file_client.py class BaseStorageBackend (line 5) | class BaseStorageBackend(metaclass=ABCMeta): method get (line 14) | def get(self, filepath): method get_text (line 18) | def get_text(self, filepath): class MemcachedBackend (line 22) | class MemcachedBackend(BaseStorageBackend): method __init__ (line 32) | def __init__(self, server_list_cfg, client_cfg, sys_path=None): method get (line 47) | def get(self, filepath): method get_text (line 54) | def get_text(self, filepath): class HardDiskBackend (line 58) | class HardDiskBackend(BaseStorageBackend): method get (line 61) | def get(self, filepath): method get_text (line 67) | def get_text(self, filepath): class LmdbBackend (line 74) | class LmdbBackend(BaseStorageBackend): method __init__ (line 94) | def __init__(self, db_paths, client_keys='default', readonly=True, loc... method get (line 114) | def get(self, filepath, client_key): method get_text (line 128) | def get_text(self, filepath): class FileClient (line 132) | class FileClient(object): method __init__ (line 151) | def __init__(self, backend='disk', **kwargs): method get (line 158) | def get(self, filepath, client_key='default'): method get_text (line 166) | def get_text(self, filepath): FILE: bsr/utils/flow_util.py function flowread (line 7) | def flowread(flow_path, quantize=False, concat_axis=0, *args, **kwargs): function flowwrite (line 45) | def flowwrite(flow, filename, quantize=False, concat_axis=0, *args, **kw... function quantize_flow (line 76) | def quantize_flow(flow, max_val=0.02, norm=True): function dequantize_flow (line 102) | def dequantize_flow(dx, dy, max_val=0.02, denorm=True): function quantize (line 126) | def quantize(arr, min_val, max_val, levels, dtype=np.int64): function dequantize (line 150) | def dequantize(arr, min_val, max_val, levels, dtype=np.float64): FILE: bsr/utils/img_process_util.py function filter2D (line 7) | def filter2D(img, kernel): function usm_sharp (line 34) | def usm_sharp(img, weight=0.5, radius=50, threshold=10): class USMSharp (line 63) | class USMSharp(torch.nn.Module): method __init__ (line 65) | def __init__(self, radius=50, sigma=0): method forward (line 74) | def forward(self, img, weight=0.5, threshold=10): FILE: bsr/utils/img_util.py function img2tensor (line 9) | def img2tensor(imgs, bgr2rgb=True, float32=True): function tensor2img (line 38) | def tensor2img(tensor, rgb2bgr=True, out_type=np.uint8, min_max=(0, 1)): function tensor2img_fast (line 97) | def tensor2img_fast(tensor, rgb2bgr=True, min_max=(0, 1)): function imfrombytes (line 114) | def imfrombytes(content, flag='color', float32=False): function imwrite (line 135) | def imwrite(img, file_path, params=None, auto_mkdir=True): function crop_border (line 156) | def crop_border(imgs, crop_border): FILE: bsr/utils/lmdb_util.py function make_lmdb_from_imgs (line 9) | def make_lmdb_from_imgs(data_path, function read_img_worker (line 135) | def read_img_worker(path, key, compress_level): class LmdbMaker (line 159) | class LmdbMaker(): method __init__ (line 170) | def __init__(self, lmdb_path, map_size=1024**4, batch=5000, compress_l... method put (line 185) | def put(self, img_byte, key, img_shape): method close (line 196) | def close(self): FILE: bsr/utils/logger.py class AvgTimer (line 10) | class AvgTimer(): method __init__ (line 12) | def __init__(self, window=200): method start (line 20) | def start(self): method record (line 23) | def record(self): method get_current_time (line 38) | def get_current_time(self): method get_avg_time (line 41) | def get_avg_time(self): class MessageLogger (line 45) | class MessageLogger(): method __init__ (line 58) | def __init__(self, opt, start_iter=1, tb_logger=None): method reset_start_time (line 68) | def reset_start_time(self): method __call__ (line 72) | def __call__(self, log_vars): function init_tb_logger (line 119) | def init_tb_logger(log_dir): function init_wandb_logger (line 126) | def init_wandb_logger(opt): function get_root_logger (line 146) | def get_root_logger(logger_name='basicsr', log_level=logging.INFO, log_f... function get_env_info (line 188) | def get_env_info(): FILE: bsr/utils/matlab_functions.py function cubic (line 6) | def cubic(x): function calculate_weights_indices (line 16) | def calculate_weights_indices(in_length, out_length, scale, kernel, kern... function imresize (line 86) | def imresize(img, scale, antialiasing=True): FILE: bsr/utils/misc.py function set_random_seed (line 11) | def set_random_seed(seed): function get_time_str (line 20) | def get_time_str(): function mkdir_and_rename (line 24) | def mkdir_and_rename(path): function make_exp_dirs (line 38) | def make_exp_dirs(opt): function scandir (line 52) | def scandir(dir_path, suffix=None, recursive=False, full_path=False): function check_resume (line 94) | def check_resume(opt, resume_iter): function sizeof_fmt (line 127) | def sizeof_fmt(size, suffix='B'): FILE: bsr/utils/options.py function ordered_yaml (line 13) | def ordered_yaml(): function yaml_load (line 38) | def yaml_load(f): function dict2str (line 54) | def dict2str(opt, indent_level=1): function _postprocess_yml_value (line 75) | def _postprocess_yml_value(value): function parse_options (line 99) | def parse_options(root_path, is_train=True): function copy_opt_file (line 205) | def copy_opt_file(opt_file, experiments_root): FILE: bsr/utils/plot_util.py function read_data_from_tensorboard (line 4) | def read_data_from_tensorboard(log_path, tag): function read_data_from_txt_2v (line 23) | def read_data_from_txt_2v(path, pattern, step_one=False): function read_data_from_txt_1v (line 48) | def read_data_from_txt_1v(path, pattern): function smooth_data (line 68) | def smooth_data(values, smooth_weight): FILE: bsr/utils/registry.py class Registry (line 4) | class Registry(): method __init__ (line 30) | def __init__(self, name): method _do_register (line 38) | def _do_register(self, name, obj, suffix=None): method register (line 46) | def register(self, obj=None, suffix=None): method get (line 65) | def get(self, name, suffix='basicsr'): method __contains__ (line 74) | def __contains__(self, name): method __iter__ (line 77) | def __iter__(self): method keys (line 80) | def keys(self): FILE: dataset.py class RealESRGANDataset (line 9) | class RealESRGANDataset(torch.utils.data.Dataset): method __init__ (line 10) | def __init__(self, opt, bsz): method __getitem__ (line 44) | def __getitem__(self, index): method __len__ (line 124) | def __len__(self): class RealESRGANDegrader (line 127) | class RealESRGANDegrader: method __init__ (line 128) | def __init__(self, opt, device): method _dequeue_and_enqueue (line 135) | def _dequeue_and_enqueue(self): method degrade (line 172) | def degrade(self, data): FILE: forward.py function MyUNet2DConditionModel_SD_forward (line 3) | def MyUNet2DConditionModel_SD_forward(self, x): function MyCrossAttnDownBlock2D_SD_forward (line 10) | def MyCrossAttnDownBlock2D_SD_forward(self, x): function MyCrossAttnUpBlock2D_SD_forward (line 20) | def MyCrossAttnUpBlock2D_SD_forward(self, x): function MyDownBlock2D_SD_forward (line 28) | def MyDownBlock2D_SD_forward(self, x): function MyUNetMidBlock2DCrossAttn_SD_forward (line 34) | def MyUNetMidBlock2DCrossAttn_SD_forward(self, x): function MyUpBlock2D_SD_forward (line 40) | def MyUpBlock2D_SD_forward(self, x): function MyResnetBlock2D_SD_forward (line 46) | def MyResnetBlock2D_SD_forward(self, x_in): function MyTransformer2DModel_SD_forward (line 57) | def MyTransformer2DModel_SD_forward(self, x_in): FILE: model.py function find_parent (line 23) | def find_parent(model, module_name): function halve_channels (line 30) | def halve_channels(model): class Net (line 94) | class Net(nn.Module): method __init__ (line 95) | def __init__(self, unet, decoder): method forward (line 151) | def forward(self, x): FILE: ram/models/bert.py class BertEmbeddings_nopos (line 52) | class BertEmbeddings_nopos(nn.Module): method __init__ (line 55) | def __init__(self, config): method forward (line 71) | def forward( class BertEmbeddings (line 100) | class BertEmbeddings(nn.Module): method __init__ (line 103) | def __init__(self, config): method forward (line 119) | def forward( class BertSelfAttention (line 146) | class BertSelfAttention(nn.Module): method __init__ (line 147) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 175) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 178) | def get_attn_gradients(self): method save_attention_map (line 181) | def save_attention_map(self, attention_map): method get_attention_map (line 184) | def get_attention_map(self): method transpose_for_scores (line 187) | def transpose_for_scores(self, x): method forward (line 192) | def forward( class BertSelfOutput (line 284) | class BertSelfOutput(nn.Module): method __init__ (line 285) | def __init__(self, config): method forward (line 291) | def forward(self, hidden_states, input_tensor): class BertAttention (line 298) | class BertAttention(nn.Module): method __init__ (line 299) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 305) | def prune_heads(self, heads): method forward (line 323) | def forward( class BertIntermediate (line 347) | class BertIntermediate(nn.Module): method __init__ (line 348) | def __init__(self, config): method forward (line 356) | def forward(self, hidden_states): class BertOutput (line 362) | class BertOutput(nn.Module): method __init__ (line 363) | def __init__(self, config): method forward (line 369) | def forward(self, hidden_states, input_tensor): class BertLayer (line 376) | class BertLayer(nn.Module): method __init__ (line 377) | def __init__(self, config, layer_num): method forward (line 389) | def forward( method feed_forward_chunk (line 455) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 461) | class BertEncoder(nn.Module): method __init__ (line 462) | def __init__(self, config): method forward (line 468) | def forward( class BertPooler (line 561) | class BertPooler(nn.Module): method __init__ (line 562) | def __init__(self, config): method forward (line 567) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 576) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 577) | def __init__(self, config): method forward (line 586) | def forward(self, hidden_states): class BertLMPredictionHead (line 593) | class BertLMPredictionHead(nn.Module): method __init__ (line 594) | def __init__(self, config): method forward (line 607) | def forward(self, hidden_states): class BertOnlyMLMHead (line 613) | class BertOnlyMLMHead(nn.Module): method __init__ (line 614) | def __init__(self, config): method forward (line 618) | def forward(self, sequence_output): class BertPreTrainedModel (line 623) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 633) | def _init_weights(self, module): class BertModel (line 646) | class BertModel(BertPreTrainedModel): method __init__ (line 656) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 669) | def get_input_embeddings(self): method set_input_embeddings (line 672) | def set_input_embeddings(self, value): method _prune_heads (line 675) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 684) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 745) | def forward( class BertLMHeadModel (line 885) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 890) | def __init__(self, config): method get_output_embeddings (line 898) | def get_output_embeddings(self): method set_output_embeddings (line 901) | def set_output_embeddings(self, new_embeddings): method forward (line 904) | def forward( method prepare_inputs_for_generation (line 1010) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 1029) | def _reorder_cache(self, past, beam_idx): FILE: ram/models/bert_lora.py class BertEmbeddings_nopos (line 54) | class BertEmbeddings_nopos(nn.Module): method __init__ (line 57) | def __init__(self, config): method forward (line 73) | def forward( class BertEmbeddings (line 102) | class BertEmbeddings(nn.Module): method __init__ (line 105) | def __init__(self, config): method forward (line 121) | def forward( class BertSelfAttention (line 148) | class BertSelfAttention(nn.Module): method __init__ (line 149) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 180) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 183) | def get_attn_gradients(self): method save_attention_map (line 186) | def save_attention_map(self, attention_map): method get_attention_map (line 189) | def get_attention_map(self): method transpose_for_scores (line 192) | def transpose_for_scores(self, x): method forward (line 197) | def forward( class BertSelfOutput (line 289) | class BertSelfOutput(nn.Module): method __init__ (line 290) | def __init__(self, config): method forward (line 296) | def forward(self, hidden_states, input_tensor): class BertAttention (line 303) | class BertAttention(nn.Module): method __init__ (line 304) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 310) | def prune_heads(self, heads): method forward (line 328) | def forward( class BertIntermediate (line 352) | class BertIntermediate(nn.Module): method __init__ (line 353) | def __init__(self, config): method forward (line 361) | def forward(self, hidden_states): class BertOutput (line 367) | class BertOutput(nn.Module): method __init__ (line 368) | def __init__(self, config): method forward (line 374) | def forward(self, hidden_states, input_tensor): class BertLayer (line 381) | class BertLayer(nn.Module): method __init__ (line 382) | def __init__(self, config, layer_num): method forward (line 394) | def forward( method feed_forward_chunk (line 460) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 466) | class BertEncoder(nn.Module): method __init__ (line 467) | def __init__(self, config): method forward (line 473) | def forward( class BertPooler (line 566) | class BertPooler(nn.Module): method __init__ (line 567) | def __init__(self, config): method forward (line 572) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 581) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 582) | def __init__(self, config): method forward (line 591) | def forward(self, hidden_states): class BertLMPredictionHead (line 598) | class BertLMPredictionHead(nn.Module): method __init__ (line 599) | def __init__(self, config): method forward (line 612) | def forward(self, hidden_states): class BertOnlyMLMHead (line 618) | class BertOnlyMLMHead(nn.Module): method __init__ (line 619) | def __init__(self, config): method forward (line 623) | def forward(self, sequence_output): class BertPreTrainedModel (line 628) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 638) | def _init_weights(self, module): class BertModel (line 651) | class BertModel(BertPreTrainedModel): method __init__ (line 661) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 674) | def get_input_embeddings(self): method set_input_embeddings (line 677) | def set_input_embeddings(self, value): method _prune_heads (line 680) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 689) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 750) | def forward( class BertLMHeadModel (line 890) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 895) | def __init__(self, config): method get_output_embeddings (line 903) | def get_output_embeddings(self): method set_output_embeddings (line 906) | def set_output_embeddings(self, new_embeddings): method forward (line 909) | def forward( method prepare_inputs_for_generation (line 1015) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 1034) | def _reorder_cache(self, past, beam_idx): FILE: ram/models/ram.py class RAM (line 20) | class RAM(nn.Module): method __init__ (line 21) | def __init__(self, method load_tag_list (line 160) | def load_tag_list(self, tag_list_file): method del_selfattention (line 167) | def del_selfattention(self): method condition_forward (line 172) | def condition_forward(self, method generate_tag (line 212) | def generate_tag(self, method generate_tag_openset (line 261) | def generate_tag_openset(self, function ram (line 306) | def ram(pretrained='', **kwargs): FILE: ram/models/ram_lora.py class RAMLora (line 21) | class RAMLora(nn.Module): method __init__ (line 22) | def __init__(self, method load_tag_list (line 171) | def load_tag_list(self, tag_list_file): method del_selfattention (line 178) | def del_selfattention(self): method generate_image_embeds (line 183) | def generate_image_embeds(self, method generate_tag (line 192) | def generate_tag(self, method condition_forward (line 243) | def condition_forward(self, method generate_tag_openset (line 283) | def generate_tag_openset(self, function ram (line 328) | def ram(pretrained='', pretrained_condition='', **kwargs): FILE: ram/models/swin_transformer.py class Mlp (line 17) | class Mlp(nn.Module): method __init__ (line 18) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 27) | def forward(self, x): function window_partition (line 36) | def window_partition(x, window_size): function window_reverse (line 51) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 68) | class WindowAttention(nn.Module): method __init__ (line 82) | def __init__(self, dim, window_size, num_heads, qkv_bias=True, qk_scal... method forward (line 116) | def forward(self, x, mask=None): method extra_repr (line 149) | def extra_repr(self) -> str: method flops (line 152) | def flops(self, N): class SwinTransformerBlock (line 166) | class SwinTransformerBlock(nn.Module): method __init__ (line 185) | def __init__(self, dim, input_resolution, num_heads, window_size=7, sh... method forward (line 247) | def forward(self, x, condition=None): method extra_repr (line 312) | def extra_repr(self) -> str: method flops (line 316) | def flops(self): class PatchMerging (line 331) | class PatchMerging(nn.Module): method __init__ (line 340) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 347) | def forward(self, x): method extra_repr (line 370) | def extra_repr(self) -> str: method flops (line 373) | def flops(self): class BasicLayer (line 380) | class BasicLayer(nn.Module): method __init__ (line 400) | def __init__(self, dim, input_resolution, depth, num_heads, window_size, method forward (line 428) | def forward(self, x, condition=None): method extra_repr (line 438) | def extra_repr(self) -> str: method flops (line 441) | def flops(self): class PatchEmbed (line 450) | class PatchEmbed(nn.Module): method __init__ (line 461) | def __init__(self, img_size=224, patch_size=4, in_chans=3, embed_dim=9... method forward (line 480) | def forward(self, x): method flops (line 490) | def flops(self): class SwinTransformer (line 498) | class SwinTransformer(nn.Module): method __init__ (line 524) | def __init__(self, img_size=224, patch_size=4, in_chans=3, num_classes... method _init_weights (line 582) | def _init_weights(self, m): method no_weight_decay (line 592) | def no_weight_decay(self): method no_weight_decay_keywords (line 596) | def no_weight_decay_keywords(self): method forward (line 599) | def forward(self, x, idx_to_group_img=None, image_atts=None, condition... method flops (line 623) | def flops(self): function interpolate_relative_pos_embed (line 633) | def interpolate_relative_pos_embed(rel_pos_bias, dst_num_pos, param_name... function zero_module (line 693) | def zero_module(module): FILE: ram/models/swin_transformer_lora.py class Mlp (line 19) | class Mlp(nn.Module): method __init__ (line 20) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 31) | def forward(self, x): function window_partition (line 40) | def window_partition(x, window_size): function window_reverse (line 55) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 72) | class WindowAttention(nn.Module): method __init__ (line 86) | def __init__(self, dim, window_size, num_heads, qkv_bias=True, qk_scal... method forward (line 122) | def forward(self, x, mask=None): method extra_repr (line 155) | def extra_repr(self) -> str: method flops (line 158) | def flops(self, N): class SwinTransformerBlock (line 172) | class SwinTransformerBlock(nn.Module): method __init__ (line 191) | def __init__(self, dim, input_resolution, num_heads, window_size=7, sh... method forward (line 242) | def forward(self, x): method extra_repr (line 281) | def extra_repr(self) -> str: method flops (line 285) | def flops(self): class PatchMerging (line 300) | class PatchMerging(nn.Module): method __init__ (line 309) | def __init__(self, input_resolution, dim, norm_layer=nn.LayerNorm): method forward (line 316) | def forward(self, x): method extra_repr (line 339) | def extra_repr(self) -> str: method flops (line 342) | def flops(self): class BasicLayer (line 349) | class BasicLayer(nn.Module): method __init__ (line 369) | def __init__(self, dim, input_resolution, depth, num_heads, window_size, method forward (line 397) | def forward(self, x): method extra_repr (line 407) | def extra_repr(self) -> str: method flops (line 410) | def flops(self): class PatchEmbed (line 419) | class PatchEmbed(nn.Module): method __init__ (line 430) | def __init__(self, img_size=224, patch_size=4, in_chans=3, embed_dim=9... method forward (line 449) | def forward(self, x): method flops (line 459) | def flops(self): class SwinTransformer (line 467) | class SwinTransformer(nn.Module): method __init__ (line 493) | def __init__(self, img_size=224, patch_size=4, in_chans=3, num_classes... method _init_weights (line 551) | def _init_weights(self, m): method no_weight_decay (line 561) | def no_weight_decay(self): method no_weight_decay_keywords (line 565) | def no_weight_decay_keywords(self): method forward (line 568) | def forward(self, x, idx_to_group_img=None, image_atts=None, **kwargs): method flops (line 592) | def flops(self): function interpolate_relative_pos_embed (line 602) | def interpolate_relative_pos_embed(rel_pos_bias, dst_num_pos, param_name... FILE: ram/models/tag2text.py class Tag2Text (line 19) | class Tag2Text(nn.Module): method __init__ (line 21) | def __init__(self, method load_tag_list (line 128) | def load_tag_list(self, tag_list_file): method del_selfattention (line 135) | def del_selfattention(self): method forward (line 141) | def forward(self, image, caption, tag): method generate_image_embeds (line 230) | def generate_image_embeds(self, method condition_forward (line 239) | def condition_forward(self, method generate (line 280) | def generate(self, function tag2text (line 409) | def tag2text(pretrained='', **kwargs): FILE: ram/models/tag2text_lora.py class Tag2Text (line 19) | class Tag2Text(nn.Module): method __init__ (line 21) | def __init__(self, method load_tag_list (line 128) | def load_tag_list(self, tag_list_file): method del_selfattention (line 135) | def del_selfattention(self): method forward (line 141) | def forward(self, image, caption, tag): method generate_image_embeds (line 230) | def generate_image_embeds(self, method condition_forward (line 239) | def condition_forward(self, method generate (line 280) | def generate(self, function tag2text (line 409) | def tag2text(pretrained='', **kwargs): FILE: ram/models/utils.py function read_json (line 16) | def read_json(rpath): function tie_encoder_decoder_weights (line 21) | def tie_encoder_decoder_weights(encoder: nn.Module, decoder: nn.Module, class GroupWiseLinear (line 99) | class GroupWiseLinear(nn.Module): method __init__ (line 103) | def __init__(self, num_class, hidden_dim, bias=True): method reset_parameters (line 114) | def reset_parameters(self): method forward (line 122) | def forward(self, x): function init_tokenizer (line 130) | def init_tokenizer(): function create_vit (line 138) | def create_vit(vit, function is_url (line 170) | def is_url(url_or_filename): function load_checkpoint (line 175) | def load_checkpoint(model, url_or_filename): function load_checkpoint_swinlarge_condition (line 203) | def load_checkpoint_swinlarge_condition(model, url_or_filename, kwargs): function load_checkpoint_swinbase (line 241) | def load_checkpoint_swinbase(model, url_or_filename, kwargs): function load_checkpoint_swinlarge (line 279) | def load_checkpoint_swinlarge(model, url_or_filename, kwargs): class AsymmetricLoss (line 319) | class AsymmetricLoss(nn.Module): method __init__ (line 320) | def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disa... method forward (line 329) | def forward(self, x, y): FILE: ram/models/vit.py class Mlp (line 23) | class Mlp(nn.Module): method __init__ (line 26) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 35) | def forward(self, x): class Attention (line 44) | class Attention(nn.Module): method __init__ (line 45) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method save_attn_gradients (line 58) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 61) | def get_attn_gradients(self): method save_attention_map (line 64) | def save_attention_map(self, attention_map): method get_attention_map (line 67) | def get_attention_map(self): method forward (line 70) | def forward(self, x, register_hook=False): class Block (line 89) | class Block(nn.Module): method __init__ (line 91) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 107) | def forward(self, x, register_hook=False): class VisionTransformer (line 113) | class VisionTransformer(nn.Module): method __init__ (line 118) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 167) | def _init_weights(self, m): method no_weight_decay (line 177) | def no_weight_decay(self): method forward (line 180) | def forward(self, x, register_blk=-1): method load_pretrained (line 197) | def load_pretrained(self, checkpoint_path, prefix=''): function _load_weights (line 202) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function interpolate_pos_embed (line 281) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): FILE: utils.py function add_lora_to_unet (line 4) | def add_lora_to_unet(unet, rank=4):