Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions preprocessors/object-detection-llm/object-detection-llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def normalize_bbox(bbox, width, height):
"""
x1, y1, x2, y2 = bbox
return [
max(0.0, min(x1 / width, 1.0)),
max(0.0, min(y1 / height, 1.0)),
max(0.0, min(x2 / width, 1.0)),
max(0.0, min(y2 / height, 1.0))
max(0.0, min(x1 / 1000, 1.0)),
max(0.0, min(y1 / 1000, 1.0)),
max(0.0, min(x2 / 1000, 1.0)),
max(0.0, min(y2 / 1000, 1.0))
]


Expand Down
2 changes: 1 addition & 1 deletion utils/llm/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def chat_completion(
image_base64: Optional[str] = None,
json_schema: Optional[Dict[str, Any]] = None,
schema_name: str = "response-format",
temperature: float = 0.5,
temperature: float = 0.0,
max_tokens: Optional[int] = None,
response_format: Optional[Dict[str, str]] = None,
system_prompt: Optional[str] = None,
Expand Down
10 changes: 5 additions & 5 deletions utils/llm/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
Ensure that the bounding boxes are in the format [x1, y1, x2, y2].

Rules:
1. The graphic can contain any number of objects, from zero to many.
2. If no objects are detected, return an empty list: {"objects": []}.
3. Use simple and common object labels (e.g., "car", "person", "tree").
4. Include only objects that are clearly visible and identifiable.
5. Focus on the major and important objects in the image.
1. Focus ONLY on the major and important objects in the image.
2. The graphic can contain any number of objects, from zero to many.
3. If no objects are detected, return an empty list: {"objects": []}.
4. Use simple and common object labels (e.g., "car", "person", "tree").
5. Include ONLY objects that are clearly visible and identifiable.
6. Multiple objects can have the same confidence score.
"""
###
Expand Down