Skip to content

Commit

Permalink
fixed type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Aug 21, 2024
1 parent 07832e3 commit 968b3df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def ixc25_image_vqa(prompt: str, image: np.ndarray) -> str:
data: Dict[str, Any] = send_inference_request(
payload, "internlm-xcomposer2", files=files, v2=True
)
return data["answer"]
return cast(str, data["answer"])


def ixc25_video_vqa(prompt: str, frames: List[np.ndarray]) -> str:
Expand All @@ -548,7 +548,7 @@ def ixc25_video_vqa(prompt: str, frames: List[np.ndarray]) -> str:
data: Dict[str, Any] = send_inference_request(
payload, "internlm-xcomposer2", files=files, v2=True
)
return data["answer"]
return cast(str, data["answer"])


def git_vqa_v2(prompt: str, image: np.ndarray) -> str:
Expand Down Expand Up @@ -1449,7 +1449,7 @@ def overlay_segmentation_masks(
text_box = draw.textbbox((x, y), text=label, font=font)
draw.rectangle((x, y, text_box[2], text_box[3]), fill=color[label])
draw.text((x, y), label, fill="black", font=font)
frame_out.append(np.array(pil_image)) # type: ignore
frame_out.append(np.array(pil_image))
return frame_out[0] if len(frame_out) == 1 else frame_out


Expand Down

0 comments on commit 968b3df

Please sign in to comment.