提交 6f5b5bc7 编写于 作者: A Abdullah Rashwan 提交者: A. Unique TensorFlower

Internal change

PiperOrigin-RevId: 407421711
上级 6cf9a28c
......@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for Keras metrics functions."""
"""Tests for iou metric."""
import tensorflow as tf
from official.vision.keras_cv.metrics import iou
from official.vision.beta.evaluation import iou
class MeanIoUTest(tf.test.TestCase):
......
......@@ -15,7 +15,7 @@
"""Metrics for segmentation."""
import tensorflow as tf
from official.vision import keras_cv
from official.vision.beta.evaluation import iou
class MeanIoU(tf.keras.metrics.MeanIoU):
......@@ -125,7 +125,7 @@ class MeanIoU(tf.keras.metrics.MeanIoU):
tf.cast(flatten_valid_masks, tf.float32))
class PerClassIoU(keras_cv.metrics.PerClassIoU):
class PerClassIoU(iou.PerClassIoU):
"""Per Class IoU metric for semantic segmentation.
This class utilizes keras_cv.metrics.PerClassIoU to perform batched per class
......
......@@ -20,8 +20,8 @@ from typing import Any, List, Mapping, Optional
import tensorflow as tf
from official.modeling import hyperparams
from official.vision import keras_cv
from official.vision.beta.modeling.decoders import factory
from official.vision.beta.modeling.layers import deeplab
@tf.keras.utils.register_keras_serializable(package='Vision')
......@@ -93,7 +93,7 @@ class ASPP(tf.keras.layers.Layer):
int(p_size // 2**self._config_dict['level'])
for p_size in self._config_dict['pool_kernel_size']
]
self.aspp = keras_cv.layers.SpatialPyramidPooling(
self.aspp = deeplab.SpatialPyramidPooling(
output_channels=self._config_dict['num_filters'],
dilation_rates=self._config_dict['dilation_rates'],
pool_kernel_size=pool_kernel_size,
......
......@@ -17,7 +17,7 @@
import tensorflow as tf
from tensorflow.python.keras import keras_parameterized
from official.vision.keras_cv.layers import deeplab
from official.vision.beta.modeling.layers import deeplab
@keras_parameterized.run_all_keras_modes
......
......@@ -14,7 +14,5 @@
"""Keras-CV package definition."""
# pylint: disable=wildcard-import
from official.vision.keras_cv import layers
from official.vision.keras_cv import losses
from official.vision.keras_cv import metrics
from official.vision.keras_cv import ops
# 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.
"""Keras-CV layers package definition."""
from official.vision.keras_cv.layers.deeplab import SpatialPyramidPooling
# 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.
"""Keras-CV metrics package definition."""
from official.vision.keras_cv.metrics.iou import PerClassIoU
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册