Skip to content

Instantly share code, notes, and snippets.

@zakirangwala
Created December 1, 2020 06:35
Show Gist options
  • Save zakirangwala/23a72746ef5f3fc36fe6015865a14a84 to your computer and use it in GitHub Desktop.
Save zakirangwala/23a72746ef5f3fc36fe6015865a14a84 to your computer and use it in GitHub Desktop.
Load model - Mask Detection
# Load Model from checkpoints
def load_model():
configs = config_util.get_configs_from_pipeline_file(CONFIG_PATH)
detection_model = model_builder.build(
model_config=configs['model'], is_training=False)
ckpt = tf.compat.v2.train.Checkpoint(model=detection_model)
ckpt.restore(os.path.join(CHECKPOINT_PATH, 'ckpt-9')).expect_partial()
return detection_model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment