import tensorflow as tf

# 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.
# ==============================================================================
"""Box matcher."""

# Import libraries
import tensorflow as tf

from official.vision.beta.ops import box_ops


@tf.keras.utils.register_keras_serializable(package='Vision')
class BoxMatcher(tf.keras.layers.Layer):
  """Match boxes with groundtruth boxes."""

  def __init__(self,
               foreground_iou_threshold=0.5,
               background_iou_high_threshold=0.5,
               background_iou_low_threshold=0,
               **kwargs):
    """Initializes a box matcher.

    Args:
      foreground_iou_threshold: float, represent the IoU threshold for a box to
