Detects objects from a natural-language prompt and produces a single pick target suitable for a pick-and-place task. Includes a simple single-image inference script, a batch pipeline, and a pick-task selection pipeline.
- Runs GroundingDINO to detect objects from text prompts.
- Outputs ranked detections and a single recommended pick target.
- Saves annotated images and JSON results for easy demo/review.
infer.py: single-image inference and visualization.batch_infer.py: run inference on a directory of images.pick_task_pipeline.py: select a best pick target with JSON output.
-
Install the library:
pip install groundingdino-py
-
Download weights and config into the project root:
wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth -O groundingdino_swint_ogc.pth wget https://raw.githubusercontent.com/IDEA-Research/GroundingDINO/main/groundingdino/config/GroundingDINO_SwinT_OGC.py -O GroundingDINO_SwinT_OGC.py
-
Run inference:
python infer.py --image data/image.jpg --prompt "person"
python infer.py --image data/image.jpg --prompt "person"python batch_infer.py --input data/ --prompt "red mug" --save-annotated --output-dir outputspython pick_task_pipeline.py --image data/image.jpg --prompt "red mug" --save-annotatedinfer.pysavesoutput.jpgwith detections.batch_infer.pysavesoutputs/results.jsonand optional annotated images.pick_task_pipeline.pysavespick_result.jsonand optional annotated image.
- Place
groundingdino_swint_ogc.pthandGroundingDINO_SwinT_OGC.pyin the project root. - For best results, use clear prompts like “red mug on table”.
- Warehouse picking (identify a specific SKU from a shelf)
- Assistive robotics (find objects by voice prompt)
- Manufacturing QA (detect missing or wrong parts)
- Retail analytics (count or locate products on shelves)
- ROS 2 node for real robot integration
- Depth-aware picking using RGB-D
- Multi-object task planning (ordered pick list)
- Web demo UI with live camera input