mirror of
https://github.com/serengil/deepface.git
synced 2025-07-22 18:00:02 +00:00
Merge pull request #86 from deepuvsdeepu/master
Provide the ability to override the default gdrive model weights urls
This commit is contained in:
commit
48230263b5
@ -8,7 +8,7 @@ import zipfile
|
||||
|
||||
#-------------------------------------
|
||||
|
||||
def loadModel():
|
||||
def loadModel(url = 'https://drive.google.com/uc?id=1uRLtBCTQQAvHJ_KVrdbRJiCKxU8m5q2J'):
|
||||
|
||||
myInput = Input(shape=(55, 47, 3))
|
||||
|
||||
@ -43,7 +43,6 @@ def loadModel():
|
||||
if os.path.isfile(home+'/.deepface/weights/deepid_keras_weights.h5') != True:
|
||||
print("deepid_keras_weights.h5 will be downloaded...")
|
||||
|
||||
url = 'https://drive.google.com/uc?id=1uRLtBCTQQAvHJ_KVrdbRJiCKxU8m5q2J'
|
||||
output = home+'/.deepface/weights/deepid_keras_weights.h5'
|
||||
gdown.download(url, output, quiet=False)
|
||||
|
||||
|
@ -530,7 +530,7 @@ def InceptionResNetV2():
|
||||
|
||||
return model
|
||||
|
||||
def loadModel():
|
||||
def loadModel(url = 'https://drive.google.com/uc?id=1971Xk5RwedbudGgTIrGAL4F7Aifu7id1'):
|
||||
model = InceptionResNetV2()
|
||||
|
||||
#-----------------------------------
|
||||
@ -540,7 +540,6 @@ def loadModel():
|
||||
if os.path.isfile(home+'/.deepface/weights/facenet_weights.h5') != True:
|
||||
print("facenet_weights.h5 will be downloaded...")
|
||||
|
||||
url = 'https://drive.google.com/uc?id=1971Xk5RwedbudGgTIrGAL4F7Aifu7id1'
|
||||
output = home+'/.deepface/weights/facenet_weights.h5'
|
||||
gdown.download(url, output, quiet=False)
|
||||
|
||||
|
@ -8,7 +8,7 @@ import zipfile
|
||||
|
||||
#-------------------------------------
|
||||
|
||||
def loadModel():
|
||||
def loadModel(url = 'https://github.com/swghosh/DeepFace/releases/download/weights-vggface2-2d-aligned/VGGFace2_DeepFace_weights_val-0.9034.h5.zip'):
|
||||
base_model = Sequential()
|
||||
base_model.add(Convolution2D(32, (11, 11), activation='relu', name='C1', input_shape=(152, 152, 3)))
|
||||
base_model.add(MaxPooling2D(pool_size=3, strides=2, padding='same', name='M2'))
|
||||
@ -28,8 +28,6 @@ def loadModel():
|
||||
if os.path.isfile(home+'/.deepface/weights/VGGFace2_DeepFace_weights_val-0.9034.h5') != True:
|
||||
print("VGGFace2_DeepFace_weights_val-0.9034.h5 will be downloaded...")
|
||||
|
||||
url = 'https://github.com/swghosh/DeepFace/releases/download/weights-vggface2-2d-aligned/VGGFace2_DeepFace_weights_val-0.9034.h5.zip'
|
||||
|
||||
output = home+'/.deepface/weights/VGGFace2_DeepFace_weights_val-0.9034.h5.zip'
|
||||
|
||||
gdown.download(url, output, quiet=False)
|
||||
|
@ -15,7 +15,7 @@ from keras import backend as K
|
||||
|
||||
#---------------------------------------
|
||||
|
||||
def loadModel():
|
||||
def loadModel(url = 'https://drive.google.com/uc?id=1LSe1YCV1x-BfNnfb7DFZTNpv_Q9jITxn'):
|
||||
myInput = Input(shape=(96, 96, 3))
|
||||
|
||||
x = ZeroPadding2D(padding=(3, 3), input_shape=(96, 96, 3))(myInput)
|
||||
@ -237,7 +237,6 @@ def loadModel():
|
||||
if os.path.isfile(home+'/.deepface/weights/openface_weights.h5') != True:
|
||||
print("openface_weights.h5 will be downloaded...")
|
||||
|
||||
url = 'https://drive.google.com/uc?id=1LSe1YCV1x-BfNnfb7DFZTNpv_Q9jITxn'
|
||||
output = home+'/.deepface/weights/openface_weights.h5'
|
||||
gdown.download(url, output, quiet=False)
|
||||
|
||||
|
@ -54,7 +54,7 @@ def baseModel():
|
||||
|
||||
return model
|
||||
|
||||
def loadModel():
|
||||
def loadModel(url = 'https://drive.google.com/uc?id=1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo'):
|
||||
|
||||
model = baseModel()
|
||||
|
||||
@ -63,9 +63,8 @@ def loadModel():
|
||||
home = str(Path.home())
|
||||
|
||||
if os.path.isfile(home+'/.deepface/weights/vgg_face_weights.h5') != True:
|
||||
print("vgg_face_weights.h5 will be downloaded...")
|
||||
print("vgg_face_weights.h5 will be downloaded...")
|
||||
|
||||
url = 'https://drive.google.com/uc?id=1CPSeum3HpopfomUEK1gybeuIVoeJT_Eo'
|
||||
output = home+'/.deepface/weights/vgg_face_weights.h5'
|
||||
gdown.download(url, output, quiet=False)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user