-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
647a1bd
commit 5394c78
Showing
134 changed files
with
10,615 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# ovsam | ||
# Open-Vocabulary SAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
meta_dict = { | ||
'vit_h': dict( | ||
encoder_embed_dim=1280, | ||
encoder_depth=32, | ||
encoder_num_heads=16, | ||
encoder_global_attn_indexes=[7, 15, 23, 31], | ||
# common | ||
prompt_embed_dim=256, | ||
image_size=1024, | ||
vit_patch_size=16, | ||
image_embedding_size=64 | ||
), | ||
'vit_l': dict( | ||
encoder_embed_dim=1024, | ||
encoder_depth=24, | ||
encoder_num_heads=16, | ||
encoder_global_attn_indexes=[5, 11, 17, 23], | ||
# common | ||
prompt_embed_dim=256, | ||
image_size=1024, | ||
vit_patch_size=16, | ||
image_embedding_size=64 | ||
), | ||
'vit_b': dict( | ||
encoder_embed_dim=768, | ||
encoder_depth=12, | ||
encoder_num_heads=12, | ||
encoder_global_attn_indexes=[2, 5, 8, 11], | ||
# common | ||
prompt_embed_dim=256, | ||
image_size=1024, | ||
vit_patch_size=16, | ||
image_embedding_size=64 | ||
) | ||
} | ||
|
||
checkpoint_dict = { | ||
'vit_h': 'https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth', | ||
'vit_l': 'https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth', | ||
'vit_b': 'https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .coca_model import CoCa | ||
from .constants import OPENAI_DATASET_MEAN, OPENAI_DATASET_STD | ||
from .factory import create_model, create_model_and_transforms, create_model_from_pretrained, get_tokenizer, create_loss | ||
from .factory import list_models, add_model_config, get_model_config, load_checkpoint | ||
from .loss import ClipLoss, DistillClipLoss, CoCaLoss | ||
from .model import CLIP, CustomTextCLIP, CLIPTextCfg, CLIPVisionCfg, \ | ||
convert_weights_to_lp, convert_weights_to_fp16, trace_model, get_cast_dtype, get_input_dtype | ||
from .openai import load_openai_model, list_openai_models | ||
from .pretrained import list_pretrained, list_pretrained_models_by_tag, list_pretrained_tags_by_model, \ | ||
get_pretrained_url, download_pretrained_from_url, is_pretrained_cfg, get_pretrained_cfg, download_pretrained | ||
from .push_to_hf_hub import push_pretrained_to_hf_hub, push_to_hf_hub | ||
from .tokenizer import SimpleTokenizer, tokenize, decode | ||
from .transform import image_transform, AugmentationCfg | ||
from .zero_shot_classifier import build_zero_shot_classifier, build_zero_shot_classifier_legacy | ||
from .zero_shot_metadata import OPENAI_IMAGENET_TEMPLATES, SIMPLE_IMAGENET_TEMPLATES, IMAGENET_CLASSNAMES |
Binary file not shown.
Oops, something went wrong.