MCPcopy Create free account
hub / github.com/chenfei-wu/TaskMatrix / __init__

Method __init__

visual_chatgpt.py:1027–1036  ·  view source on GitHub ↗
(self, device)

Source from the content-addressed store, hash-verified

1025
1026class Text2Box:
1027 def __init__(self, device):
1028 print(f"Initializing ObjectDetection to {device}")
1029 self.device = device
1030 self.torch_dtype = torch.float16 if 'cuda' in device else torch.float32
1031 self.model_checkpoint_path = os.path.join("checkpoints","groundingdino")
1032 self.model_config_path = os.path.join("checkpoints","grounding_config.py")
1033 self.download_parameters()
1034 self.box_threshold = 0.3
1035 self.text_threshold = 0.25
1036 self.grounding = (self.load_model()).to(self.device)
1037
1038 def download_parameters(self):
1039 url = "https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth"

Callers

nothing calls this directly

Calls 2

download_parametersMethod · 0.95
load_modelMethod · 0.95

Tested by

no test coverage detected