From 462146b34ea65861c94b290c1554effa97d96ab2 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 16 Jul 2025 02:30:12 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20add=20prompt=20engineeri?= =?UTF-8?q?ng=20tips=20for=20Qwen2.5-VL=20and=20Moondream=20models=20for?= =?UTF-8?q?=20from=5Flmm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/detection/core.py | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index c8f2664b..efaa366a 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -867,6 +867,53 @@ class Detections: ``` !!! example "Qwen2.5-VL" + + ??? tip "Prompt engineering" + + To get the best results from Qwen2.5-VL, use clear and descriptive prompts + that specify exactly what you want to detect. + + **For general object detection, use this comprehensive prompt:** + + ``` + Detect all objects in the image and return their locations and labels. + ``` + + **For specific object detection with detailed descriptions:** + + ``` + Detect the red object that is leading in this image and return its location and label. + ``` + + **For simple, targeted detection:** + + ``` + leading blue truck + ``` + + **Additional effective prompts:** + + ``` + Find all people and vehicles in this scene + ``` + + ``` + Locate all animals in the image + ``` + + ``` + Identify traffic signs and their positions + ``` + + **Tips for better results:** + + - Use descriptive language that clearly specifies what to look for + - Include color, size, or position descriptors when targeting specific objects + - Be specific about the type of objects you want to detect + - The model responds well to both detailed instructions and concise phrases + - Results are returned in JSON format with `bbox_2d` coordinates and `label` fields + + ```python import supervision as sv @@ -1023,6 +1070,23 @@ class Detections: ``` !!! example "Moondream" + + + ??? tip "Prompt engineering" + + To get the best results from Moondream, use optimized prompts that leverage + its object detection capabilities effectively. + + **For general object detection, use this simple prompt:** + + ``` + objects + ``` + + This single-word prompt instructs Moondream to detect all visible objects + and return them in the proper JSON format with normalized coordinates. + + ```python import supervision as sv