Commit c57e975a authored by saberkun's avatar saberkun
Browse files

Merge pull request #10338 from srihari-humbarwadi:readme

PiperOrigin-RevId: 413033276
parents 7fb4f3cd acf4156e
......@@ -39,11 +39,9 @@ we pass it to the functions. At the end of the preprocess we expand the image
back to rank 4.
"""
import tensorflow as tf
import numpy as np
from official.vision.detection.utils.object_detection import box_list
import tensorflow as tf
from official.vision.utils.object_detection import box_list
def _flip_boxes_left_right(boxes):
......
......@@ -33,8 +33,8 @@ images must be handled externally.
import tensorflow as tf
from official.vision.detection.utils.object_detection import box_list
from official.vision.detection.utils.object_detection import shape_utils
from official.vision.utils.object_detection import box_list
from official.vision.utils.object_detection import shape_utils
KEYPOINTS_FIELD_NAME = 'keypoints'
......
......@@ -34,8 +34,8 @@ import PIL.ImageFont as ImageFont
import six
import tensorflow as tf
from official.vision.detection.utils import box_utils
from official.vision.detection.utils.object_detection import shape_utils
from official.vision.beta.ops import box_ops
from official.vision.utils.object_detection import shape_utils
_TITLE_LEFT_MARGIN = 10
_TITLE_TOP_MARGIN = 10
......@@ -107,7 +107,7 @@ def visualize_images_with_bounding_boxes(images, box_outputs, step,
image_shape = tf.shape(images[0])
image_height = tf.cast(image_shape[0], tf.float32)
image_width = tf.cast(image_shape[1], tf.float32)
normalized_boxes = box_utils.normalize_boxes(box_outputs,
normalized_boxes = box_ops.normalize_boxes(box_outputs,
[image_height, image_width])
bounding_box_color = tf.constant([[1.0, 1.0, 0.0, 1.0]])
......
......@@ -265,7 +265,10 @@ class StandardEvaluator(runner.AbstractEvaluator, metaclass=abc.ABCMeta):
Args:
eval_dataset: A `tf.nest`-compatible structure of `tf.data.Dataset` or
`DistributedDataset`.
`DistributedDataset`. On TPUs, if users want to exaust the dataset
without specifying number of eval steps, it is recommended to set
`drop_remainder=False` when batching the dataset, so the infrastructure
can handle the last partial batch properly.
options: An `orbit.StandardEvaluatorOptions` instance.
"""
options = options or StandardEvaluatorOptions()
......
Copyright 2020 The TensorFlow Authors. All rights reserved.
Copyright 2015 The TensorFlow Authors. All rights reserved.
Apache License
Version 2.0, January 2004
......
# Copyright 2021 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""TensorFlow Models Libraries."""
# pylint: disable=wildcard-import
from tensorflow_models import nlp
from tensorflow_models import vision
from official import core
from official.modeling import hyperparams
from official.modeling import optimization
from official.modeling import tf_utils
# Copyright 2021 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""TensorFlow Models NLP Libraries."""
from official.nlp import tasks
from official.nlp.modeling import *
# Copyright 2021 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for tensorflow_models imports."""
import tensorflow as tf
import tensorflow_models as tfm
class TensorflowModelsTest(tf.test.TestCase):
def testVisionImport(self):
_ = tfm.vision.layers.SqueezeExcitation(
in_filters=8, out_filters=4, se_ratio=1)
_ = tfm.vision.configs.image_classification.Losses()
def testNLPImport(self):
_ = tfm.nlp.layers.TransformerEncoderBlock(
num_attention_heads=2, inner_dim=10, inner_activation='relu')
_ = tfm.nlp.tasks.TaggingTask(params=tfm.nlp.tasks.TaggingConfig())
def testCommonImports(self):
_ = tfm.hyperparams.Config()
_ = tfm.optimization.LinearWarmup(
after_warmup_lr_sched=0.0, warmup_steps=10, warmup_learning_rate=0.1)
if __name__ == '__main__':
tf.test.main()
# Copyright 2021 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""TensorFlow Models Vision Libraries."""
from official.vision.beta import configs
from official.vision.beta.modeling import *
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment