Exemplo n.º 1
0
def train_pair_predict(pair_model_path, target_train_path, pid_path,
                       score_path):
    model = load_model(pair_model_path)
    model = Model(inputs=[model.get_layer('resnet50').get_input_at(0)],
                  outputs=[model.get_layer('resnet50').get_output_at(0)])
    # model = Model(inputs=[model.input], outputs=[model.get_layer('avg_pool').output])
    train_predict(model, target_train_path, pid_path, score_path)
Exemplo n.º 2
0
def train_rank_predict(rank_model_path, target_train_path, pid_path,
                       score_path):
    model = load_model(
        rank_model_path,
        custom_objects={'cross_entropy_loss': cross_entropy_loss})
    model = Model(inputs=[model.get_layer('resnet50').get_input_at(0)],
                  outputs=[model.get_layer('resnet50').get_output_at(0)])
    train_predict(model, target_train_path, pid_path, score_path)