Skip to content

Commit

Permalink
add grounding dino new config & fix scripts bugs (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlongLiu committed Apr 13, 2023
1 parent fbf63e8 commit ecf7deb
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GroundingDINO/demo/inference_on_a_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_grounding_output(model, image, caption, box_threshold, text_threshold, w
text_prompt = args.text_prompt
output_dir = args.output_dir
box_threshold = args.box_threshold
text_threshold = args.box_threshold
text_threshold = args.text_threshold

# make dir
os.makedirs(output_dir, exist_ok=True)
Expand Down
43 changes: 43 additions & 0 deletions GroundingDINO/groundingdino/config/GroundingDINO_SwinB.cfg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
batch_size = 1
modelname = "groundingdino"
backbone = "swin_B_384_22k"
position_embedding = "sine"
pe_temperatureH = 20
pe_temperatureW = 20
return_interm_indices = [1, 2, 3]
backbone_freeze_keywords = None
enc_layers = 6
dec_layers = 6
pre_norm = False
dim_feedforward = 2048
hidden_dim = 256
dropout = 0.0
nheads = 8
num_queries = 900
query_dim = 4
num_patterns = 0
num_feature_levels = 4
enc_n_points = 4
dec_n_points = 4
two_stage_type = "standard"
two_stage_bbox_embed_share = False
two_stage_class_embed_share = False
transformer_activation = "relu"
dec_pred_bbox_embed_share = True
dn_box_noise_scale = 1.0
dn_label_noise_ratio = 0.5
dn_label_coef = 1.0
dn_bbox_coef = 1.0
embed_init_tgt = True
dn_labelbook_size = 2000
max_text_len = 256
text_encoder_type = "bert-base-uncased"
use_text_enhancer = True
use_fusion_layer = True
use_checkpoint = True
use_transformer_ckpt = True
use_text_cross_attention = True
text_dropout = 0.0
fusion_dropout = 0.0
fusion_droppath = 0.1
sub_sentence_present = True
2 changes: 1 addition & 1 deletion automatic_label_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def save_mask_data(output_dir, caption, mask_list, box_list, label_list):
openai_proxy = args.openai_proxy
output_dir = args.output_dir
box_threshold = args.box_threshold
text_threshold = args.box_threshold
text_threshold = args.text_threshold
iou_threshold = args.iou_threshold
device = args.device

Expand Down
2 changes: 1 addition & 1 deletion grounded_sam_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def save_mask_data(output_dir, mask_list, box_list, label_list):
text_prompt = args.text_prompt
output_dir = args.output_dir
box_threshold = args.box_threshold
text_threshold = args.box_threshold
text_threshold = args.text_threshold
device = args.device

# make dir
Expand Down
2 changes: 1 addition & 1 deletion grounded_sam_inpainting_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def show_box(box, ax, label):
inpaint_prompt = args.inpaint_prompt
output_dir = args.output_dir
box_threshold = args.box_threshold
text_threshold = args.box_threshold
text_threshold = args.text_threshold
inpaint_mode = args.inpaint_mode
device = args.device

Expand Down
2 changes: 1 addition & 1 deletion grounded_sam_whisper_inpainting_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def filter_prompts_with_chatgpt(caption, max_tokens=100, model="gpt-3.5-turbo"):

output_dir = args.output_dir
box_threshold = args.box_threshold
text_threshold = args.box_threshold
text_threshold = args.text_threshold
inpaint_mode = args.inpaint_mode
device = args.device

Expand Down

0 comments on commit ecf7deb

Please sign in to comment.