kevinssy commited on
Commit
d91874f
1 Parent(s): 932ae27

Update sam/utils.py

Browse files
Files changed (1) hide show
  1. sam/utils.py +12 -7
sam/utils.py CHANGED
@@ -230,10 +230,15 @@ def visualize_attention(arr, filename):
230
 
231
 
232
  # Build config
233
- def build_sam_config(config_path):
234
- with open(config_path, 'r') as infile:
235
- config = json.load(infile)
236
-
237
- sam_checkpoint = config['model']['sam_checkpoint']
238
- model_type = config['model']['model_type']
239
- return sam_checkpoint, model_type
 
 
 
 
 
 
230
 
231
 
232
  # Build config
233
+ # def build_sam_config(config_path):
234
+ # with open(config_path, 'r') as infile:
235
+ # config = json.load(infile)
236
+
237
+ # sam_checkpoint = config['model']['sam_checkpoint']
238
+ # model_type = config['model']['model_type']
239
+ # return sam_checkpoint, model_type
240
+
241
+ def build_sam_config(config):
242
+ sam_checkpoint = config.sam.sam_checkpoint
243
+ model_type = config.sam.model_type
244
+ return sam_checkpoint, model_type