diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-07-15 16:13:02 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-07-15 17:17:30 -0700 |
commit | cf401226b973f22b5b8480100afdac582a30c8d7 (patch) | |
tree | baa31332e0ae2fd77cc34b10ee8f2aaa7f1b10fc /tensorflow/core/kernels/non_max_suppression_op.h | |
parent | b6257b3f32ca5d4112672566e7ee15cab269fd26 (diff) |
Adds a non_max_suppression op. This operation performs non max suppression of
bounding boxes, greedily selecting a subset of bounding boxes in descending order
of score, and pruning away boxes that have high intersection-over-union (IOU) overlap
with previously selected boxes.
Change: 127595411
Diffstat (limited to 'tensorflow/core/kernels/non_max_suppression_op.h')
-rw-r--r-- | tensorflow/core/kernels/non_max_suppression_op.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/non_max_suppression_op.h b/tensorflow/core/kernels/non_max_suppression_op.h new file mode 100644 index 0000000000..d4349edf17 --- /dev/null +++ b/tensorflow/core/kernels/non_max_suppression_op.h @@ -0,0 +1,37 @@ +/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +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. +==============================================================================*/ + +#ifndef TENSORFLOW_CORE_KERNELS_NON_MAX_SUPPRESSION_OP_H_ +#define TENSORFLOW_CORE_KERNELS_NON_MAX_SUPPRESSION_OP_H_ + +#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" +#include "tensorflow/core/framework/numeric_types.h" +#include "tensorflow/core/framework/tensor_types.h" + +namespace tensorflow { +namespace functor { + +template <typename Device, typename T> +struct NonMaxSuppression { + void operator()(const Device& d, typename TTypes<float, 2>::ConstTensor boxes, + typename TTypes<float, 1>::ConstTensor scores, + float iou_threshold, int max_output_size, + typename TTypes<int, 1>::Tensor selected_indices); +}; + +} // namespace functor +} // namespace tensorflow + +#endif // TENSORFLOW_CORE_KERNELS_NON_MAX_SUPPRESSION_OP_H_ |