From 06e92b9aff0192df9a3b7347d61ada720f0f501b Mon Sep 17 00:00:00 2001 From: Matt Lyon Date: Sun, 15 Aug 2021 21:00:52 +0100 Subject: [PATCH] update to tensorflow 2.5 --- face_compare/images.py | 2 +- face_compare/model.py | 10 +++++----- face_compare/weights/weights.py | 1 - setup.py | 9 ++++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/face_compare/images.py b/face_compare/images.py index 837f659..c3fc31c 100644 --- a/face_compare/images.py +++ b/face_compare/images.py @@ -2,7 +2,7 @@ def get_face(img): '''Crops image to only include face plus a border''' - height, width, channels = img.shape + height, width, _ = img.shape face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml") face_box = face_cascade.detectMultiScale(img) # Get dimensions of bounding box diff --git a/face_compare/model.py b/face_compare/model.py index c6c715e..c3f3be2 100644 --- a/face_compare/model.py +++ b/face_compare/model.py @@ -1,15 +1,15 @@ import cv2 import numpy as np -import tensorflow as tf + import tensorflow.keras.backend as tfback from pathlib import Path -from keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate -from keras.models import Model +from tensorflow.keras.layers import Conv2D, ZeroPadding2D, Activation, Input, concatenate +from tensorflow.keras.models import Model from tensorflow.keras.layers import BatchNormalization -from keras.layers.pooling import MaxPooling2D, AveragePooling2D -from keras.layers.core import Lambda, Flatten, Dense +from tensorflow.keras.layers import MaxPooling2D, AveragePooling2D +from tensorflow.keras.layers import Lambda, Flatten, Dense tfback.set_image_data_format('channels_first') diff --git a/face_compare/weights/weights.py b/face_compare/weights/weights.py index 50f8da5..7bfa5f2 100644 --- a/face_compare/weights/weights.py +++ b/face_compare/weights/weights.py @@ -1,5 +1,4 @@ import numpy as np -import tensorflow as tf from pathlib import Path diff --git a/setup.py b/setup.py index 7a56587..1d5c7ad 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from os import path from setuptools import setup, find_packages -version = '1.0.2' +version = '1.1.0' this_dir = path.abspath(path.dirname(__file__)) with open(path.join(this_dir, 'README.md'), encoding='utf-8') as f: long_description = f.read() @@ -22,10 +22,9 @@ license='MIT License', packages=find_packages(), install_requires=[ - 'numpy==1.18.0', - 'tensorflow==2.3.1', - 'keras==2.4.2', - 'scipy==1.4.1', + 'numpy', + 'tensorflow==2.5.0', + 'scipy', 'opencv-python' ], classifiers=[