Unverified Commit 451906e4 authored by pkulzc's avatar pkulzc Committed by GitHub
Browse files

Release MobileDet code and model, and require tf_slim installation for OD API. (#8562)

* Merged commit includes the following changes:
311933687  by Sergio Guadarrama:

    Removes spurios use of tf.compat.v2, which results in spurious tf.compat.v1.compat.v2. Adds basic test to nasnet_utils.
    Replaces all remaining import tensorflow as tf with import tensorflow.compat.v1 as tf

--
311766063  by Sergio Guadarrama:

    Removes explicit tf.compat.v1 in all call sites (we already import tf.compat.v1, so this code was  doing tf.compat.v1.compat.v1). The existing code worked in latest version of tensorflow, 2.2, (and 1.15) but not in 1.14 or in 2.0.0a, this CL fixes it.

--
311624958  by Sergio Guadarrama:

    Updates README that doesn't render properly in github documentation

--
310980959  by Sergio Guadarrama:

    Moves research_models/slim off tf.contrib.slim/layers/framework to tf_slim

--
310263156  by Sergio Guadarrama:

    Adds model breakdown for MobilenetV3

--
308640...
parent 73b5be67
......@@ -30,7 +30,7 @@ It also ensures the length of output of the subsample is always batch_size, even
when number of examples set to True in indicator is less than batch_size.
"""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import minibatch_sampler
......
......@@ -16,7 +16,7 @@
"""Tests for object_detection.core.balanced_positive_negative_sampler."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import balanced_positive_negative_sampler
from object_detection.utils import test_case
......
......@@ -19,7 +19,7 @@ from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import post_processing
from object_detection.utils import test_case
......
......@@ -21,7 +21,7 @@ from __future__ import print_function
import collections
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import prefetcher
from object_detection.utils import tf_version
......
......@@ -21,13 +21,11 @@ from __future__ import print_function
import numpy as np
from six.moves import range
import tensorflow as tf
from tensorflow.contrib import slim as contrib_slim
import tensorflow.compat.v1 as tf
import tf_slim as slim
from object_detection.core import batcher
slim = contrib_slim
class BatcherTest(tf.test.TestCase):
......
......@@ -35,7 +35,7 @@ from abc import abstractmethod
from abc import abstractproperty
import six
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.utils import shape_utils
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.core.box_coder."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_coder
from object_detection.core import box_list
......
......@@ -34,7 +34,7 @@ Some other notes:
* Tensors are always provided as (flat) [N, 4] tensors.
"""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.utils import shape_utils
......
......@@ -28,7 +28,7 @@ from __future__ import division
from __future__ import print_function
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_list
from object_detection.utils import ops
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.core.box_list_ops."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_list
from object_detection.core import box_list_ops
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.core.box_list."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_list
from object_detection.utils import test_case
......
......@@ -27,7 +27,7 @@ These modules are separated from the main model since the same
few box predictor architectures are shared across many models.
"""
from abc import abstractmethod
import tensorflow as tf
import tensorflow.compat.v1 as tf
BOX_ENCODINGS = 'box_encodings'
CLASS_PREDICTIONS_WITH_BACKGROUND = 'class_predictions_with_background'
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for google3.third_party.tensorflow_models.object_detection.core.class_agnostic_nms."""
from absl.testing import parameterized
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import post_processing
from object_detection.core import standard_fields as fields
from object_detection.utils import test_case
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""A freezable batch norm layer that uses Keras batch normalization."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
class FreezableBatchNorm(tf.keras.layers.BatchNormalization):
......
......@@ -20,7 +20,7 @@ from __future__ import print_function
import numpy as np
from six.moves import zip
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import freezable_batch_norm
......
......@@ -20,7 +20,7 @@ where the last dimension holds rank 2 tensors of the form [y, x] representing
the coordinates of the keypoint.
"""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
def scale(keypoints, y_scale, x_scale, scope=None):
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.core.keypoint_ops."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import keypoint_ops
from object_detection.utils import test_case
......
......@@ -32,15 +32,11 @@ from __future__ import print_function
import abc
import six
import tensorflow as tf
from tensorflow.contrib import slim as contrib_slim
import tensorflow.compat.v1 as tf
from object_detection.core import box_list
from object_detection.core import box_list_ops
from object_detection.utils import ops
slim = contrib_slim
class Loss(six.with_metaclass(abc.ABCMeta, object)):
"""Abstract base class for loss functions."""
......
......@@ -22,7 +22,7 @@ import math
import numpy as np
from six.moves import zip
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_list
from object_detection.core import losses
......
......@@ -37,7 +37,7 @@ from __future__ import print_function
import abc
import six
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.utils import ops
......
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