SYMBOL INDEX (227 symbols across 23 files) FILE: data/mvtec.py class MVTecSolver (line 5) | class MVTecSolver(object): method __init__ (line 12) | def __init__(self, root='data/mvtec'): method run (line 16) | def run(self): FILE: data/visa.py class VisASolver (line 6) | class VisASolver(object): method __init__ (line 13) | def __init__(self, root='data/visa'): method run (line 19) | def run(self): FILE: dataset.py class VisaDataset (line 10) | class VisaDataset(data.Dataset): method __init__ (line 11) | def __init__(self, root, transform, target_transform, mode='test', k_s... method __len__ (line 38) | def __len__(self): method get_cls_names (line 41) | def get_cls_names(self): method __getitem__ (line 44) | def __getitem__(self, index): class MVTecDataset (line 63) | class MVTecDataset(data.Dataset): method __init__ (line 64) | def __init__(self, root, transform, target_transform, aug_rate, mode='... method __len__ (line 92) | def __len__(self): method get_cls_names (line 95) | def get_cls_names(self): method combine_img (line 98) | def combine_img(self, cls_name): method __getitem__ (line 138) | def __getitem__(self, index): FILE: few_shot.py function memory (line 4) | def memory(model_name, model, obj_list, dataset_dir, save_path, preproce... FILE: loss.py class FocalLoss (line 7) | class FocalLoss(nn.Module): method __init__ (line 21) | def __init__(self, apply_nonlin=None, alpha=None, gamma=2, balance_ind... method forward (line 34) | def forward(self, logit, target): class BinaryDiceLoss (line 89) | class BinaryDiceLoss(nn.Module): method __init__ (line 90) | def __init__(self): method forward (line 93) | def forward(self, input, targets): FILE: model.py class LinearLayer (line 5) | class LinearLayer(nn.Module): method __init__ (line 6) | def __init__(self, dim_in, dim_out, k, model): method forward (line 13) | def forward(self, tokens): FILE: open_clip/coca_model.py class MultimodalCfg (line 45) | class MultimodalCfg(CLIPTextCfg): function _build_text_decoder_tower (line 53) | def _build_text_decoder_tower( class CoCa (line 79) | class CoCa(nn.Module): method __init__ (line 80) | def __init__( method set_grad_checkpointing (line 126) | def set_grad_checkpointing(self, enable=True): method _encode_image (line 135) | def _encode_image(self, images, out_layers, normalize=True): method _encode_text (line 139) | def _encode_text(self, text, normalize=True, embed_cls=True): method encode_image (line 148) | def encode_image(self, images, out_layers, normalize=True): method encode_text (line 152) | def encode_text(self, text, normalize=True, embed_cls=True): method forward (line 156) | def forward(self, image, text, embed_cls=True, image_latent=None, imag... method generate (line 173) | def generate( method _generate_beamsearch (line 296) | def _generate_beamsearch( function prepare_inputs_for_generation (line 445) | def prepare_inputs_for_generation(input_ids, image_inputs, past=None, **... FILE: open_clip/factory.py function _natural_key (line 29) | def _natural_key(string_): function _rescan_model_configs (line 33) | def _rescan_model_configs(): function list_models (line 57) | def list_models(): function add_model_config (line 62) | def add_model_config(path): function get_model_config (line 70) | def get_model_config(model_name): function get_tokenizer (line 77) | def get_tokenizer(model_name): function load_state_dict (line 87) | def load_state_dict(checkpoint_path: str, map_location='cpu'): function load_checkpoint (line 98) | def load_checkpoint(model, checkpoint_path, strict=True): function create_model (line 108) | def create_model( function create_loss (line 286) | def create_loss(args): function create_model_and_transforms (line 317) | def create_model_and_transforms( function create_model_from_pretrained (line 372) | def create_model_from_pretrained( FILE: open_clip/hf_model.py class BaseModelOutput (line 21) | class BaseModelOutput: class PretrainedConfig (line 25) | class PretrainedConfig: function _camel2snake (line 32) | def _camel2snake(s): function register_pooler (line 40) | def register_pooler(cls): class MeanPooler (line 47) | class MeanPooler(nn.Module): method forward (line 50) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class MaxPooler (line 56) | class MaxPooler(nn.Module): method forward (line 59) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class ClsPooler (line 65) | class ClsPooler(nn.Module): method __init__ (line 68) | def __init__(self, use_pooler_output=True): method forward (line 73) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class HFTextEncoder (line 83) | class HFTextEncoder(nn.Module): method __init__ (line 87) | def __init__( method forward (line 137) | def forward(self, x: TensorType): method lock (line 154) | def lock(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True): method set_grad_checkpointing (line 172) | def set_grad_checkpointing(self, enable=True): method init_parameters (line 175) | def init_parameters(self): FILE: open_clip/loss.py function gather_features (line 19) | def gather_features( class ClipLoss (line 66) | class ClipLoss(nn.Module): method __init__ (line 68) | def __init__( method get_ground_truth (line 89) | def get_ground_truth(self, device, num_logits) -> torch.Tensor: method get_logits (line 102) | def get_logits(self, image_features, text_features, logit_scale): method forward (line 120) | def forward(self, image_features, text_features, logit_scale, output_d... class CoCaLoss (line 134) | class CoCaLoss(ClipLoss): method __init__ (line 135) | def __init__( method forward (line 160) | def forward(self, image_features, text_features, logits, labels, logit... class DistillClipLoss (line 176) | class DistillClipLoss(ClipLoss): method dist_loss (line 178) | def dist_loss(self, teacher_logits, student_logits): method forward (line 181) | def forward( FILE: open_clip/model.py class CLIPVisionCfg (line 24) | class CLIPVisionCfg: class CLIPTextCfg (line 49) | class CLIPTextCfg: function get_cast_dtype (line 66) | def get_cast_dtype(precision: str): function _build_vision_tower (line 75) | def _build_vision_tower( function _build_text_tower (line 137) | def _build_text_tower( class CLIP (line 176) | class CLIP(nn.Module): method __init__ (line 179) | def __init__( method lock_image_tower (line 203) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 208) | def set_grad_checkpointing(self, enable=True): method encode_image (line 212) | def encode_image(self, image, out_layers, normalize: bool = False): method encode_text (line 216) | def encode_text(self, text, normalize: bool = False): method forward (line 230) | def forward(self, image, text): class CustomTextCLIP (line 242) | class CustomTextCLIP(nn.Module): method __init__ (line 245) | def __init__( method lock_image_tower (line 260) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 264) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 268) | def set_grad_checkpointing(self, enable=True): method encode_image (line 272) | def encode_image(self, image, normalize: bool = False): method encode_text (line 276) | def encode_text(self, text, normalize: bool = False): method forward (line 280) | def forward(self, image, text): function convert_weights_to_lp (line 292) | def convert_weights_to_lp(model: nn.Module, dtype=torch.float16): function convert_to_custom_text_state_dict (line 320) | def convert_to_custom_text_state_dict(state_dict: dict): function build_model_from_openai_state_dict (line 338) | def build_model_from_openai_state_dict( function trace_model (line 398) | def trace_model(model, batch_size=256, device=torch.device('cpu')): function resize_pos_embed (line 414) | def resize_pos_embed(state_dict, model, interpolation: str = 'bicubic', ... FILE: open_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, out_blocks): FILE: open_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: open_clip/pretrained.py function _pcfg (line 21) | def _pcfg(url='', hf_hub='', mean=None, std=None): function _clean_tag (line 235) | def _clean_tag(tag: str): function list_pretrained (line 240) | def list_pretrained(as_str: bool = False): function list_pretrained_models_by_tag (line 247) | def list_pretrained_models_by_tag(tag: str): function list_pretrained_tags_by_model (line 257) | def list_pretrained_tags_by_model(model: str): function is_pretrained_cfg (line 265) | def is_pretrained_cfg(model: str, tag: str): function get_pretrained_cfg (line 271) | def get_pretrained_cfg(model: str, tag: str): function get_pretrained_url (line 278) | def get_pretrained_url(model: str, tag: str): function download_pretrained_from_url (line 283) | def download_pretrained_from_url( function has_hf_hub (line 329) | def has_hf_hub(necessary=False): function download_pretrained_from_hf (line 337) | def download_pretrained_from_hf( function download_pretrained (line 348) | def download_pretrained( FILE: open_clip/push_to_hf_hub.py function save_config_for_hf (line 27) | def save_config_for_hf( function save_for_hf (line 45) | def save_for_hf( function push_to_hf_hub (line 65) | def push_to_hf_hub( function push_pretrained_to_hf_hub (line 124) | def push_pretrained_to_hf_hub( function generate_readme (line 163) | def generate_readme(model_card: dict, model_name: str): FILE: open_clip/timm_model.py class TimmModel (line 28) | class TimmModel(nn.Module): method __init__ (line 33) | def __init__( method lock (line 85) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 118) | def set_grad_checkpointing(self, enable=True): method forward (line 124) | def forward(self, x): FILE: open_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 decode (line 155) | def decode(output_ids: torch.Tensor): function tokenize (line 159) | def tokenize(texts: Union[str, List[str]], context_length: int = 77) -> ... class HFTokenizer (line 191) | class HFTokenizer: method __init__ (line 194) | def __init__(self, tokenizer_name: str): method save_pretrained (line 198) | def save_pretrained(self, dest): method __call__ (line 201) | def __call__(self, texts: Union[str, List[str]], context_length: int =... FILE: open_clip/transform.py class AugmentationCfg (line 16) | class AugmentationCfg: class ResizeMaxSize (line 26) | class ResizeMaxSize(nn.Module): method __init__ (line 28) | def __init__(self, max_size, interpolation=InterpolationMode.BICUBIC, ... method forward (line 37) | def forward(self, img): function _convert_to_rgb (line 52) | def _convert_to_rgb(image): function image_transform (line 56) | def image_transform( FILE: open_clip/transformer.py class LayerNormFp32 (line 14) | class LayerNormFp32(nn.LayerNorm): method forward (line 17) | def forward(self, x: torch.Tensor): class LayerNorm (line 23) | class LayerNorm(nn.LayerNorm): method forward (line 26) | def forward(self, x: torch.Tensor): class QuickGELU (line 32) | class QuickGELU(nn.Module): method forward (line 34) | def forward(self, x: torch.Tensor): class LayerScale (line 38) | class LayerScale(nn.Module): method __init__ (line 39) | def __init__(self, dim, init_values=1e-5, inplace=False): method forward (line 44) | def forward(self, x): class PatchDropout (line 48) | class PatchDropout(nn.Module): method __init__ (line 53) | def __init__(self, prob, exclude_first_token=True): method forward (line 59) | def forward(self, x): class Attention (line 88) | class Attention(nn.Module): method __init__ (line 89) | def __init__( method forward (line 128) | def forward(self, x, attn_mask: Optional[torch.Tensor] = None): class AttentionalPooler (line 164) | class AttentionalPooler(nn.Module): method __init__ (line 165) | def __init__( method forward (line 179) | def forward(self, x: torch.Tensor): method _repeat (line 186) | def _repeat(self, query, N: int): class ResidualAttentionBlock (line 190) | class ResidualAttentionBlock(nn.Module): method __init__ (line 191) | def __init__( method attention (line 221) | def attention( method forward (line 236) | def forward( class CustomResidualAttentionBlock (line 252) | class CustomResidualAttentionBlock(nn.Module): method __init__ (line 253) | def __init__( method forward (line 287) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 293) | class Transformer(nn.Module): method __init__ (line 294) | def __init__( method get_cast_dtype (line 316) | def get_cast_dtype(self) -> torch.dtype: method forward (line 319) | def forward(self, x: torch.Tensor, out_layers: list = [3, 6, 9], class VisionTransformer (line 342) | class VisionTransformer(nn.Module): method __init__ (line 345) | def __init__( method lock (line 415) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method init_parameters (line 448) | def init_parameters(self): method set_grad_checkpointing (line 469) | def set_grad_checkpointing(self, enable=True): method _global_pool (line 472) | def _global_pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.T... method forward (line 478) | def forward(self, x: torch.Tensor, out_layers: list): class TextTransformer (line 537) | class TextTransformer(nn.Module): method __init__ (line 540) | def __init__( method init_parameters (line 588) | def init_parameters(self): method set_grad_checkpointing (line 607) | def set_grad_checkpointing(self, enable=True): method build_attention_mask (line 610) | def build_attention_mask(self): method build_cls_mask (line 618) | def build_cls_mask(self, text, cast_dtype: torch.dtype): method _repeat (line 627) | def _repeat(self, t, N: int): method forward (line 630) | def forward(self, text): class MultimodalTransformer (line 665) | class MultimodalTransformer(Transformer): method __init__ (line 666) | def __init__( method init_parameters (line 707) | def init_parameters(self): method build_attention_mask (line 725) | def build_attention_mask(self): method forward (line 733) | def forward(self, image_embs, text_embs): method set_grad_checkpointing (line 756) | def set_grad_checkpointing(self, enable=True): FILE: open_clip/utils.py function freeze_batch_norm_2d (line 8) | def freeze_batch_norm_2d(module, module_match={}, name=''): function _ntuple (line 48) | def _ntuple(n): FILE: prompt_ensemble.py function encode_text_with_prompt_ensemble (line 8) | def encode_text_with_prompt_ensemble(model, objs, tokenizer, device): FILE: test.py function setup_seed (line 23) | def setup_seed(seed): function normalize (line 32) | def normalize(pred, max_value=None, min_value=None): function apply_ad_scoremap (line 39) | def apply_ad_scoremap(image, scoremap, alpha=0.5): function cal_pro_score (line 47) | def cal_pro_score(masks, amaps, max_step=200, expect_fpr=0.3): function test (line 74) | def test(args): FILE: train.py function setup_seed (line 22) | def setup_seed(seed): function train (line 31) | def train(args):