Commit b807ff86 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

tensorflow.compat.v2 is no longer needed.

PiperOrigin-RevId: 310289012
parent e2a41868
...@@ -19,7 +19,7 @@ from __future__ import division ...@@ -19,7 +19,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import collections import collections
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.utils.object_detection import argmax_matcher from official.vision.detection.utils.object_detection import argmax_matcher
from official.vision.detection.utils.object_detection import balanced_positive_negative_sampler from official.vision.detection.utils.object_detection import balanced_positive_negative_sampler
from official.vision.detection.utils.object_detection import box_list from official.vision.detection.utils.object_detection import box_list
......
...@@ -19,7 +19,7 @@ from __future__ import division ...@@ -19,7 +19,7 @@ from __future__ import division
# from __future__ import google_type_annotations # from __future__ import google_type_annotations
from __future__ import print_function from __future__ import print_function
import tensorflow.compat.v2 as tf import tensorflow as tf
from typing import Text, Optional from typing import Text, Optional
from official.modeling.hyperparams import params_dict from official.modeling.hyperparams import params_dict
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# ============================================================================== # ==============================================================================
"""Data parser and processing for Mask R-CNN.""" """Data parser and processing for Mask R-CNN."""
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.dataloader import anchor from official.vision.detection.dataloader import anchor
from official.vision.detection.dataloader import mode_keys as ModeKeys from official.vision.detection.dataloader import mode_keys as ModeKeys
......
...@@ -21,12 +21,11 @@ T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar ...@@ -21,12 +21,11 @@ T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar
Focal Loss for Dense Object Detection. arXiv:1708.02002 Focal Loss for Dense Object Detection. arXiv:1708.02002
""" """
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.dataloader import anchor from official.vision.detection.dataloader import anchor
from official.vision.detection.dataloader import mode_keys as ModeKeys from official.vision.detection.dataloader import mode_keys as ModeKeys
from official.vision.detection.dataloader import tf_example_decoder from official.vision.detection.dataloader import tf_example_decoder
from official.vision.detection.utils import autoaugment_utils
from official.vision.detection.utils import box_utils from official.vision.detection.utils import box_utils
from official.vision.detection.utils import input_utils from official.vision.detection.utils import input_utils
...@@ -217,12 +216,6 @@ class Parser(object): ...@@ -217,12 +216,6 @@ class Parser(object):
# Gets original image and its size. # Gets original image and its size.
image = data['image'] image = data['image']
# NOTE: The autoaugment method works best when used alongside the standard
# horizontal flipping of images along with size jittering and normalization.
if self._use_autoaugment:
image, boxes = autoaugment_utils.distort_image_with_autoaugment(
image, boxes, self._autoaugment_policy_name)
image_shape = tf.shape(input=image)[0:2] image_shape = tf.shape(input=image)[0:2]
# Normalizes image with mean and std pixel values. # Normalizes image with mean and std pixel values.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
A decoder to decode string tensors containing serialized tensorflow.Example A decoder to decode string tensors containing serialized tensorflow.Example
protos for object detection. protos for object detection.
""" """
import tensorflow.compat.v2 as tf import tensorflow as tf
class TfExampleDecoder(object): class TfExampleDecoder(object):
......
...@@ -36,7 +36,7 @@ import numpy as np ...@@ -36,7 +36,7 @@ import numpy as np
from absl import logging from absl import logging
from pycocotools import cocoeval from pycocotools import cocoeval
import six import six
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.evaluation import coco_utils from official.vision.detection.evaluation import coco_utils
from official.vision.detection.utils import class_utils from official.vision.detection.utils import class_utils
......
...@@ -27,7 +27,7 @@ from PIL import Image ...@@ -27,7 +27,7 @@ from PIL import Image
from pycocotools import coco from pycocotools import coco
from pycocotools import mask as mask_api from pycocotools import mask as mask_api
import six import six
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.dataloader import tf_example_decoder from official.vision.detection.dataloader import tf_example_decoder
from official.vision.detection.utils import box_utils from official.vision.detection.utils import box_utils
......
...@@ -21,7 +21,7 @@ from __future__ import print_function ...@@ -21,7 +21,7 @@ from __future__ import print_function
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.modeling.training import distributed_executor as executor from official.modeling.training import distributed_executor as executor
from official.vision.detection.utils.object_detection import visualization_utils from official.vision.detection.utils.object_detection import visualization_utils
......
...@@ -25,7 +25,7 @@ from absl import logging ...@@ -25,7 +25,7 @@ from absl import logging
import functools import functools
import os import os
import pprint import pprint
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.modeling.hyperparams import params_dict from official.modeling.hyperparams import params_dict
from official.modeling.training import distributed_executor as executor from official.modeling.training import distributed_executor as executor
......
...@@ -26,7 +26,7 @@ from __future__ import print_function ...@@ -26,7 +26,7 @@ from __future__ import print_function
import functools import functools
import tensorflow.compat.v2 as tf import tensorflow as tf
from tensorflow.python.keras import backend from tensorflow.python.keras import backend
from official.vision.detection.modeling.architecture import nn_ops from official.vision.detection.modeling.architecture import nn_ops
......
...@@ -23,7 +23,7 @@ import pickle ...@@ -23,7 +23,7 @@ import pickle
from absl import logging from absl import logging
import numpy as np import numpy as np
import tensorflow.compat.v2 as tf import tensorflow as tf
from tensorflow.python.keras import backend from tensorflow.python.keras import backend
from official.vision.detection.modeling.architecture import nn_ops from official.vision.detection.modeling.architecture import nn_ops
from official.vision.detection.ops import spatial_transform_ops from official.vision.detection.ops import spatial_transform_ops
......
...@@ -20,7 +20,7 @@ from __future__ import print_function ...@@ -20,7 +20,7 @@ from __future__ import print_function
import functools import functools
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
class NormActivation(tf.keras.layers.Layer): class NormActivation(tf.keras.layers.Layer):
......
...@@ -24,7 +24,7 @@ from __future__ import division ...@@ -24,7 +24,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
from tensorflow.python.keras import backend from tensorflow.python.keras import backend
from official.vision.detection.modeling.architecture import nn_ops from official.vision.detection.modeling.architecture import nn_ops
......
...@@ -21,7 +21,7 @@ from __future__ import print_function ...@@ -21,7 +21,7 @@ from __future__ import print_function
import abc import abc
import functools import functools
import re import re
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.vision.detection.modeling import checkpoint_utils from official.vision.detection.modeling import checkpoint_utils
from official.vision.detection.modeling import learning_rates from official.vision.detection.modeling import learning_rates
from official.vision.detection.modeling import optimizers from official.vision.detection.modeling import optimizers
......
...@@ -24,7 +24,7 @@ from __future__ import print_function ...@@ -24,7 +24,7 @@ from __future__ import print_function
import re import re
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
def _build_assignment_map(keras_model, def _build_assignment_map(keras_model,
......
...@@ -21,7 +21,7 @@ from __future__ import print_function ...@@ -21,7 +21,7 @@ from __future__ import print_function
import functools import functools
import numpy as np import numpy as np
import tensorflow.compat.v2 as tf import tensorflow as tf
from official.modeling.hyperparams import params_dict from official.modeling.hyperparams import params_dict
......
...@@ -19,7 +19,7 @@ from __future__ import division ...@@ -19,7 +19,7 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
def focal_loss(logits, targets, alpha, gamma, normalizer): def focal_loss(logits, targets, alpha, gamma, normalizer):
......
...@@ -18,7 +18,7 @@ from __future__ import absolute_import ...@@ -18,7 +18,7 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import tensorflow.compat.v2 as tf import tensorflow as tf
from tensorflow.python.keras import backend from tensorflow.python.keras import backend
from official.vision.detection.dataloader import anchor from official.vision.detection.dataloader import anchor
......
...@@ -21,7 +21,7 @@ from __future__ import print_function ...@@ -21,7 +21,7 @@ from __future__ import print_function
import functools import functools
import numpy as np import numpy as np
import tensorflow.compat.v2 as tf import tensorflow as tf
class OptimizerFactory(object): class OptimizerFactory(object):
......
...@@ -21,7 +21,7 @@ from __future__ import print_function ...@@ -21,7 +21,7 @@ from __future__ import print_function
import collections import collections
import numpy as np import numpy as np
from absl import logging from absl import logging
import tensorflow.compat.v2 as tf import tensorflow as tf
from tensorflow.python.keras import backend from tensorflow.python.keras import backend
from official.vision.detection.dataloader import mode_keys from official.vision.detection.dataloader import mode_keys
......
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