コード例 #1
0
def load_model(model_type, model_path):
    logger.info("Loading pretrained {} model for table detection".format(model_type))
    if model_type == "ml":
        model = pickle.load(open(model_path, "rb"))
    else:
        from keras.models import load_model as load_vision_model

        model = load_vision_model(model_path)
    logger.info("Model loaded!")
    return model
コード例 #2
0
def load_model(model_type, model_path):
    log = logging.getLogger(__name__)
    log.info(
        "Loading pretrained {} model for table detection".format(model_type))
    if (model_type == "ml"):
        model = pickle.load(open(model_path, 'rb'))
    else:
        from keras.models import load_model as load_vision_model
        model = load_vision_model(model_path)
    log.info("Model loaded!")
    return model