Download src/GroundingDINO/docker_test.py from labai-mf/LASER: direct link, hf CLI and curl.
- Browser
- Download file 292 Bytes
-
https://huggingface.co/spaces/labai-mf/LASER/resolve/main/src/GroundingDINO/docker_test.py
- Command line
-
hf download hf://spaces/labai-mf/LASER/src/GroundingDINO/docker_test.py
-
curl -L -o docker_test.py https://huggingface.co/spaces/labai-mf/LASER/resolve/main/src/GroundingDINO/docker_test.py
292 Bytes
| from groundingdino.util.inference import load_model, load_image, predict, annotate | |
| import torch | |
| import cv2 | |
| model = load_model("groundingdino/config/GroundingDINO_SwinT_OGC.pyy", "weights/groundingdino_swint_ogc.pth") | |
| model = model.to('cuda:0') | |
| print(torch.cuda.is_available()) | |
| print('DONE!') |