MCPcopy Create free account

hub / github.com/csslc/PiSA-SR / functions

Functions373 in github.com/csslc/PiSA-SR

↓ 26 callersFunction_n2p
(w, t=True)
ram/models/vit.py:207
↓ 14 callersMethod__init__
(self, config, layer_num)
ram/models/bert_lora.py:382
↓ 14 callersMethod__init__
(self, config, layer_num)
ram/models/bert.py:377
↓ 9 callersFunctionread_json
(rpath)
ram/models/utils.py:16
↓ 7 callersMethodtranspose_for_scores
(self, x)
ram/models/bert_lora.py:192
↓ 7 callersMethodtranspose_for_scores
(self, x)
ram/models/bert.py:187
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
ram/models/swin_transformer.py:18
↓ 6 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
ram/models/swin_transformer_lora.py:20
↓ 5 callersMethoddecode
Decode a batch of images. Args: z (`torch.FloatTensor`): Input batch of latent vectors. return_dict (`bool`,
src/models/autoencoder_kl.py:282
↓ 5 callersFunctionresblock2task
Turn a ResNetBlock into a sequence of tasks and append to the task queue @param queue: the target task queue @param block: ResNetBlock
src/my_utils/vaehook.py:247
↓ 4 callersFunctioncreate_vit
(vit, image_size, use_grad_checkpointing=False, ckpt_layer=0,
ram/models/utils.py:139
↓ 4 callersFunctionget_var_mean
Get mean and var for group norm
src/my_utils/vaehook.py:370
↓ 4 callersFunctioninit_tokenizer
()
ram/models/utils.py:130
↓ 4 callersFunctionis_url
(url_or_filename)
ram/models/utils.py:171
↓ 4 callersFunctionload_checkpoint
(model, url_or_filename)
ram/models/utils.py:176
↓ 4 callersFunctionload_checkpoint_swinbase
(model, url_or_filename, kwargs)
ram/models/utils.py:242
↓ 4 callersFunctiontie_encoder_decoder_weights
(encoder: nn.Module, decoder: nn.Module, base_model_prefix: str, skip_key: str
ram/models/utils.py:21
↓ 3 callersMethod__init__
(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.)
ram/models/vit.py:26
↓ 3 callersMethodencode
Encode a batch of images into latents. Args: x (`torch.FloatTensor`): Input batch of images. return_dict (`b
src/models/autoencoder_kl.py:237
↓ 3 callersMethodencode_prompt
Encode text prompts into embeddings.
pisasr.py:261
↓ 3 callersMethodflops
(self)
ram/models/swin_transformer.py:441
↓ 3 callersMethodflops
(self)
ram/models/swin_transformer_lora.py:410
↓ 3 callersFunctioninterpolate_relative_pos_embed
(rel_pos_bias, dst_num_pos, param_name='')
ram/models/swin_transformer.py:633
↓ 2 callersMethod__init__
(self, args)
pisasr.py:178
↓ 2 callersMethod_apply_lora_delta
Merge LoRA deltas into UNet weights.
pisasr.py:397
↓ 2 callersMethod_apply_ori_weight
Restore original UNet weights.
pisasr.py:405
↓ 2 callersMethod_decode
(self, z: torch.FloatTensor, return_dict: bool = True)
src/models/autoencoder_kl.py:269
↓ 2 callersFunctionadain_color_fix
(target: Image, source: Image)
src/my_utils/wavelet_color_fix.py:14
↓ 2 callersFunctionattn2task
(task_queue, net)
src/my_utils/vaehook.py:229
↓ 2 callersMethodblend_h
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
src/models/autoencoder_kl.py:316
↓ 2 callersMethodblend_v
(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)
src/models/autoencoder_kl.py:310
↓ 2 callersFunctioncalc_mean_std
Calculate mean and std for adaptive_instance_normalization. Args: feat (Tensor): 4D tensor. eps (float): A small value added to th
src/my_utils/wavelet_color_fix.py:44
↓ 2 callersFunctionclone_task_queue
Clone a task queue @param task_queue: the task queue to be cloned @return: the cloned task queue
src/my_utils/vaehook.py:361
↓ 2 callersFunctioncustom_group_norm
Custom group norm with fixed mean and var @param input: input tensor @param num_groups: number of groups. by default, num_groups = 32
src/my_utils/vaehook.py:383
↓ 2 callersMethodeps_to_mu
(self, scheduler, model_output, sample, timesteps)
pisasr.py:123
↓ 2 callersMethodgenerate
(self, image, sample=False, num_beams=3, m
ram/models/tag2text.py:280
↓ 2 callersMethodget_best_tile_size
Get the best tile size for GPU memory
src/my_utils/vaehook.py:561
↓ 2 callersFunctionget_cuda_device_string
()
src/my_utils/devices.py:19
↓ 2 callersFunctionhas_mps
()
src/my_utils/devices.py:12
↓ 2 callersFunctioninterpolate_pos_embed
(pos_embed_checkpoint, visual_encoder)
ram/models/vit.py:281
↓ 2 callersFunctionload_checkpoint_swinlarge
(model, url_or_filename, kwargs)
ram/models/utils.py:280
↓ 2 callersMethodload_tag_list
(self, tag_list_file)
ram/models/ram_lora.py:171
↓ 2 callersMethodload_tag_list
(self, tag_list_file)
ram/models/ram.py:160
↓ 2 callersMethodmerge_and_unload
( self, progressbar: bool = False, safe_merge: bool = False, adapter_names: Optional[list[str]] = None
src/models/autoencoder_kl.py:492
↓ 2 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
src/models/autoencoder_kl.py:184
↓ 2 callersMethodset_attn_processor
r""" Sets the attention processor to use to compute attention. Parameters: processor (`dict` of `AttentionProcessor` or o
src/models/unet_2d_condition.py:651
↓ 2 callersMethodset_train_sem
(self)
pisasr.py:225
↓ 2 callersFunctionwavelet_color_fix
(target: Image, source: Image)
src/my_utils/wavelet_color_fix.py:29
↓ 2 callersFunctionwavelet_decomposition
Apply wavelet decomposition to the input tensor. This function only returns the low frequency & the high frequency.
src/my_utils/wavelet_color_fix.py:94
↓ 2 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
ram/models/swin_transformer.py:36
↓ 2 callersFunctionwindow_partition
Args: x: (B, H, W, C) window_size (int): window size Returns: windows: (num_windows*B, window_size, window_size, C)
ram/models/swin_transformer_lora.py:40
↓ 2 callersFunctionzero_module
(module)
ram/models/swin_transformer.py:693
↓ 1 callersMethod__init__
(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disable_torch_grad_focal_loss=True)
ram/models/utils.py:321
↓ 1 callersFunction_average_precision
(output: ndarray, target: ndarray)
ram/utils/metrics.py:41
↓ 1 callersMethod_gaussian_weights
Generate a Gaussian mask for tile contributions.
pisasr.py:611
↓ 1 callersMethod_get_dtype
Get the appropriate data type based on precision.
pisasr.py:345
↓ 1 callersMethod_init_tiled_vae
Initialize VAE with tiled encoding/decoding.
pisasr.py:624
↓ 1 callersMethod_load_and_save_ckpt_from_state_dict
Load checkpoint and initialize LoRA adapters.
pisasr.py:410
↓ 1 callersMethod_load_pretrained_weights
Load pretrained weights and initialize LoRA adapters.
pisasr.py:360
↓ 1 callersFunction_load_weights
Load weights from .npz checkpoints for official Google Brain Flax implementation
ram/models/vit.py:202
↓ 1 callersMethod_move_models_to_device_and_dtype
Move models to the correct device and precision.
pisasr.py:354
↓ 1 callersMethod_predict_no_tiling
Predict on the entire latent without tiling.
pisasr.py:507
↓ 1 callersMethod_predict_with_tiling
Predict on the latent with tiling.
pisasr.py:520
↓ 1 callersMethod_prepare_lora_deltas
Precompute and store LoRA deltas for the given adapters.
pisasr.py:365
↓ 1 callersMethod_process_latents
Process latents with or without tiling.
pisasr.py:495
↓ 1 callersMethod_replace_module
(self, parent, child_name, new_module, child)
src/models/autoencoder_kl.py:535
↓ 1 callersMethod_replace_module
(self, parent, child_name, new_module, child)
src/models/unet_2d_condition.py:1257
↓ 1 callersMethod_unload_and_optionally_merge
( self, merge=True, progressbar: bool = False, safe_merge: bool = False,
src/models/autoencoder_kl.py:500
↓ 1 callersMethod_unload_and_optionally_merge
( self, merge=True, progressbar: bool = False, safe_merge: bool = False,
src/models/unet_2d_condition.py:1224
↓ 1 callersFunctionadaptive_instance_normalization
Adaptive instance normalization. Adjust the reference features to have the similar color and illuminations as those in the degradate features.
src/my_utils/wavelet_color_fix.py:59
↓ 1 callersMethodadd_tile
(self, tile, layer)
src/my_utils/vaehook.py:466
↓ 1 callersFunctionarticle
(name)
ram/utils/openset_utils.py:9
↓ 1 callersFunctionattn_forward
(self, h_)
src/my_utils/vaehook.py:172
↓ 1 callersFunctionattn_forward_new
(self, h_)
src/my_utils/vaehook.py:136
↓ 1 callersFunctionbuild_sampling
Build the sampling part of a task queue @param task_queue: the target task queue @param net: the network @param is_decoder: currently
src/my_utils/vaehook.py:279
↓ 1 callersFunctionbuild_task_queue
Build a single task queue for the encoder or decoder @param net: the VAE decoder or encoder network @param is_decoder: currently building
src/my_utils/vaehook.py:331
↓ 1 callersMethodcal_csd
( self, latents, prompt_embeds, negative_prompt_embeds, args, )
pisasr.py:132
↓ 1 callersMethodcolor_jitter_pt
(self, img, brightness, contrast, saturation, hue)
src/datasets/realesrgan.py:88
↓ 1 callersFunctioncrop_valid_region
Crop the valid region from the tile @param x: input tile @param input_bbox: original input bounding box @param target_bbox: output bo
src/my_utils/vaehook.py:415
↓ 1 callersMethoddegrade_process
(self, img_gt, resize_bak=False)
src/datasets/realesrgan.py:191
↓ 1 callersMethoddel_selfattention
(self)
ram/models/tag2text.py:135
↓ 1 callersMethoddel_selfattention
(self)
ram/models/ram_lora.py:178
↓ 1 callersMethoddel_selfattention
(self)
ram/models/tag2text_lora.py:135
↓ 1 callersMethoddel_selfattention
(self)
ram/models/ram.py:167
↓ 1 callersFunctionenable_tf32
()
src/my_utils/devices.py:52
↓ 1 callersMethodenable_tiling
r""" Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and en
src/models/autoencoder_kl.py:129
↓ 1 callersMethodencode_prompt
Encode text prompts into embeddings.
pisasr.py:455
↓ 1 callersMethodestimate_group_norm
(self, z, task_queue, color_fix)
src/my_utils/vaehook.py:636
↓ 1 callersFunctionfind_filepath
(directory, filename)
pisasr.py:28
↓ 1 callersMethodforward_latent
(self, model, latents, timestep, prompt_embeds)
pisasr.py:113
↓ 1 callersMethodfrom_tile
create a function from a single tile without summary
src/my_utils/vaehook.py:510
↓ 1 callersMethodgenerate_tag
(self, image, threshold=0.68, tag_input=None,
ram/models/ram.py:212
↓ 1 callersMethodgenerate_tag_openset
(self, image, threshold=0.68, tag_input=None,
ram/models/ram.py:261
↓ 1 callersFunctiongeometric_progression
(a, r, n)
ram/models/swin_transformer.py:648
↓ 1 callersFunctiongeometric_progression
(a, r, n)
ram/models/swin_transformer_lora.py:617
↓ 1 callersMethodget_extended_attention_mask
Makes broadcastable attention and causal masks so that future and masked tokens are ignored. Arguments: attention_mask (
ram/models/bert_lora.py:689
↓ 1 callersMethodget_extended_attention_mask
Makes broadcastable attention and causal masks so that future and masked tokens are ignored. Arguments: attention_mask (
ram/models/bert.py:684
↓ 1 callersFunctionget_optimal_device
()
src/my_utils/devices.py:33
↓ 1 callersFunctionget_optimal_device_name
()
src/my_utils/devices.py:23
↓ 1 callersFunctionget_recommend_decoder_tile_size
()
src/my_utils/vaehook.py:99
next →1–100 of 373, ranked by callers