Skip to content

Commit

Permalink
Convert TF tensor to Numpy array
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed Dec 1, 2023
1 parent 86c0a81 commit 4f98dda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opennsfw2/_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _predict_images_in_batches(
prediction_batches: List[NDFloat32Array] = []
for i in range(0, len(images), batch_size):
batch = np.array(images[i: i + batch_size])
prediction_batches.append(model_(batch))
prediction_batches.append(model_(batch).numpy())
predictions = np.concatenate(prediction_batches, axis=0)
return predictions

Expand Down

0 comments on commit 4f98dda

Please sign in to comment.