Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MediaBrain-SJTU/MVFA-AD
/ functions
Functions
142 in github.com/MediaBrain-SJTU/MVFA-AD
⨍
Functions
142
◇
Types & classes
28
↓ 9 callers
Method
__init__
( self, dim, num_heads=8, qkv_bias=True, scaled_co
CLIP/transformer.py:96
↓ 4 callers
Method
_make_layer
(self, planes, blocks, stride=1)
CLIP/modified_resnet.py:169
↓ 4 callers
Function
augment
(fewshot_img, fewshot_mask=None)
utils.py:79
↓ 4 callers
Function
cos_sim
(a, b, eps=1e-8)
utils.py:32
↓ 4 callers
Function
create_model
( model_name: str, img_size: int, pretrained: Optional[str] = None, precision:
CLIP/clip.py:84
↓ 4 callers
Function
encode_text_with_prompt_ensemble
(model, obj, device)
utils.py:9
↓ 3 callers
Method
_global_pool
(self, x: torch.Tensor)
CLIP/transformer.py:479
↓ 3 callers
Function
convert_weights_to_lp
Convert applicable model parameters to low-precision (bf16 or fp16)
CLIP/model.py:265
↓ 3 callers
Function
get_cast_dtype
(precision: str)
CLIP/model.py:63
↓ 3 callers
Function
hflip_img
(x)
utils.py:63
↓ 3 callers
Method
lock
(self, unlocked_groups=0, freeze_bn_stats=False)
CLIP/transformer.py:422
↓ 3 callers
Function
rot_img
(x, theta)
utils.py:49
↓ 3 callers
Function
translation_img
(x, a, b)
utils.py:56
↓ 3 callers
Function
vflip_img
(x)
utils.py:67
↓ 2 callers
Method
__init__
(self, inplanes, planes, stride=1)
CLIP/modified_resnet.py:50
↓ 2 callers
Function
_build_text_tower
( embed_dim: int, text_cfg: CLIPTextCfg, quick_gelu: bool = False, cast_dtype:
CLIP/model.py:120
↓ 2 callers
Function
_build_vision_tower
( embed_dim: int, vision_cfg: CLIPVisionCfg, quick_gelu: bool = False, cast_dt
CLIP/model.py:72
↓ 2 callers
Function
build_model_from_openai_state_dict
( state_dict: dict, quick_gelu=True, cast_dtype=torch.float16, )
CLIP/model.py:311
↓ 2 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
CLIP/tokenizer.py:28
↓ 2 callers
Method
encode_text
(self, text, normalize: bool = False)
CLIP/model.py:190
↓ 2 callers
Method
get_cast_dtype
(self)
CLIP/transformer.py:323
↓ 2 callers
Function
get_model_config
(model_name)
CLIP/clip.py:53
↓ 2 callers
Function
get_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
CLIP/tokenizer.py:50
↓ 2 callers
Function
load_openai_model
Load a CLIP model Parameters ---------- name : str A model name listed by `clip.available_models()`, or the path to a model check
CLIP/openai.py:17
↓ 2 callers
Function
patch_device
(module)
CLIP/openai.py:89
↓ 2 callers
Function
patch_float
(module)
CLIP/openai.py:113
↓ 2 callers
Function
resize_pos_embed
(state_dict, model, interpolation: str = 'bicubic', antialias: bool = True)
CLIP/model.py:395
↓ 2 callers
Method
set_grad_checkpointing
(self, enable=True)
CLIP/model.py:181
↓ 1 callers
Method
__init__
(self, apply_nonlin=None, alpha=None, gamma=2, balance_index=0, smooth=1e-5, size_average=True)
loss.py:21
↓ 1 callers
Method
__init__
(self, c_in, bottleneck=768)
CLIP/adapter.py:15
↓ 1 callers
Method
__init__
( self, embed_dim: int, vision_cfg: CLIPVisionCfg, text_cfg: C
CLIP/model.py:152
↓ 1 callers
Function
_natural_key
(string_)
CLIP/clip.py:19
↓ 1 callers
Function
_ntuple
(n)
CLIP/transformer.py:12
↓ 1 callers
Function
_ntuple
(n)
CLIP/model.py:387
↓ 1 callers
Method
_repeat
(self, query, N: int)
CLIP/transformer.py:193
↓ 1 callers
Method
_repeat
(self, t, N: int)
CLIP/transformer.py:630
↓ 1 callers
Function
_rescan_model_configs
()
CLIP/clip.py:23
↓ 1 callers
Method
attention
( self, q_x: torch.Tensor, k_x: Optional[torch.Tensor] = None,
CLIP/transformer.py:228
↓ 1 callers
Function
basic_clean
(text)
CLIP/tokenizer.py:62
↓ 1 callers
Method
bpe
(self, token)
CLIP/tokenizer.py:92
↓ 1 callers
Method
build_attention_mask
(self)
CLIP/transformer.py:613
↓ 1 callers
Method
build_attention_mask
(self)
CLIP/transformer.py:728
↓ 1 callers
Method
build_cls_mask
(self, text, cast_dtype: torch.dtype)
CLIP/transformer.py:621
↓ 1 callers
Function
convert_to_custom_text_state_dict
(state_dict: dict)
CLIP/model.py:293
↓ 1 callers
Method
decode
(self, tokens)
CLIP/tokenizer.py:141
↓ 1 callers
Function
default_bpe
()
CLIP/tokenizer.py:23
↓ 1 callers
Method
encode
(self, text)
CLIP/tokenizer.py:133
↓ 1 callers
Method
encode_image
(self, image, out_layers, normalize: bool = False)
CLIP/model.py:185
↓ 1 callers
Method
encode_image
(self, image, normalize: bool = False)
CLIP/model.py:245
↓ 1 callers
Method
encode_text
(self, text, normalize: bool = False)
CLIP/model.py:249
↓ 1 callers
Function
freeze_batch_norm_2d
Converts all `BatchNorm2d` and `SyncBatchNorm` layers of provided module into `FrozenBatchNorm2d`. If `module` is itself an instance of eithe
CLIP/modified_resnet.py:8
↓ 1 callers
Method
get_few_abnormal
(self)
dataset/medical_few.py:130
↓ 1 callers
Method
get_few_normal
(self)
dataset/medical_few.py:98
↓ 1 callers
Function
get_rot_mat
(theta)
utils.py:40
↓ 1 callers
Function
get_translation_mat
(a, b)
utils.py:45
↓ 1 callers
Method
init_parameters
(self)
CLIP/modified_resnet.py:178
↓ 1 callers
Method
init_parameters
(self)
CLIP/transformer.py:455
↓ 1 callers
Method
init_parameters
(self)
CLIP/transformer.py:591
↓ 1 callers
Function
load_checkpoint
(model, checkpoint_path, strict=True)
CLIP/clip.py:74
↓ 1 callers
Method
load_dataset_folder
(self, seg_flag)
dataset/medical_few.py:73
↓ 1 callers
Method
load_dataset_folder
(self)
dataset/medical_zero.py:73
↓ 1 callers
Method
load_dataset_folder
(self, seg_flag)
dataset/medical_zero.py:220
↓ 1 callers
Function
load_state_dict
(checkpoint_path: str, map_location='cpu')
CLIP/clip.py:62
↓ 1 callers
Function
main
()
train_few.py:40
↓ 1 callers
Function
main
()
train_zero.py:41
↓ 1 callers
Function
main
()
test_few.py:40
↓ 1 callers
Function
main
()
test_zero.py:41
↓ 1 callers
Function
setup_seed
(seed)
train_few.py:30
↓ 1 callers
Function
setup_seed
(seed)
train_zero.py:32
↓ 1 callers
Function
setup_seed
(seed)
test_few.py:30
↓ 1 callers
Function
setup_seed
(seed)
test_zero.py:32
↓ 1 callers
Method
shuffle_dataset
(self)
dataset/medical_zero.py:123
↓ 1 callers
Method
stem
(self, x)
CLIP/modified_resnet.py:203
↓ 1 callers
Function
test
(args, model, test_loader, text_features, seg_mem_features, det_mem_features)
train_few.py:194
↓ 1 callers
Function
test
(args, seg_model, test_loader, text_features)
train_zero.py:177
↓ 1 callers
Function
test
(args, model, test_loader, text_features, seg_mem_features, det_mem_features)
test_few.py:133
↓ 1 callers
Function
test
(args, seg_model, test_loader, text_features)
test_zero.py:101
↓ 1 callers
Function
tokenize
Returns the tokenized representation of given input string(s) Parameters ---------- texts : Union[str, List[str]] An input st
CLIP/tokenizer.py:150
↓ 1 callers
Function
whitespace_clean
(text)
CLIP/tokenizer.py:68
Method
__getitem__
(self, idx)
dataset/medical_few.py:53
Method
__getitem__
(self, idx)
dataset/medical_zero.py:43
Method
__getitem__
(self, idx)
dataset/medical_zero.py:200
Method
__init__
(self)
loss.py:90
Method
__init__
(self, dataset_path='/data/', class_name='Brain', resize=24
dataset/medical_few.py:15
Method
__init__
(self, dataset_path='/data/', class_name='Brain', resize=24
dataset/medical_zero.py:15
Method
__init__
(self, dataset_path='/data/', class_name='Brain', resize=24
dataset/medical_zero.py:174
Method
__init__
(self, clip_model, features)
CLIP/adapter.py:33
Method
__init__
(self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int = None)
CLIP/modified_resnet.py:96
Method
__init__
(self, layers, output_dim, heads, image_size=224, width=64)
CLIP/modified_resnet.py:140
Method
__init__
(self, bpe_path: str = default_bpe())
CLIP/tokenizer.py:75
Method
__init__
(self, dim, init_values=1e-5, inplace=False)
CLIP/transformer.py:46
Method
__init__
(self, prob, exclude_first_token=True)
CLIP/transformer.py:60
Method
__init__
( self, d_model: int, context_dim: int, n_head: int = 8,
CLIP/transformer.py:172
Method
__init__
( self, d_model: int, n_head: int, mlp_ratio: float = 4.0,
CLIP/transformer.py:198
Method
__init__
( self, d_model: int, n_head: int, mlp_ratio: float = 4.0,
CLIP/transformer.py:260
Method
__init__
( self, width: int, layers: int, heads: int, mlp_r
CLIP/transformer.py:301
Method
__init__
( self, image_size: int, patch_size: int, width: int,
CLIP/transformer.py:353
Method
__init__
( self, context_length: int = 77, vocab_size: int = 49408, wid
CLIP/transformer.py:543
Method
__init__
( self, width: int, layers: int, heads: int, conte
CLIP/transformer.py:669
Method
__init__
( self, embed_dim: int, vision_cfg: CLIPVisionCfg, text_cfg: C
CLIP/model.py:218
next →
1–100 of 142, ranked by callers