Created
April 6, 2020 07:02
-
-
Save Alakhator/e9b2a05e3c1929817b74dc3b76f45add to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def load_model(model_name): | |
| base_url = 'http://download.tensorflow.org/models/object_detection/' | |
| model_file = model_name + '.tar.gz' | |
| model_dir = tf.keras.utils.get_file( | |
| fname=model_name, | |
| origin=base_url + model_file, | |
| untar=True) | |
| model_dir = pathlib.Path(model_dir)/"saved_model" | |
| model = tf.saved_model.load(str(model_dir)) | |
| model = model.signatures['serving_default'] | |
| return model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment