From 4767d6df50b97c1fa20f331ff81e0a8bdfab9fbf Mon Sep 17 00:00:00 2001 From: Dillon Laird Date: Wed, 6 Mar 2024 15:15:56 -0800 Subject: [PATCH] fix type errors --- vision_agent/tools/tools.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vision_agent/tools/tools.py b/vision_agent/tools/tools.py index 8f3dfd50..bd640e76 100644 --- a/vision_agent/tools/tools.py +++ b/vision_agent/tools/tools.py @@ -1,8 +1,13 @@ +from typing import Dict, List, Union + +from PIL.Image import Image as ImageType + + class Classifier: def __init__(self, prompt: str): self.prompt = prompt - def __call__(self: image: Union[str, Image]) -> List[Dict]: + def __call__(self, image: Union[str, ImageType]) -> List[Dict]: raise NotImplementedError @@ -10,7 +15,7 @@ class Detector: def __init__(self, prompt: str): self.prompt = prompt - def __call__(self: image: Union[str, Image]) -> List[Dict]: + def __call__(self, image: Union[str, ImageType]) -> List[Dict]: raise NotImplementedError @@ -18,5 +23,5 @@ class Segmentor: def __init__(self, prompt: str): self.prompt = prompt - def __call__(self: image: Union[str, Image]) -> List[Dict]: + def __call__(self, image: Union[str, ImageType]) -> List[Dict]: raise NotImplementedError