Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tensorflow 2 #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "C:\\Users\\Den\\Miniconda3\\envs\\dl\\python.exe"
}
2 changes: 1 addition & 1 deletion realtime_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
import argparse
from wide_resnet import WideResNet
from keras.utils.data_utils import get_file
from tensorflow.keras.utils import get_file

class FaceCV(object):
"""
Expand Down
49 changes: 45 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
numpy==1.13.3+mkl
Keras==2.0.8
opencv==1.0.1
opencv-python==3.3.0+contrib
absl-py==0.9.0
astor==0.8.1
astroid==2.2.5
autopep8==1.4.4
cachetools==4.0.0
certifi==2019.11.28
chardet==3.0.4
colorama==0.4.1
gast==0.2.2
google-auth==1.11.2
google-auth-oauthlib==0.4.1
google-pasta==0.1.8
grpcio==1.27.2
h5py==2.10.0
idna==2.9
isort==4.3.21
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
lazy-object-proxy==1.4.2
Markdown==3.2.1
mccabe==0.6.1
numpy==1.18.1
oauthlib==3.1.0
opencv-python==4.2.0.32
opt-einsum==3.2.0
protobuf==3.11.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycodestyle==2.5.0
pylint==2.3.1
requests==2.23.0
requests-oauthlib==1.3.0
rope==0.14.0
rsa==4.0
scipy==1.4.1
six==1.12.0
tensorboard==2.1.1
tensorflow==2.1.0
tensorflow-estimator==2.1.0
termcolor==1.1.0
typed-ast==1.4.0
urllib3==1.25.8
Werkzeug==1.0.0
wincertstore==0.2
wrapt==1.11.2
13 changes: 6 additions & 7 deletions wide_resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import logging
import sys
import numpy as np
from keras.models import Model
from keras.layers import Input, Activation, add, Dense, Flatten, Dropout
from keras.layers.convolutional import Conv2D, AveragePooling2D
from keras.layers.normalization import BatchNormalization
from keras.regularizers import l2
from keras import backend as K
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Activation, add, Dense, Flatten, Dropout, Conv2D, AveragePooling2D, BatchNormalization
from tensorflow.keras.regularizers import l2
from tensorflow.keras import backend as K

sys.setrecursionlimit(2 ** 20)
np.random.seed(2 ** 10)
Expand All @@ -23,7 +21,8 @@ def __init__(self, image_size, depth=16, k=8):
self._use_bias = False
self._weight_init = "he_normal"

if K.image_dim_ordering() == "th":
# if K.image_dim_ordering() == "th":
if K.image_data_format() == "th":
logging.debug("image_dim_ordering = 'th'")
self._channel_axis = 1
self._input_shape = (3, image_size, image_size)
Expand Down