Skip to content

Commit

Permalink
Fix type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed Dec 1, 2023
1 parent e099b51 commit 78fb345
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opennsfw2/_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from PIL import Image # type: ignore
from tqdm import tqdm # type: ignore

from keras_core import Model # type: ignore
from keras_core import KerasTensor, Model # type: ignore

from ._download import get_default_weights_path
from ._image import preprocess_image, Preprocessing
Expand Down Expand Up @@ -58,7 +58,7 @@ def _predict_images_in_batches(
to use the API in loops. See here:
https://keras.io/api/models/model_training_apis/#predict-method
"""
prediction_batches: List[NDFloat32Array] = []
prediction_batches: List[KerasTensor] = []
for i in range(0, len(images), batch_size):
batch = np.array(images[i: i + batch_size])
prediction_batches.append(model_(batch))
Expand Down

0 comments on commit 78fb345

Please sign in to comment.