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
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