Skip to content

Commit

Permalink
fix return values from countgd endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed Sep 1, 2024
1 parent 7d64451 commit 18cce4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions vision_agent/tools/tool_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import inspect
import logging
import os
from typing import Any, Callable, Dict, List, MutableMapping, Optional, Tuple, Union
from typing import Any, Callable, Dict, List, MutableMapping, Optional, Tuple

import pandas as pd
from IPython.display import display
Expand Down Expand Up @@ -34,7 +34,7 @@ def send_inference_request(
files: Optional[List[Tuple[Any, ...]]] = None,
v2: bool = False,
metadata_payload: Optional[Dict[str, Any]] = None,
) -> Union[Dict[str, Any], List[Dict[str, Any]]]:
) -> Dict[str, Any]:
# TODO: runtime_tag and function_name should be metadata_payload and now included
# in the service payload
try:
Expand Down
12 changes: 6 additions & 6 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,10 @@ def countgd_counting(
"box_threshold": box_threshold,
}
metadata_payload = {"function_name": "countgd_counting"}
data: List[Dict[str, Any]] = send_inference_request(
resp: List[Dict[str, Any]] = send_inference_request(
payload, "countgd", v2=True, metadata_payload=metadata_payload
)
return data
) # type: ignore
return resp["data"]


def countgd_example_based_counting(
Expand Down Expand Up @@ -589,10 +589,10 @@ def countgd_example_based_counting(
"box_threshold": box_threshold,
}
metadata_payload = {"function_name": "countgd_example_based_counting"}
data: List[Dict[str, Any]] = send_inference_request(
resp: List[Dict[str, Any]] = send_inference_request(
payload, "countgd", v2=True, metadata_payload=metadata_payload
)
return data
) # type: ignore
return resp["data"]


def florence2_roberta_vqa(prompt: str, image: np.ndarray) -> str:
Expand Down

0 comments on commit 18cce4f

Please sign in to comment.