Example #1
0
    #
    # 2. display the original image
    #
    print("2. display image... ")
    plt.title(sys.argv[2][-11:])
    plt.imshow(fm, cmap=plt.cm.gray)
    ImgPath = 'D:\\Fingerprint\\paper8_NN\\P8NN_Images\\' + sys.argv[
        1] + '_' + sys.argv[2][-11:-4] + "_1.png"
    plt.savefig(ImgPath, dpi=600, bbox_inches='tight')
    if ShowAll: plt.show()

    #
    # 3. find foreground information
    #
    print("3. find foreground info... ")
    fpfg = MyL.FP_FindBG(plt, fm, False)

    #
    # 4. load model
    #
    print("4. Loading model/weights...")
    from keras.models import model_from_yaml
    MdlSourPath = 'D:\\Fingerprint\\paper8_NN\\P8NN_Model\\'
    mdl_fn = MdlSourPath + sys.argv[1] + ".yaml"
    wgt_fn = MdlSourPath + sys.argv[1] + ".h5"
    yaml_file = open(mdl_fn)
    loaded_model_yaml = yaml_file.read()
    yaml_file.close()
    loaded_model = model_from_yaml(loaded_model_yaml)
    loaded_model.load_weights(wgt_fn)