Update Garage/models/GroundedSegmentAnything/GroundingDINO/groundingdino/util/inference.py
Browse files
Garage/models/GroundedSegmentAnything/GroundingDINO/groundingdino/util/inference.py
CHANGED
@@ -34,7 +34,8 @@ def load_model(model_config_path: str, model_checkpoint_path: str, device: str =
|
|
34 |
args = SLConfig.fromfile(model_config_path)
|
35 |
args.device = device
|
36 |
model = build_model(args)
|
37 |
-
checkpoint = torch.load(model_checkpoint_path, map_location="cpu")
|
|
|
38 |
model.load_state_dict(clean_state_dict(checkpoint["model"]), strict=False)
|
39 |
model.eval()
|
40 |
return model
|
|
|
34 |
args = SLConfig.fromfile(model_config_path)
|
35 |
args.device = device
|
36 |
model = build_model(args)
|
37 |
+
# checkpoint = torch.load(model_checkpoint_path, map_location="cpu")
|
38 |
+
checkpoint = torch.utils.model_zoo.load_url(model_checkpoint_path, map_location="cpu")
|
39 |
model.load_state_dict(clean_state_dict(checkpoint["model"]), strict=False)
|
40 |
model.eval()
|
41 |
return model
|