Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/caoql98/DCPL
/ functions
Functions
184 in github.com/caoql98/DCPL
⨍
Functions
184
◇
Types & classes
54
↓ 11 callers
Method
subsample_classes
Divide classes into two groups. The first group represents base classes while the second group represents new classes. Args:
datasets/oxford_pets.py:141
↓ 9 callers
Method
__init__
(self, embed_dim: int, # vision image_resolution: int,
clip/model.py:480
↓ 9 callers
Method
read_split
(filepath, path_prefix)
datasets/oxford_pets.py:123
↓ 9 callers
Method
save_split
(train, val, test, filepath, path_prefix)
datasets/oxford_pets.py:100
↓ 6 callers
Method
encode
(self, text)
clip/simple_tokenizer.py:121
↓ 5 callers
Method
read_classnames
Return a dictionary containing key-value pairs of <folder name>: <class name>.
datasets/imagenet.py:64
↓ 4 callers
Method
_make_layer
(self, planes, blocks, stride=1)
clip/model.py:126
↓ 4 callers
Method
encode_text
(self, text)
clip/model.py:598
↓ 4 callers
Method
read_and_split_data
(image_dir, p_trn=0.5, p_val=0.2, ignored=[], new_cnames=None)
datasets/dtd.py:54
↓ 4 callers
Method
split_trainval
(trainval, p_val=0.2)
datasets/oxford_pets.py:77
↓ 3 callers
Function
load_clip_to_cpu
(cfg)
trainers/vpt.py:21
↓ 3 callers
Method
read_data
(self, cname2lab, split_file)
datasets/fgvc_aircraft.py:56
↓ 2 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/DCPL.py:199
↓ 2 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/independentVL.py:155
↓ 2 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/coop.py:189
↓ 2 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/maple.py:180
↓ 2 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/cocoop.py:168
↓ 2 callers
Function
_transform
(n_px)
clip/clip.py:71
↓ 2 callers
Method
build_model
(self)
trainers/vpt.py:122
↓ 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/simple_tokenizer.py:16
↓ 2 callers
Method
encode_image
(self, image)
clip/model.py:595
↓ 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/simple_tokenizer.py:38
↓ 2 callers
Function
parse_function
(*metrics, directory="", args=None, end_signal=None)
parse_test_res.py:64
↓ 2 callers
Function
patch_device
(module)
clip/clip.py:136
↓ 2 callers
Function
patch_float
(module)
clip/clip.py:160
↓ 2 callers
Method
read_data
(self, classnames, split_dir)
datasets/imagenet.py:78
↓ 2 callers
Method
read_data
(self, split_file)
datasets/oxford_pets.py:56
↓ 2 callers
Method
read_data
(self, cname2lab, text_file)
datasets/sun397.py:61
↓ 2 callers
Method
read_data
(self, cname2lab, text_file)
datasets/ucf101.py:64
↓ 2 callers
Method
read_data
(self, image_dir, anno_file, meta_file)
datasets/stanford_cars.py:57
↓ 1 callers
Method
__init__
(self, cfg, classnames, clip_model)
trainers/vpt.py:93
↓ 1 callers
Function
_download
(url: str, root: str = os.path.expanduser("~/.cache/clip"))
clip/clip.py:39
↓ 1 callers
Function
_get_clones
(module, N)
trainers/DCPL.py:268
↓ 1 callers
Function
_get_clones
(module, N)
trainers/maple.py:207
↓ 1 callers
Method
attention
(self, x: torch.Tensor)
clip/model.py:181
↓ 1 callers
Method
attention
(self, x: torch.Tensor)
clip/model.py:225
↓ 1 callers
Method
attention
(self, x: torch.Tensor)
clip/model.py:283
↓ 1 callers
Function
available_models
Returns the names of available CLIP models
clip/clip.py:81
↓ 1 callers
Function
basic_clean
(text)
clip/simple_tokenizer.py:50
↓ 1 callers
Function
binary_search
(c_left, c_right, seed, step, test_acc_step_list)
lpclip/linear_probe.py:69
↓ 1 callers
Method
bpe
(self, token)
clip/simple_tokenizer.py:80
↓ 1 callers
Method
build_attention_mask
(self)
clip/model.py:583
↓ 1 callers
Function
build_model
(state_dict: dict, design_details)
clip/model.py:654
↓ 1 callers
Method
build_model
(self)
trainers/DCPL.py:277
↓ 1 callers
Method
build_model
(self)
trainers/independentVL.py:187
↓ 1 callers
Method
build_model
(self)
trainers/coop.py:225
↓ 1 callers
Method
build_model
(self)
trainers/maple.py:216
↓ 1 callers
Method
build_model
(self)
trainers/cocoop.py:205
↓ 1 callers
Function
compute_ci95
(res)
parse_test_res.py:60
↓ 1 callers
Method
construct_prompts
(self, ctx, prefix, suffix, label=None)
trainers/DCPL.py:144
↓ 1 callers
Method
construct_prompts
(self, ctx, prefix, suffix, label=None)
trainers/independentVL.py:121
↓ 1 callers
Method
construct_prompts
(self, ctx, prefix, suffix, label=None)
trainers/maple.py:138
↓ 1 callers
Method
construct_prompts
(self, ctx, prefix, suffix, label=None)
trainers/cocoop.py:126
↓ 1 callers
Function
convert_weights
Convert applicable model parameters to fp16
clip/model.py:630
↓ 1 callers
Method
decode
(self, tokens)
clip/simple_tokenizer.py:129
↓ 1 callers
Function
default_bpe
()
clip/simple_tokenizer.py:11
↓ 1 callers
Function
extend_cfg
Add new config variables. E.g. from yacs.config import CfgNode as CN cfg.TRAINER.MY_MODEL = CN() cfg.TRAINER.MY_MODE
train.py:79
↓ 1 callers
Function
extend_cfg
Add new config variables. E.g. from yacs.config import CfgNode as CN cfg.TRAINER.MY_MODEL = CN() cfg.TRAINER.MY_MODE
lpclip/feat_extractor.py:65
↓ 1 callers
Method
forward
(self, image, text)
clip/model.py:613
↓ 1 callers
Method
initialize_parameters
(self)
clip/model.py:554
↓ 1 callers
Function
load_clip_to_cpu
(cfg)
trainers/DCPL.py:21
↓ 1 callers
Function
load_clip_to_cpu
(cfg)
trainers/independentVL.py:21
↓ 1 callers
Function
load_clip_to_cpu
(cfg)
trainers/coop.py:19
↓ 1 callers
Function
load_clip_to_cpu
(cfg)
trainers/maple.py:21
↓ 1 callers
Function
load_clip_to_cpu
(cfg)
trainers/cocoop.py:21
↓ 1 callers
Function
load_clip_to_cpu
(backbone_name="ViT-B/16")
interpret_prompts/interpret_prompt.py:11
↓ 1 callers
Method
load_model
(self, directory, epoch=None)
trainers/vpt.py:207
↓ 1 callers
Function
main
(args)
train.py:155
↓ 1 callers
Function
main
(args, end_signal)
parse_test_res.py:126
↓ 1 callers
Function
main
(args)
lpclip/feat_extractor.py:105
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/DCPL.py:358
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/independentVL.py:265
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/vpt.py:200
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/coop.py:289
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/maple.py:294
↓ 1 callers
Method
parse_batch_train
(self, batch)
trainers/cocoop.py:279
↓ 1 callers
Function
print_args
(args, cfg)
train.py:33
↓ 1 callers
Function
print_args
(args, cfg)
lpclip/feat_extractor.py:34
↓ 1 callers
Method
read_data
(self)
datasets/oxford_flowers.py:57
↓ 1 callers
Method
read_data
(self, classnames)
datasets/imagenetv2.py:31
↓ 1 callers
Method
read_data
(self, classnames)
datasets/imagenet_sketch.py:30
↓ 1 callers
Method
read_data
(self, classnames)
datasets/imagenet_r.py:32
↓ 1 callers
Method
read_data
(self, classnames)
datasets/imagenet_a.py:32
↓ 1 callers
Function
reset_cfg
(cfg, args)
train.py:47
↓ 1 callers
Function
reset_cfg
(cfg, args)
lpclip/feat_extractor.py:48
↓ 1 callers
Method
return_fixed_embeddings
(self)
trainers/vpt.py:88
↓ 1 callers
Function
setup_cfg
(args)
train.py:132
↓ 1 callers
Function
setup_cfg
(args)
lpclip/feat_extractor.py:85
↓ 1 callers
Function
whitespace_clean
(text)
clip/simple_tokenizer.py:56
Method
__init__
(self, bpe_path: str = default_bpe())
clip/simple_tokenizer.py:63
Method
__init__
(self, inplanes, planes, stride=1)
clip/model.py:13
Method
__init__
(self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int = None)
clip/model.py:57
Method
__init__
(self, layers, output_dim, heads, input_resolution=224, width=64)
clip/model.py:101
Method
__init__
(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None)
clip/model.py:168
Method
__init__
(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None, add_prompt=False, text_laye
clip/model.py:192
Method
__init__
(self, d_model: int, n_head: int, attn_mask: torch.Tensor = None, design_details=None, text_l
clip/model.py:260
Method
__init__
(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None, prompts_needed=0,
clip/model.py:335
Method
__init__
(self, input_resolution: int, patch_size: int, width: int, layers: int, heads: int, output_di
clip/model.py:363
Method
__init__
(self, input_resolution: int, patch_size: int, width: int, layers: int, heads: int, output_dim: int,
clip/model.py:426
Method
__init__
(self, clip_model)
trainers/DCPL.py:44
next →
1–100 of 184, ranked by callers