diff --git a/server/dev-requirements.txt b/server/dev-requirements.txt new file mode 100644 index 00000000..c9dc2348 --- /dev/null +++ b/server/dev-requirements.txt @@ -0,0 +1,4 @@ +pytest>=2.9.1 +pytest-cov>=2.2.1 +freezegun>=0.3.6 +pycodestyle>=2.0.0 diff --git a/server/requirements.txt b/server/requirements.txt index b11c3b5d..a1ef52ec 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,16 +1,12 @@ alembic>=0.8.5 pyyaml>=3.11 -psycopg2>=2.6.1 +psycopg2-binary>=2.6.1 SQLAlchemy>=1.0.12 -pytest>=2.9.1 -pytest-cov>=2.2.1 -freezegun>=0.3.6 coloredlogs==5.0 -pycodestyle>=2.0.0 -scipy>=0.18.1 elasticsearch>=5.0.0 elasticsearch-dsl>=5.0.0 -scikit-image>=0.12 +numpy>=1.8.2 +pillow>=4.3.0 pynacl>=1.2.1 pytz>=2018.3 -pyRFC3339>=1.0 \ No newline at end of file +pyRFC3339>=1.0 diff --git a/server/szurubooru/func/image_hash.py b/server/szurubooru/func/image_hash.py index dae84435..b89b2187 100644 --- a/server/szurubooru/func/image_hash.py +++ b/server/szurubooru/func/image_hash.py @@ -5,7 +5,6 @@ from typing import Any, Optional, Tuple, Set, List, Callable import elasticsearch import elasticsearch_dsl import numpy as np -from skimage.color import rgb2gray from PIL import Image from szurubooru import config, errors @@ -41,8 +40,7 @@ def _get_session() -> elasticsearch.Elasticsearch: def _preprocess_image(content: bytes) -> NpMatrix: img = Image.open(BytesIO(content)) - img = img.convert('RGB') - return rgb2gray(np.asarray(img, dtype=np.uint8)) + return np.asarray(img.convert('L'), dtype=np.uint8) def _crop_image(