face_compare/weights/weights.py
def load_weights(model):
    '''Loads weights to given FaceNet model
    
    Args:
        model (keras.models.Models): FaceNet model.
    '''

    weights_dir = Path(__file__).parent.joinpath('weights')

    for layer_name in WEIGHTS:
        print(f'loading layer {layer_name}')
        if 'conv' in layer_name:
            model.get_layer(layer_name).set_weights(get_conv_weights(weights_dir, layer_name))
        elif 'bn' in layer_name:
            model.get_layer(layer_name).set_weights(get_batch_norm_weights(weights_dir, layer_name))
        elif 'dense' in layer_name:
            model.get_layer(layer_name).set_weights(get_dense_weights(weights_dir, layer_name))
Loads weights to given FaceNet model
    
    Args:
        model (keras.models.Models): FaceNet model.
    
Loads weights to given FaceNet model
Loads weights to given FaceNet model
def load_weights(model):
    weights_dir = Path(__file__).parent.joinpath('weights')
    for layer_name in WEIGHTS:
        print(f'loading layer {layer_name}')
        if 'conv' in layer_name:
            model.get_layer(layer_name).set_weights(get_conv_weights(weights_dir, layer_name))
        elif 'bn' in layer_name:
            model.get_layer(layer_name).set_weights(get_batch_norm_weights(weights_dir, layer_name))
        elif 'dense' in layer_name:
            model.get_layer(layer_name).set_weights(get_dense_weights(weights_dir, layer_name))
def load_weights ( model ) : weights_dir = Path ( __file__ ) . parent . joinpath ( 'weights' ) for layer_name in WEIGHTS : print ( f'loading layer {layer_name}' ) if 'conv' in layer_name : model . get_layer ( layer_name ) . set_weights ( get_conv_weights ( weights_dir , layer_name ) ) elif 'bn' in layer_name : model . get_layer ( layer_name ) . set_weights ( get_batch_norm_weights ( weights_dir , layer_name ) ) elif 'dense' in layer_name : model . get_layer ( layer_name ) . set_weights ( get_dense_weights ( weights_dir , layer_name ) )
Loads weights to given FaceNet model
Loads weights to given FaceNet model
'''Loads weights to given FaceNet model
    
    Args:
        model (keras.models.Models): FaceNet model.
    '''
model
None