Skip to content

Commit

Permalink
Add extra type assertion for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed Aug 17, 2024
1 parent 6f71a3a commit 0e7e769
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions opennsfw2/_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def predict_images(
from ._inspection import make_and_save_nsfw_grad_cam

for image_handle, grad_cam_path in zip(image_handles, grad_cam_paths):
assert isinstance(image_handle, (str, Image.Image)) # For mypy.
pil_image = _load_pil_image(image_handle)
make_and_save_nsfw_grad_cam(
pil_image, preprocessing, global_model, grad_cam_path, alpha
Expand Down

0 comments on commit 0e7e769

Please sign in to comment.