Skip to content

Commit

Permalink
Add Weights for B4 and B5 models, bump version and setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
titu1994 committed Jun 19, 2019
1 parent b3d3905 commit 156df01
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion keras_efficientnets/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from keras_efficientnets.efficientnet import *
from keras_efficientnets.config import BlockArgs

__version__ = '0.1.3'
__version__ = '0.1.4'
56 changes: 28 additions & 28 deletions keras_efficientnets/efficientnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,32 +479,32 @@ def EfficientNet(input_shape,
cache_subdir='models')
model.load_weights(weights_path)

# elif default_size == 380:
# if include_top:
# weights_path = get_file(
# 'efficientnet-b4.h5',
# "https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b4.h5",
# cache_subdir='models')
# else:
# weights_path = get_file(
# 'efficientnet-b4_notoph5',
# "https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b4_notop.h5",
# cache_subdir='models')
# model.load_weights(weights_path)
#
# elif default_size == 456:
# if include_top:
# weights_path = get_file(
# 'efficientnet-b5.h5',
# "https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b5.h5",
# cache_subdir='models')
# else:
# weights_path = get_file(
# 'efficientnet-b5_notop.h5',
# "https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b5_notop.h5",
# cache_subdir='models')
# model.load_weights(weights_path)
#
elif default_size == 380:
if include_top:
weights_path = get_file(
'efficientnet-b4.h5',
"https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b4.h5",
cache_subdir='models')
else:
weights_path = get_file(
'efficientnet-b4_notoph5',
"https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b4_notop.h5",
cache_subdir='models')
model.load_weights(weights_path)

elif default_size == 456:
if include_top:
weights_path = get_file(
'efficientnet-b5.h5',
"https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b5.h5",
cache_subdir='models')
else:
weights_path = get_file(
'efficientnet-b5_notop.h5',
"https://github.com/titu1994/keras-efficientnets/releases/download/v0.1/efficientnet-b5_notop.h5",
cache_subdir='models')
model.load_weights(weights_path)

# elif default_size == 528:
# if include_top:
# weights_path = get_file(
Expand Down Expand Up @@ -822,7 +822,7 @@ def EfficientNetB3(input_shape=None,

def EfficientNetB4(input_shape=None,
include_top=True,
weights=None,
weights='imagenet',
input_tensor=None,
pooling=None,
classes=1000,
Expand Down Expand Up @@ -892,7 +892,7 @@ def EfficientNetB4(input_shape=None,

def EfficientNetB5(input_shape=None,
include_top=True,
weights=None,
weights='imagenet',
input_tensor=None,
pooling=None,
classes=1000,
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ def run(self):
os.system('git tag v{0}'.format(get_version()))
os.system('git push --tags')

try:
self.status('Removing build artifacts...')
rmtree(os.path.join(base_path, 'build'))
rmtree(os.path.join(base_path, 'keras_efficientnets.egg-info'))
except OSError:
pass

sys.exit()

def initialize_options(self):
Expand Down

0 comments on commit 156df01

Please sign in to comment.