From b69fd5ec1812406ec941efebbb3d67cf6ab794c4 Mon Sep 17 00:00:00 2001 From: shankar-landing-ai Date: Tue, 3 Sep 2024 16:32:25 -0700 Subject: [PATCH] fixed keys in the example string, add suppot for multi-class --- vision_agent/tools/tools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vision_agent/tools/tools.py b/vision_agent/tools/tools.py index e0961398..8012e60d 100644 --- a/vision_agent/tools/tools.py +++ b/vision_agent/tools/tools.py @@ -532,14 +532,15 @@ def countgd_counting( ------- >>> countgd_counting("flower", image) [ - {'score': 0.49, 'label': 'flower', 'bounding_box': [0.1, 0.11, 0.35, 0.4]}, - {'score': 0.68, 'label': 'flower', 'bounding_box': [0.2, 0.21, 0.45, 0.5}, - {'score': 0.78, 'label': 'flower', 'bounding_box': [0.3, 0.35, 0.48, 0.52}, - {'score': 0.98, 'label': 'flower', 'bounding_box': [0.44, 0.24, 0.49, 0.58}, + {'score': 0.49, 'label': 'flower', 'bbox': [0.1, 0.11, 0.35, 0.4]}, + {'score': 0.68, 'label': 'flower', 'bbox': [0.2, 0.21, 0.45, 0.5}, + {'score': 0.78, 'label': 'flower', 'bbox': [0.3, 0.35, 0.48, 0.52}, + {'score': 0.98, 'label': 'flower', 'bbox': [0.44, 0.24, 0.49, 0.58}, ] """ buffer_bytes = numpy_to_bytes(image) files = [("image", buffer_bytes)] + prompt = prompt.replace(", ", " .") payload = {"prompts": [prompt], "model": "countgd"} metadata = {"function_name": "countgd_counting"} resp_data = send_task_inference_request(