SYMBOL INDEX (268 symbols across 18 files) FILE: encoders_flux.py function FeedForward (line 8) | def FeedForward(dim, mult=4): function reshape_tensor (line 18) | def reshape_tensor(x, heads): class PerceiverAttentionCA (line 29) | class PerceiverAttentionCA(nn.Module): method __init__ (line 30) | def __init__(self, *, dim=3072, dim_head=128, heads=16, kv_dim=2048): method forward (line 44) | def forward(self, x, latents): class PerceiverAttention (line 75) | class PerceiverAttention(nn.Module): method __init__ (line 76) | def __init__(self, *, dim, dim_head=64, heads=8, kv_dim=None): method forward (line 90) | def forward(self, x, latents): class IDFormer (line 122) | class IDFormer(nn.Module): method __init__ (line 130) | def __init__( method forward (line 189) | def forward(self, x, y): FILE: eva_clip/eva_vit_model.py class DropPath (line 33) | class DropPath(nn.Module): method __init__ (line 36) | def __init__(self, drop_prob=None): method forward (line 40) | def forward(self, x): method extra_repr (line 43) | def extra_repr(self) -> str: class Mlp (line 47) | class Mlp(nn.Module): method __init__ (line 48) | def __init__( method forward (line 70) | def forward(self, x): class SwiGLU (line 81) | class SwiGLU(nn.Module): method __init__ (line 82) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 97) | def forward(self, x): class Attention (line 106) | class Attention(nn.Module): method __init__ (line 107) | def __init__( method forward (line 173) | def forward(self, x, rel_pos_bias=None, attn_mask=None): class Block (line 246) | class Block(nn.Module): method __init__ (line 248) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 287) | def forward(self, x, rel_pos_bias=None, attn_mask=None): class PatchEmbed (line 305) | class PatchEmbed(nn.Module): method __init__ (line 308) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 320) | def forward(self, x, **kwargs): class RelativePositionBias (line 329) | class RelativePositionBias(nn.Module): method __init__ (line 331) | def __init__(self, window_size, num_heads): method forward (line 358) | def forward(self): class EVAVisionTransformer (line 366) | class EVAVisionTransformer(nn.Module): method __init__ (line 369) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method fix_init_weight (line 447) | def fix_init_weight(self): method get_cast_dtype (line 458) | def get_cast_dtype(self) -> torch.dtype: method _init_weights (line 461) | def _init_weights(self, m): method get_num_layers (line 470) | def get_num_layers(self): method lock (line 473) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 479) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 483) | def no_weight_decay(self): method get_classifier (line 486) | def get_classifier(self): method reset_classifier (line 489) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 493) | def forward_features(self, x, return_all_features=False, return_hidden... method forward (line 541) | def forward(self, x, return_all_features=False, return_hidden=False, s... FILE: eva_clip/factory.py function _natural_key (line 25) | def _natural_key(string_): function _rescan_model_configs (line 29) | def _rescan_model_configs(): function list_models (line 53) | def list_models(): function add_model_config (line 58) | def add_model_config(path): function get_model_config (line 66) | def get_model_config(model_name): function get_tokenizer (line 73) | def get_tokenizer(model_name): function load_state_dict (line 80) | def load_state_dict(checkpoint_path: str, map_location: str='cpu', model... function load_checkpoint (line 110) | def load_checkpoint(model, checkpoint_path, model_key="model|module|stat... function load_clip_visual_state_dict (line 131) | def load_clip_visual_state_dict(checkpoint_path: str, map_location: str=... function load_clip_text_state_dict (line 144) | def load_clip_text_state_dict(checkpoint_path: str, map_location: str='c... function get_pretrained_tag (line 152) | def get_pretrained_tag(pretrained_model): function load_pretrained_checkpoint (line 163) | def load_pretrained_checkpoint( function create_model (line 211) | def create_model( function create_model_and_transforms (line 358) | def create_model_and_transforms( function create_transforms (line 413) | def create_transforms( function create_model_from_pretrained (line 469) | def create_model_from_pretrained( FILE: eva_clip/hf_model.py class BaseModelOutput (line 21) | class BaseModelOutput: class PretrainedConfig (line 25) | class PretrainedConfig: function _camel2snake (line 31) | def _camel2snake(s): function register_pooler (line 37) | def register_pooler(cls): class MeanPooler (line 44) | class MeanPooler(nn.Module): method forward (line 46) | def forward(self, x:BaseModelOutput, attention_mask:TensorType): class MaxPooler (line 51) | class MaxPooler(nn.Module): method forward (line 53) | def forward(self, x:BaseModelOutput, attention_mask:TensorType): class ClsPooler (line 58) | class ClsPooler(nn.Module): method __init__ (line 60) | def __init__(self, use_pooler_output=True): method forward (line 65) | def forward(self, x:BaseModelOutput, attention_mask:TensorType): class HFTextEncoder (line 75) | class HFTextEncoder(nn.Module): method __init__ (line 77) | def __init__( method mask (line 152) | def mask(self, input_ids, vocab_size, device, targets=None, masked_ind... method forward_mlm (line 177) | def forward_mlm(self, input_ids, image_embeds, mlm_probability=0.25): method forward (line 213) | def forward(self, x:TensorType) -> TensorType: method lock (line 220) | def lock(self, unlocked_layers:int=0, freeze_layer_norm:bool=True): method set_grad_checkpointing (line 239) | def set_grad_checkpointing(self, enable=True): method get_num_layers (line 242) | def get_num_layers(self): method init_parameters (line 247) | def init_parameters(self): FILE: eva_clip/loss.py function gather_features (line 21) | def gather_features( class ClipLoss (line 70) | class ClipLoss(nn.Module): method __init__ (line 72) | def __init__( method forward (line 95) | def forward(self, image_features, text_features, logit_scale=1.): FILE: eva_clip/model.py class CLIPVisionCfg (line 37) | class CLIPVisionCfg: class CLIPTextCfg (line 66) | class CLIPTextCfg: function get_cast_dtype (line 83) | def get_cast_dtype(precision: str): function _build_vision_tower (line 92) | def _build_vision_tower( function _build_text_tower (line 173) | def _build_text_tower( class CLIP (line 210) | class CLIP(nn.Module): method __init__ (line 211) | def __init__( method lock_image_tower (line 233) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 238) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 243) | def no_weight_decay(self): method encode_image (line 246) | def encode_image(self, image, normalize: bool = False): method encode_text (line 250) | def encode_text(self, text, normalize: bool = False): method forward (line 264) | def forward(self, image, text): class CustomCLIP (line 270) | class CustomCLIP(nn.Module): method __init__ (line 271) | def __init__( method lock_image_tower (line 285) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 289) | def lock_text_tower(self, unlocked_layers:int=0, freeze_layer_norm:boo... method set_grad_checkpointing (line 293) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 298) | def no_weight_decay(self): method encode_image (line 301) | def encode_image(self, image, normalize: bool = False): method encode_text (line 305) | def encode_text(self, text, normalize: bool = False): method forward (line 309) | def forward(self, image, text): function convert_weights_to_lp (line 315) | def convert_weights_to_lp(model: nn.Module, dtype=torch.float16): function convert_to_custom_text_state_dict (line 347) | def convert_to_custom_text_state_dict(state_dict: dict): function build_model_from_openai_state_dict (line 366) | def build_model_from_openai_state_dict( function trace_model (line 426) | def trace_model(model, batch_size=256, device=torch.device('cpu')): FILE: eva_clip/modified_resnet.py class Bottleneck (line 10) | class Bottleneck(nn.Module): method __init__ (line 13) | def __init__(self, inplanes, planes, stride=1): method forward (line 42) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 58) | class AttentionPool2d(nn.Module): method __init__ (line 59) | def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, o... method forward (line 68) | def forward(self, x): class ModifiedResNet (line 95) | class ModifiedResNet(nn.Module): method __init__ (line 103) | def __init__(self, layers, output_dim, heads, image_size=224, width=64): method _make_layer (line 132) | def _make_layer(self, planes, blocks, stride=1): method init_parameters (line 141) | def init_parameters(self): method lock (line 154) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 162) | def set_grad_checkpointing(self, enable=True): method stem (line 166) | def stem(self, x): method forward (line 173) | def forward(self, x): FILE: eva_clip/openai.py function list_openai_models (line 18) | def list_openai_models() -> List[str]: function load_openai_model (line 23) | def load_openai_model( FILE: eva_clip/pretrained.py function _pcfg (line 18) | def _pcfg(url='', hf_hub='', filename='', mean=None, std=None): function _clean_tag (line 191) | def _clean_tag(tag: str): function list_pretrained (line 196) | def list_pretrained(as_str: bool = False): function list_pretrained_models_by_tag (line 203) | def list_pretrained_models_by_tag(tag: str): function list_pretrained_tags_by_model (line 213) | def list_pretrained_tags_by_model(model: str): function is_pretrained_cfg (line 221) | def is_pretrained_cfg(model: str, tag: str): function get_pretrained_cfg (line 227) | def get_pretrained_cfg(model: str, tag: str): function get_pretrained_url (line 234) | def get_pretrained_url(model: str, tag: str): function download_pretrained_from_url (line 239) | def download_pretrained_from_url( function has_hf_hub (line 285) | def has_hf_hub(necessary=False): function download_pretrained_from_hf (line 293) | def download_pretrained_from_hf( function download_pretrained (line 304) | def download_pretrained( FILE: eva_clip/rope.py function broadcat (line 7) | def broadcat(tensors, dim = -1): function rotate_half (line 23) | def rotate_half(x): class VisionRotaryEmbedding (line 30) | class VisionRotaryEmbedding(nn.Module): method __init__ (line 31) | def __init__( method forward (line 70) | def forward(self, t, start_index = 0): class VisionRotaryEmbeddingFast (line 79) | class VisionRotaryEmbeddingFast(nn.Module): method __init__ (line 80) | def __init__( method forward (line 121) | def forward(self, t, patch_indices_keep=None): FILE: eva_clip/timm_model.py class TimmModel (line 28) | class TimmModel(nn.Module): method __init__ (line 33) | def __init__( method lock (line 80) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 113) | def set_grad_checkpointing(self, enable=True): method forward (line 119) | def forward(self, x): FILE: eva_clip/tokenizer.py function default_bpe (line 21) | def default_bpe(): function bytes_to_unicode (line 26) | def bytes_to_unicode(): function get_pairs (line 48) | def get_pairs(word): function basic_clean (line 60) | def basic_clean(text): function whitespace_clean (line 66) | def whitespace_clean(text): class SimpleTokenizer (line 72) | class SimpleTokenizer(object): method __init__ (line 73) | def __init__(self, bpe_path: str = default_bpe(), special_tokens=None): method bpe (line 98) | def bpe(self, token): method encode (line 139) | def encode(self, text): method decode (line 147) | def decode(self, tokens): function tokenize (line 156) | def tokenize(texts: Union[str, List[str]], context_length: int = 77) -> ... class HFTokenizer (line 188) | class HFTokenizer: method __init__ (line 190) | def __init__(self, tokenizer_name:str): method __call__ (line 194) | def __call__(self, texts:Union[str, List[str]], context_length:int=77)... FILE: eva_clip/transform.py class ResizeMaxSize (line 13) | class ResizeMaxSize(nn.Module): method __init__ (line 15) | def __init__(self, max_size, interpolation=InterpolationMode.BICUBIC, ... method forward (line 24) | def forward(self, img): function _convert_to_rgb (line 39) | def _convert_to_rgb(image): function image_transform (line 60) | def image_transform( FILE: eva_clip/transformer.py class LayerNormFp32 (line 36) | class LayerNormFp32(nn.LayerNorm): method __init__ (line 38) | def __init__(self, *args, **kwargs): method forward (line 41) | def forward(self, x: torch.Tensor): class LayerNorm (line 52) | class LayerNorm(nn.LayerNorm): method forward (line 55) | def forward(self, x: torch.Tensor): class QuickGELU (line 60) | class QuickGELU(nn.Module): method forward (line 62) | def forward(self, x: torch.Tensor): class LayerScale (line 66) | class LayerScale(nn.Module): method __init__ (line 67) | def __init__(self, dim, init_values=1e-5, inplace=False): method forward (line 72) | def forward(self, x): class PatchDropout (line 75) | class PatchDropout(nn.Module): method __init__ (line 80) | def __init__(self, prob, exclude_first_token=True): method forward (line 87) | def forward(self, x): function _in_projection_packed (line 119) | def _in_projection_packed( class Attention (line 150) | class Attention(nn.Module): method __init__ (line 151) | def __init__( method forward (line 195) | def forward(self, x, attn_mask: Optional[torch.Tensor] = None): class CustomAttention (line 243) | class CustomAttention(nn.Module): method __init__ (line 244) | def __init__( method forward (line 286) | def forward(self, query: torch.Tensor, key: torch.Tensor, value: torch... class CustomResidualAttentionBlock (line 339) | class CustomResidualAttentionBlock(nn.Module): method __init__ (line 340) | def __init__( method forward (line 384) | def forward(self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, a... class CustomTransformer (line 389) | class CustomTransformer(nn.Module): method __init__ (line 390) | def __init__( method get_cast_dtype (line 429) | def get_cast_dtype(self) -> torch.dtype: method forward (line 432) | def forward(self, q: torch.Tensor, k: torch.Tensor = None, v: torch.Te... class ResidualAttentionBlock (line 443) | class ResidualAttentionBlock(nn.Module): method __init__ (line 444) | def __init__( method attention (line 474) | def attention(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor]... method forward (line 480) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 485) | class Transformer(nn.Module): method __init__ (line 486) | def __init__( method get_cast_dtype (line 508) | def get_cast_dtype(self) -> torch.dtype: method forward (line 511) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class VisionTransformer (line 520) | class VisionTransformer(nn.Module): method __init__ (line 521) | def __init__( method lock (line 567) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method get_num_layers (line 600) | def get_num_layers(self): method set_grad_checkpointing (line 604) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 608) | def no_weight_decay(self): method forward (line 611) | def forward(self, x: torch.Tensor, return_all_features: bool=False): class TextTransformer (line 642) | class TextTransformer(nn.Module): method __init__ (line 643) | def __init__( method init_parameters (line 686) | def init_parameters(self): method set_grad_checkpointing (line 703) | def set_grad_checkpointing(self, enable=True): method no_weight_decay (line 707) | def no_weight_decay(self): method get_num_layers (line 711) | def get_num_layers(self): method build_attention_mask (line 714) | def build_attention_mask(self): method forward (line 722) | def forward(self, text, return_all_features: bool=False): FILE: eva_clip/utils.py function resize_clip_pos_embed (line 13) | def resize_clip_pos_embed(state_dict, model, interpolation: str = 'bicub... function resize_visual_pos_embed (line 46) | def resize_visual_pos_embed(state_dict, model, interpolation: str = 'bic... function resize_evaclip_pos_embed (line 78) | def resize_evaclip_pos_embed(state_dict, model, interpolation: str = 'bi... function resize_eva_pos_embed (line 109) | def resize_eva_pos_embed(state_dict, model, interpolation: str = 'bicubi... function resize_rel_pos_embed (line 140) | def resize_rel_pos_embed(state_dict, model, interpolation: str = 'bicubi... function freeze_batch_norm_2d (line 237) | def freeze_batch_norm_2d(module, module_match={}, name=''): function _ntuple (line 277) | def _ntuple(n): function is_logging (line 292) | def is_logging(args): class AllGather (line 304) | class AllGather(torch.autograd.Function): method forward (line 311) | def forward(ctx, tensor, rank, world_size): method backward (line 319) | def backward(ctx, grad_output): FILE: online_train1.py class Transform (line 12) | class Transform(nn.Module): method __init__ (line 13) | def __init__(self, n=2, token_size=32, input_dim=2048): method encode (line 29) | def encode(self, x): method decode (line 34) | def decode(self, x): method forward (line 44) | def forward(self, x): function online_train (line 49) | def online_train(cond, device="cuda:1",step=1000): FILE: online_train2.py class Transform (line 11) | class Transform(nn.Module): method __init__ (line 12) | def __init__(self, n=2, token_size=32, input_dim=2048): method encode (line 20) | def encode(self, x): method forward (line 24) | def forward(self, x): function criterion (line 28) | def criterion(output, target, token_sample_rate=0.25): function online_train (line 34) | def online_train(cond, device="cuda:1",step=1000): FILE: pulidflux.py class PulidFluxModel (line 32) | class PulidFluxModel(nn.Module): method __init__ (line 33) | def __init__(self): method from_pretrained (line 52) | def from_pretrained(self, path: str): method get_embeds (line 67) | def get_embeds(self, face_embed, clip_embeds): function forward_orig (line 70) | def forward_orig( function tensor_to_image (line 203) | def tensor_to_image(tensor): function image_to_tensor (line 208) | def image_to_tensor(image): function resize_with_pad (line 213) | def resize_with_pad(img, target_size): # image: 1, h, w, 3 function to_gray (line 236) | def to_gray(img): class PulidFluxModelLoader (line 247) | class PulidFluxModelLoader: method INPUT_TYPES (line 249) | def INPUT_TYPES(s): method load_model (line 256) | def load_model(self, pulid_file): class PulidFluxInsightFaceLoader (line 267) | class PulidFluxInsightFaceLoader: method INPUT_TYPES (line 269) | def INPUT_TYPES(s): method load_insightface (line 280) | def load_insightface(self, provider): class PulidFluxEvaClipLoader (line 286) | class PulidFluxEvaClipLoader: method INPUT_TYPES (line 288) | def INPUT_TYPES(s): method load_eva_clip (line 297) | def load_eva_clip(self): class ApplyPulidFlux (line 313) | class ApplyPulidFlux: method INPUT_TYPES (line 315) | def INPUT_TYPES(s): method __init__ (line 345) | def __init__(self): method apply_pulid_flux (line 348) | def apply_pulid_flux(self, model, pulid_flux, eva_clip, face_analysis,... method __del__ (line 535) | def __del__(self):