MCPcopy Create free account
hub / github.com/tensorflow/models / load_model

Function load_model

official/projects/unified_detector/run_inference.py:84–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83
84def load_model() -> tf_keras.layers.Layer:
85 gin.parse_config_file(_GIN_FILE.value)
86 model = universal_detector.UniversalDetector()
87 ckpt = tf.train.Checkpoint(model=model)
88 ckpt_path = _CKPT_PATH.value
89 logging.info('Load ckpt from: %s', ckpt_path)
90 ckpt.restore(ckpt_path).expect_partial()
91 return model
92
93
94def inference(img_file: str, model: tf_keras.layers.Layer) -> Dict[str, Any]:

Callers 1

mainFunction · 0.85

Calls 2

parse_config_fileMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected