Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
AsiaCao committed Apr 22, 2024
1 parent 2ab8899 commit 32fb6a9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,7 @@ def __call__(
}
data: Dict[str, Any] = _send_inference_request(request_data, "tools")
if "bboxes" in data:
data["bboxes"] = [
normalize_bbox(box, image_size) for box in data["bboxes"]
]
data["bboxes"] = [normalize_bbox(box, image_size) for box in data["bboxes"]]
if "masks" in data:
data["masks"] = [
rle_decode(mask_rle=mask, shape=data["mask_shape"])
Expand Down Expand Up @@ -660,19 +658,22 @@ class BboxContains(Tool):
"region": [0.3, 0.31, 0.44, 0.52],
"region_class": "couch",
},
}, {
},
{
"scenario": "Check if the kid is in the pool? bounding box of the kid: [0.2, 0.21, 0.34, 0.42], bounding box of the pool: [0.3, 0.31, 0.44, 0.52]",
"parameters": {
"target": [0.2, 0.21, 0.34, 0.42],
"target_class": "kid",
"region": [0.3, 0.31, 0.44, 0.52],
"region_class": "pool",
},
}
},
],
}

def __call__(self, target: List[int], target_class: str, region: List[int], region_class: str) -> Dict[str, Union[str, float]]:
def __call__(
self, target: List[int], target_class: str, region: List[int], region_class: str
) -> Dict[str, Union[str, float]]:
x1, y1, x2, y2 = target
x3, y3, x4, y4 = region
xA = max(x1, x3)
Expand Down

0 comments on commit 32fb6a9

Please sign in to comment.