Skip to content

Commit

Permalink
Use Keras 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bhky committed Dec 21, 2023
1 parent 6eefb8a commit 0935e93
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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 KerasTensor, Model # type: ignore
from keras import KerasTensor, Model # type: ignore

from ._download import get_default_weights_path
from ._image import preprocess_image, Preprocessing
Expand Down
4 changes: 2 additions & 2 deletions opennsfw2/_inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import numpy as np
import tensorflow as tf # type: ignore # pylint: disable=import-error
from keras_core import Model # type: ignore
from keras_core.preprocessing.image import array_to_img # type: ignore
from keras import Model # type: ignore
from keras.preprocessing.image import array_to_img # type: ignore
from matplotlib import colormaps as cm
from PIL import Image # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion opennsfw2/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os
from typing import Optional, Tuple

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

from ._download import get_default_weights_path, download_weights_to

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gdown>=4.2.0
keras-core>=0.1.0
keras>=3.0.0
matplotlib>=3.0.0
numpy>=1.22.0
opencv-python>=4.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from typing import Optional, Sequence

from keras_core import backend as keras_backend
from keras import backend as keras_backend

import opennsfw2 as n2

Expand Down

0 comments on commit 0935e93

Please sign in to comment.