Skip to content

Instantly share code, notes, and snippets.

View gauravkaila's full-sized avatar

Gaurav Kaila gauravkaila

View GitHub Profile
import tensorflow as tf
# Assuming object detection API is available for use
from object_detection.utils.config_util import create_pipeline_proto_from_configs
from object_detection.utils.config_util import get_configs_from_pipeline_file
import object_detection.exporter
# Configuration for model to be exported
config_pathname = ${Model_configuration}
_write_saved_model(saved_model_path, trained_checkpoint_prefix,
placeholder_tensor, outputs)
def _write_saved_model(saved_model_path,
trained_checkpoint_prefix,
inputs,
outputs):
"""Writes SavedModel to disk.
Args:
saved_model_path: Path to write SavedModel.
trained_checkpoint_prefix: path to trained_checkpoint_prefix.
inputs: The input image tensor to use for detection.
outputs: A tensor dictionary containing the outputs of a DetectionModel.