diff --git a/opennsfw2/_inference.py b/opennsfw2/_inference.py index 97cdb9b..1e1652d 100644 --- a/opennsfw2/_inference.py +++ b/opennsfw2/_inference.py @@ -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