()
| 82 | |
| 83 | |
| 84 | def 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 | |
| 94 | def inference(img_file: str, model: tf_keras.layers.Layer) -> Dict[str, Any]: |
no test coverage detected