{"id":28146,"library":"rf-groundingdino","title":"Grounding DINO (Roboflow Fork)","description":"A Roboflow-maintained fork of Grounding DINO, a state-of-the-art open-set object detector that can detect arbitrary objects based on text prompts. Version 0.3.0 combines image and text encoders with a transformer-based fusion approach. Release cadence is irregular; actively maintained.","status":"active","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/roboflow/GroundingDINO","tags":["object detection","open-set detection","grounding","transformers","roboflow"],"install":[{"cmd":"pip install rf-groundingdino","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Core dependency for model computation","package":"torch","optional":false},{"reason":"Required for text encoder (BERT-based)","package":"transformers","optional":false},{"reason":"Used for detection result processing (loading, annotation)","package":"supervision","optional":true}],"imports":[{"note":"The package name was changed to rf_groundingdino in v0.1.2 to avoid conflicts. Direct import of 'groundingdino' fails.","wrong":"import groundingdino","symbol":"groundingdino","correct":"from rf_groundingdino import groundingdino"},{"note":"Common mistake: using old import path without 'rf_' prefix.","wrong":"from groundingdino.util.inference import load_model","symbol":"load_model","correct":"from rf_groundingdino.util.inference import load_model"},{"note":"Same as above, import path changed after package rename.","wrong":"from groundingdino.util.inference import predict","symbol":"predict","correct":"from rf_groundingdino.util.inference import predict"}],"quickstart":{"code":"from rf_groundingdino import groundingdino\nfrom rf_groundingdino.util.inference import load_model, predict\nimport torch\n\ndevice = 'cuda' if torch.cuda.is_available() else 'cpu'\nmodel = load_model('groundingdino_swint_ogc', 'path/to/config.py', 'path/to/weights.pth')\n\n# For inference, use predict() or model()\nimport cv2\nimage = cv2.imread('image.jpg')\nprompts = 'cat . dog .'  # separate classes with ' . '\nboxes, logits, phrases = predict(model, image, prompts, box_threshold=0.3, text_threshold=0.25)\nprint('Detections:', len(phrases))","lang":"python","description":"Load the model and run inference on an image with text prompts."},"warnings":[{"fix":"Change imports: 'import groundingdino' -> 'from rf_groundingdino import groundingdino'","message":"Package renamed from 'groundingdino' to 'rf_groundingdino' in v0.1.2. All imports must use 'rf_groundingdino' prefix.","severity":"breaking","affected_versions":">=0.1.2"},{"fix":"Use format: 'cat . dog . person' (note the spaces around the dot).","message":"The predict() function expects prompts in a specific format: separate each class with ' . ' (space-dot-space). Omitting spaces or using different separators leads to zero detections.","severity":"gotcha","affected_versions":"all"},{"fix":"Download weights from https://github.com/roboflow/GroundingDINO/releases and provide the path.","message":"Model weights are not included in pip install. You must download them manually from the GitHub releases page.","severity":"gotcha","affected_versions":"all"},{"fix":"Uninstall old package and install rf-groundingdino: pip install rf-groundingdino","message":"The old 'groundingdino' package (v0.1.0) is unmaintained and incompatible with this fork.","severity":"deprecated","affected_versions":"<=0.1.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install rf-groundingdino and use 'from rf_groundingdino import groundingdino'.","cause":"Package name changed to rf_groundingdino.","error":"ModuleNotFoundError: No module named 'groundingdino'"},{"fix":"Ensure prompts are formatted as 'class1 . class2 . class3' with spaces around dots.","cause":"Common when using predict() with wrong prompt format (e.g., missing spaces around '.').","error":"AssertionError: The two points are of different shapes"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}