def extract_json_weights(strModelFile: str, strPath: str='./'):
    """
    From a keras .h5 model file, generate a json file and a numpy weight file

    :param strModelFile: str Model file name.
    :param strPath: str Path to save the model json file and weight files. The json file is saved to `strPath/models/` and weights to `strPath/weights/`
    """
    import tensorflow as tf
    import os
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    session = tf.Session(config=config)
    from tensorflow import keras
    import numpy as np
    keras_model = keras.models.load_model(strModelFile)
    model_name = strModelFile[:-3].split('/')[-1]
    if not os.path.isdir(strPath + '/models/'):
        os.makedirs(strPath + '/models/')
    with open(strPath + '/models/' + model_name + '.json', 'w') as jsonFile:
        jsonFile.write(keras_model.to_json())
    if not os.path.isdir(strPath + '/weights/'):
        os.makedirs(strPath + '/weights/')
    model_weights = keras_model.get_weights()
    np.savez(strPath + '/weights/' + model_name, *model_weights)
