mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
(minor) Add None check to fix static type checking error.
This commit is contained in:
parent
f5cfdcf32d
commit
63581ec980
@ -18,6 +18,7 @@ class GroundingDinoPipeline(RawModel):
|
||||
|
||||
def detect(self, image: Image.Image, candidate_labels: list[str], threshold: float = 0.1) -> list[DetectionResult]:
|
||||
results = self._pipeline(image=image, candidate_labels=candidate_labels, threshold=threshold)
|
||||
assert results is not None
|
||||
results = [DetectionResult.model_validate(result) for result in results]
|
||||
return results
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user