"magic_pdf/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "376907ef2202892efa933762d45bfb0005f2c19f"
Commit 643d492b authored by Zhenyu Tan's avatar Zhenyu Tan Committed by A. Unique TensorFlower
Browse files

Move anchor generator to keras_cv

PiperOrigin-RevId: 331081952
parent 1eb54e75
...@@ -18,7 +18,6 @@ import collections ...@@ -18,7 +18,6 @@ import collections
# Import libraries # Import libraries
import tensorflow as tf import tensorflow as tf
from official.vision import keras_cv from official.vision import keras_cv
from official.vision.beta.ops.experimental import anchor_generator
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
...@@ -318,7 +317,7 @@ def build_anchor_generator(min_level, max_level, num_scales, aspect_ratios, ...@@ -318,7 +317,7 @@ def build_anchor_generator(min_level, max_level, num_scales, aspect_ratios,
stride = 2**level stride = 2**level
strides[level] = stride strides[level] = stride
anchor_sizes[level] = anchor_size * stride anchor_sizes[level] = anchor_size * stride
anchor_gen = anchor_generator.AnchorGenerator( anchor_gen = keras_cv.ops.AnchorGenerator(
anchor_sizes=anchor_sizes, anchor_sizes=anchor_sizes,
scales=scales, scales=scales,
aspect_ratios=aspect_ratios, aspect_ratios=aspect_ratios,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# ============================================================================== # ==============================================================================
"""Keras-NLP package definition.""" """Keras-CV package definition."""
# pylint: disable=wildcard-import # pylint: disable=wildcard-import
from official.vision.keras_cv.losses import * from official.vision.keras_cv.losses import *
from official.vision.keras_cv.ops import * from official.vision.keras_cv.ops import *
...@@ -13,4 +13,5 @@ ...@@ -13,4 +13,5 @@
# limitations under the License. # limitations under the License.
# ============================================================================== # ==============================================================================
"""Keras-CV layers package definition.""" """Keras-CV layers package definition."""
from official.vision.keras_cv.ops.anchor_generator import AnchorGenerator
from official.vision.keras_cv.ops.iou_similarity import IouSimilarity from official.vision.keras_cv.ops.iou_similarity import IouSimilarity
...@@ -18,7 +18,7 @@ from absl.testing import parameterized ...@@ -18,7 +18,7 @@ from absl.testing import parameterized
import tensorflow as tf import tensorflow as tf
from tensorflow.python.distribute import combinations from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import strategy_combinations from tensorflow.python.distribute import strategy_combinations
from official.vision.beta.ops.experimental import anchor_generator from official.vision.keras_cv.ops import anchor_generator
class AnchorGeneratorTest(parameterized.TestCase, tf.test.TestCase): class AnchorGeneratorTest(parameterized.TestCase, tf.test.TestCase):
......
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