Created
December 5, 2020 23:25
-
-
Save bpatra/8a80e1f723580cf7a9b706df9dcb93e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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