Skip to content

Commit

Permalink
add empty check for input image
Browse files Browse the repository at this point in the history
  • Loading branch information
cospectrum committed Jan 4, 2025
1 parent d7c0aed commit 35b97bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/microwink/seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def apply(
) -> list[SegResult]:
CLASS_ID = 0
assert image.mode == "RGB"
assert image.width > 0
assert image.height > 0

raw = self._run(image, threshold.confidence, threshold.iou)
if raw is None:
Expand Down

0 comments on commit 35b97bc

Please sign in to comment.