Skip to content

Instantly share code, notes, and snippets.

@bpatra
Created December 5, 2020 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpatra/8a80e1f723580cf7a9b706df9dcb93e6 to your computer and use it in GitHub Desktop.
Save bpatra/8a80e1f723580cf7a9b706df9dcb93e6 to your computer and use it in GitHub Desktop.
from inception_resnet_v1 import *
def model_with_inception_resnet_base(pretrained_weights):
model = InceptionResNetV1()
if pretrained_weights == True:
#pre-trained weights https://drive.google.com/file/d/1971Xk5RwedbudGgTIrGAL4F7Aifu7id1/view?usp=sharing
model.load_weights('facenet_weights.h5')
new_model = models.Sequential()
new_model.add(model)
new_model.add(layers.Dense(256, activation='relu'))
new_model.add(layers.Dropout(0.5))
new_model.add(layers.Dense(64, activation='relu'))
new_model.add(layers.Dropout(0.5))
new_model.add(layers.Dense(16, activation='relu'))
new_model.add(layers.Dense(1, activation='sigmoid'))
return new_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment