Merge remote-tracking branch 'origin/main'

This commit is contained in:
kit 2024-04-26 11:56:18 +08:00
parent 72b3880ca8
commit 17580333b8

View file

@ -329,10 +329,10 @@ class AndroidExtEnv(ExtEnv):
if iw > ih:
x, y = y, x
iw, ih = ih, iw
file_url = 'https://huggingface.co/ShilongLiu/GroundingDINO/blob/main/groundingdino_swint_ogc.pth' # 加载远程model
target_folder = Path(f'{DEFAULT_WORKSPACE_ROOT}/weights')
file_path = download_model(file_url, target_folder)
if self.cv_model_status['clip_model_loaded'] == False:
file_url = 'https://huggingface.co/ShilongLiu/GroundingDINO/blob/main/groundingdino_swint_ogc.pth' # 加载远程model
target_folder = Path(f'{DEFAULT_WORKSPACE_ROOT}/weights')
file_path = download_model(file_url, target_folder)
groundingdino_model = load_model(file_path, device=device).eval()
self.cv_model_status['clip_model_loaded'] = True
in_coordinate, out_coordinate = det(image, "icon", groundingdino_model) # 检测icon