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
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.box_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -20,13 +20,11 @@ All the class prediction heads have a predict function that receives the
`features` as the first argument and returns class predictions with background.
"""
import functools
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.predictors.heads import head
slim = contrib_slim
class MaskRCNNClassHead(head.Head):
"""Mask RCNN class prediction head.
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.class_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -36,7 +36,7 @@ Mask RCNN box predictor.
"""
from abc import abstractmethod
import tensorflow as tf
import tensorflow.compat.v1 as tf
class Head(object):
......
......@@ -19,7 +19,7 @@ Contains Box prediction head classes for different meta architectures.
All the box prediction heads have a _predict function that receives the
`features` as the first argument and returns `box_encodings`.
"""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.predictors.heads import head
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.box_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -19,7 +19,7 @@ Contains Class prediction head classes for different meta architectures.
All the class prediction heads have a predict function that receives the
`features` as the first argument and returns class predictions with background.
"""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.predictors.heads import head
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.class_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -26,7 +26,7 @@ from __future__ import print_function
import math
from six.moves import range
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.predictors.heads import head
from object_detection.utils import ops
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.mask_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -28,11 +28,10 @@ from __future__ import division
from __future__ import print_function
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.predictors.heads import head
slim = contrib_slim
class MaskRCNNKeypointHead(head.Head):
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.keypoint_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -26,14 +26,12 @@ from __future__ import print_function
import math
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.predictors.heads import head
from object_detection.utils import ops
slim = contrib_slim
class MaskRCNNMaskHead(head.Head):
"""Mask RCNN mask prediction head.
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""Tests for object_detection.predictors.heads.mask_head."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -14,11 +14,8 @@
# ==============================================================================
"""Mask R-CNN Box Predictor."""
from tensorflow.contrib import slim as contrib_slim
from object_detection.core import box_predictor
slim = contrib_slim
BOX_ENCODINGS = box_predictor.BOX_ENCODINGS
CLASS_PREDICTIONS_WITH_BACKGROUND = (
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.predictors.mask_rcnn_box_predictor."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import box_predictor_builder
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.predictors.mask_rcnn_box_predictor."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import box_predictor_builder
......
......@@ -14,12 +14,11 @@
# ==============================================================================
"""RFCN Box Predictor."""
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 box_predictor
from object_detection.utils import ops
slim = contrib_slim
BOX_ENCODINGS = box_predictor.BOX_ENCODINGS
CLASS_PREDICTIONS_WITH_BACKGROUND = (
......
......@@ -15,7 +15,7 @@
"""Tests for object_detection.predictors.rfcn_box_predictor."""
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
......
......@@ -14,7 +14,7 @@
# ==============================================================================
"""RFCN Box Predictor."""
import tensorflow as tf
import tensorflow.compat.v1 as tf
from object_detection.core import box_predictor
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