Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AsiaCao committed Apr 9, 2024
1 parent 44feb20 commit b18eabe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ class DINOv(Tool):
"parameters": {
"prompt": [
{"mask": "balloon_mask1.jpg", "image": "balloon.jpg"},
{"mask": "balloon_mask2.jpg", "image": "balloon.jpg"}
{"mask": "balloon_mask2.jpg", "image": "balloon.jpg"},
],
"image": "input.jpg"
"image": "input.jpg",
},
},
{
Expand All @@ -359,13 +359,15 @@ class DINOv(Tool):
"prompt": [
{"mask": "obj_mask1.jpg", "image": "background.jpg"},
],
"image": "input.jpg"
"image": "input.jpg",
},
},
],
}

def __call__(self, prompt: List[Dict[str, str]], image: Union[str, ImageType]) -> Dict:
def __call__(
self, prompt: List[Dict[str, str]], image: Union[str, ImageType]
) -> Dict:
"""Invoke the DINOv model.
Parameters:
Expand Down Expand Up @@ -394,7 +396,7 @@ def __call__(self, prompt: List[Dict[str, str]], image: Union[str, ImageType]) -
) or "statusCode" not in resp_json:
_LOGGER.error(f"Request failed: {resp_json}")
raise ValueError(f"Request failed: {resp_json}")
rets = resp_json["data"]
rets: Dict[str, Any] = resp_json["data"]
shape = rets.pop("mask_shape")
mask_files = []
for encoded_mask in rets["masks"]:
Expand Down

0 comments on commit b18eabe

Please sign in to comment.