iou3d_nms.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. #if defined(PADDLEINFERENCE_API_COMPAT_2_4_x)
  16. #include "paddle/include/experimental/ext_all.h"
  17. #elif defined(PADDLEINFERENCE_API_COMPAT_2_5_x)
  18. #include "paddle/include/paddle/extension.h"
  19. #else
  20. #include "paddle/extension.h"
  21. #endif
  22. #include "ultra_infer/utils/utils.h"
  23. #if defined(WITH_GPU)
  24. namespace ultra_infer {
  25. namespace paddle_custom_ops {
  26. ULTRAINFER_DECL int boxes_overlap_bev_gpu(paddle::Tensor boxes_a,
  27. paddle::Tensor boxes_b,
  28. paddle::Tensor ans_overlap);
  29. ULTRAINFER_DECL int boxes_iou_bev_gpu(paddle::Tensor boxes_a,
  30. paddle::Tensor boxes_b,
  31. paddle::Tensor ans_iou);
  32. ULTRAINFER_DECL std::vector<paddle::Tensor> nms_gpu(const paddle::Tensor &boxes,
  33. float nms_overlap_thresh);
  34. ULTRAINFER_DECL int nms_normal_gpu(paddle::Tensor boxes, paddle::Tensor keep,
  35. float nms_overlap_thresh);
  36. } // namespace paddle_custom_ops
  37. } // namespace ultra_infer
  38. #endif