(self, device)
| 1025 | |
| 1026 | class 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" |
nothing calls this directly
no test coverage detected