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 _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. |
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
_write_saved_model(saved_model_path, trained_checkpoint_prefix, | |
placeholder_tensor, outputs) |
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
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} |
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
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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 _write_frozen_graph(frozen_graph_path, frozen_graph_def): | |
# """Writes frozen graph to disk. | |
# | |
# Args: | |
# frozen_graph_path: Path to write inference graph. | |
# frozen_graph_def: tf.GraphDef holding frozen graph. | |
# """ | |
# with gfile.GFile(frozen_graph_path, 'wb') as f: | |
# f.write(frozen_graph_def.SerializeToString()) | |
# logging.info('%d ops in the final graph.', len(frozen_graph_def.node)) |
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 make_tensor_proto(values, dtype=None, shape=None, verify_shape=False): | |
"""Create a TensorProto. | |
Args: | |
values: Values to put in the TensorProto. | |
dtype: Optional tensor_pb2 DataType value. | |
shape: List of integers representing the dimensions of tensor. | |
verify_shape: Boolean that enables verification of a shape of values. | |
Returns: | |
A TensorProto. Depending on the type, it may contain data in the | |
"tensor_content" attribute, which is not directly useful to Python programs. |
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
#!/bin/bash | |
# add the GPG key for the official Docker repository to the system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# add the Docker repository to APT sources | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
# update the package database with the Docker packages from the newly added repo | |
sudo apt-get update |
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
# Create stub | |
host, port = FLAGS.server.split(':') | |
channel = implementations.insecure_channel(host, int(port)) | |
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel) | |
# Create prediction request object | |
request = predict_pb2.PredictRequest() | |
# Specify model name (must be the same as when the TensorFlow serving serving was started) | |
request.model_spec.name = 'obj_det' |
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
# Create stub | |
host, port = FLAGS.server.split(':') | |
channel = implementations.insecure_channel(host, int(port)) | |
stub = prediction_service_pb2.beta_create_PredictionService_stub(channel) | |
# Create prediction request object | |
request = predict_pb2.PredictRequest() | |
# Specify model name (must be the same as when the TensorFlow serving serving was started) | |
request.model_spec.name = 'obj_det' |
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
parameter | data_type | Azure name | |
---|---|---|---|
subscription_id | string | Azure subscription id | |
resource_group | string | Azure resource group | |
workspace_name | string | Azure machine learning workspace |
OlderNewer